I have 1 TB SSD and a 120 GB SSD. I'd like to use the 120 drive for
/
/var
/etc
and so on and make a very minimal home folder on that drive. I would then like to mount another drive (which I would name home) over my home folder.
Is this possible?
I have 1 TB SSD and a 120 GB SSD. I'd like to use the 120 drive for
/
/var
/etc
and so on and make a very minimal home folder on that drive. I would then like to mount another drive (which I would name home) over my home folder.
Is this possible?
(!) 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 replace USERNAME
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.
If I understand correctly a simple solution is just to use the mount command if the driver doesnt automatically mount and then using the ln command create a link of your driver to your home folder
basicly your systems should automatically detect the additional driver and you should be able to see it in your devices in your Files. You can then make a link using ln (kind of like a shortcut in windows) from the driver that would be in your /media/"username" to your home folder.
you can't however override your home folder with the new driver, but if thats what you want to do I recommend just create your home folder in your other driver.