Moving my /Home dir. to a new drive

A few weeks ago I installed Linux mint with a separate /Home partition to a new drive. now I need a larger drive how to move my home folder to a new drive without loosing my data.

Welcome to the forum!

I do not think there is a graphical way to do it. I’ll try to explain in steps.

  • plug the new drive in
  • open gparted (install it from the software store if you don’t have it)
  • create a partition on it (it can be as big as the drive)
  • format the partition with ext4, xfs, or if you want compatibility across OS, exfat (I wouldn’t really recommend exfat though - generally go for ext4, it’s the most battle-tested)
  • close gparted
  • open a file explorer (nemo?)
  • if the partition shows up under your file explorer, click on it and see what path it mounts to (generally a new folder under /media)
  • then open a terminal and use this command to copy the data sudo cp -ra /home/* /media/mounted-disk/, as an example (change this example command with your mount destination path)
  • once that is done, run this command and identify the disk partition: lsblk
  • you should see an output like “/dev/sdb1 /media/mounted-disk” (or something like this) for your new drive
  • find out the unique ID of the drive partition with: ls -lh /dev/disk/by-uuid/ | grep sdb (replace “sdb” in the command with the letter you find in lsblk, it should show you the UUID pointing to the disk and partition of your new drive)
  • edit /etc/fstab and change the /home mount point with the new drive: sudo nano /etc/fstab
  • add a “#” (without quotes) on the line containing /home
  • add a new line, something like this: UUID=the-UUID-you-found /home ext4 defaults 0 0 (ideally, you copy the line you commented with “#” and you only replace the UUID and the partition type, like “ext4” with whatever you used)
  • reboot

Done. Make sure you make no mistakes, otherwise you might not be able to log in your own account (you should be able to log in as root, if you have set a password for the root user).

2 Likes

Thanks for your help. I finally figured it out. with your help works great. thanks.