Mounting a physically separate drive as my home folder? [duplicate]
Solution 1:
(!) Be careful while following these tips (!) because targeting the wrong device may destroy the data on your 120 GB disk (!)
Guessing your 1TB drive is /dev/sdb
:
-
Setup a new disk with the desired partition:
$ sudo fdisk /dev/sdb create a new partition table - command: o create a new partition - command: n (accept all proposed values) specify the type of the new partition - command: t / Type 83 write the data to the disk and leave fdisk - command: w
-
Format the new disk/partition:
sudo mkfs.ext4 -L Home /dev/sdb1
-
Mount the new partition temporarily, change owner, and copy your home-directory:
mount /dev/sdb1 /mnt chown -R $USER.$USER /mnt cp -a $HOME/* /mnt/
-
Unmount the partition:
umount /mnt
-
Look for the UUID assigned to your new partition:
sudo tune2fs -l /dev/sdb1 | grep UUID
-
Edit
/etc/fstab
and add a line:sudo vi /etc/fstab
The new line (take the UUID from the
tune2fs
command) and replaceUSERNAME
with your username i.e. the name of your home directory:UUID=15cc846c-36e4-42dd-8bfe-30acc8965d51 /home/USERNAME ext4 defaults 0 2
After rebooting the system, you should see the 1TB partition mounted as your home directory. If the mount fails, you would see your old home directory as a kind of fallback.