Move Your Home Folder To A Second Drive

Table of Contents

Move Your Home Folder To A Second Drive

By Derek Taylor at February 20, 2020

Make Reinstalling Faster By Having Home On A Second Drive

Note: You may want to drop into tty to perform the following to avoid any weird side effects from doing this within your graphical environment. Also, for this example we will assume that your partition is sdb1 (change this to the id of your drive!). Also, have a backup handy…just in case.

Mount the new partition to /tmp:

sudo mkdir /mnt/tmp
sudo mount /dev/sdb1 /mnt/tmp

Copy your HOME content to the second drive:

sudo rsync -avx /home/ /mnt/tmp

Mount our new HOME partition:

sudo mount /dev/sdb1 /home

If all your data seems to be present on the second drive and new partition, you may delete your old /home directory. To do this, you must first unmount the new /home partition!

sudo umount /home #unmount the new home first!

Then you may delete the original /home:

rm -rf /home/*

Now let’s make your new /home permanent. Get the UUID so we can add it to your fstab:

sudo blkid

Then edit the fstab:

sudo vim /etc/fstab #or nano if you prefer

Add this line at the end of the fstab:

UUID=<noted number from above> /home ext4 defaults 0 2

Now reboot and see if it works!

sudo reboot

Footer

Copyright © 2020-2021 Derek Taylor (DistroTube)

This page is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International License (CC-BY-ND 4.0).

The source code for distro.tube can be found on GitLab. User-submitted contributions to the site are welcome, as long as the contributor agrees to license their submission with the CC-BY-ND 4.0 license.

Author: dt

Created: 2022-02-20 Sun 10:05