I have 2 HDD drives in my computer. At the moment second drive is mounted as
How can I move my user data from
Can I just move the data over there and then simply symlink it back?
If you want to just move your home directory i.e /home/your-username then simply copy your home directory to other partition and then use System->Administration->Users & Groups to open user settings dialog. Click on the keys icon to authenticate your self
After that select the user that you want to change and click properties, go to advanced tab
change the home directory to new directory i.e the directory that you copied to other partition.
To avoid side effects while working in a graphical, environment we should perform all actions to move HOME from a terminal with Ctrl+Alt+F1.
sudo mkdir /mnt/tmp sudo mount /dev/sdb1 /mnt/tmp
assuming /sdb1 is the new partition for HOME
sudo rsync -avx /home/ /mnt/tmp
We then may mount the new partition as HOME with
sudo mount /dev/sdb1 /home
to make sure all data are present. Easiest is to delete the old
/home at this point (you could do this later but then you will have to boot a live system to see the old home):
sudo umount /home #unmount the new home first! rm -rf /home/* #deletes the old home
We need to know the UUID of the new partition for the
fstab entry seen from:
Note or copy/paste the correct UUID to edit your
sudo nano /etc/fstab #or any other editor
and add the following line at the end:
UUID=<noted number from above> /home ext4 defaults 0 2
Take care to choose the appropriate filesystem here, e.g.
ext3 if ext3 formatted
After a reboot, your
/home resides on the new drive having plenty of space.
The official detailed procedure is here on the Ubuntu help wiki
sudo -H gedit /etc/fstab
and add these lines into it
UUID=???????? /media/home ext4 defaults 0 2
and replace the
???????? with the UUID number of the intended
Save and close the
fstab file, then type the following command:
sudo mkdir /media/home
/hometo the new partition
sudo rsync -aXS --progress --exclude='/*/.gvfs' /home/. /media/home/.
sudo diff -r /home /media/home -x ".gvfs/*"
Note: You can also expect to see some errors about files not found. These are due to symbolic links that point to places that don't presently exist (but will do after you have rebooted). You can ignore these - but check out anything else.
sudo -H gedit /etc/fstab
and now edit the lines you added earlier, changing the
/media/home part to simply say
/home so that it looks like this:
UUID=???????? /home ext4 defaults 0 2
cd / && sudo mv /home /old_home && sudo mkdir /home
Reboot or remount all with this:
sudo mount -a
Indeed. it is a great way to easily change the home directory location of a specific user. While reading the question, I was understanding that this would have been for the /home directory globally. In this case, you could create the partition on the other device, manually move all files there and then change the device for the mount point in /etc/fstab file itself
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?