I'm installing a SSD and to save space I want to move my user folder to another drive, is there a way to do that?
-
check this: http://askubuntu.com/q/77412/110096 – Coder anonymous Jan 11 '13 at 06:09
-
No instructions there – zShell Jan 11 '13 at 06:13
-
Useful link: http://askubuntu.com/questions/21321/move-home-folder-to-second-drive – saji89 Jan 11 '13 at 07:11
-
can you specify whether your 'other drive' is an internal, mounted harddrive? – don.joey Jan 11 '13 at 08:10
-
It's an internal mounted SSD – zShell Jan 11 '13 at 08:12
-
@zShell were you able to move your home drive to other disk? did you go through my solution? If you are still facing any issue please let me know. – VRU Feb 21 '13 at 05:46
2 Answers
From Terminal type this:
sudo mkdir /mnt/tmp
sudo mount /dev/sdb1 /mnt/tmp
which will allow you to temporarily mount the new partition, assuming /sdb1 as new partition for HOME.
sudo rsync -avx /home/ /mnt/tmp
This will copy HOME to new location.
sudo mount /dev/sdb1 /home
This will mount the new partition as HOME and make sure all data is present.
sudo umount /home
This will unmount the new partion.
rm -rf /home/*
This deletes the old HOME.
To make HOME permanent you need to know the UUID of the new partition for the fstab
entry. you can get that by giving command:
sudo blkid
Note down the UUID and use the same to change fstab
.
sudo nano /etc/fstab
Now add the following at the end.
UUID=<noted number from above> /home ext4 defaults 0 2
NOTE: You need to select the exact file system that was formatted (for example ext4 as chosen here).
Now you can restart your computer to see the new HOME.
Copy all the files from your /home to another drive
Change the /etc/fstab entry to point /home to that drive
If you don't how, reply. I will provide a shell script to do that.

- 482
-
-
May I know how to do it with the script? The above answer didn't work for me. Hoping to try yours. – Teshan N. Jan 18 '16 at 08:56