Moving `/home` to secondary storage device
I wrote a guide for a customer on how to place their home partition on their extra drive. This customer mentioned a preference for using a GUI, so this uses GNOME Disks for most of the tasks.
I would expand this guide with Terminal equivalents for those so inclined.
Maybe also look into moving home with a GUI and mention a GUI rsync client, to remove all the Terminal commands from the GUI section
Move /home to another storage device
- Rename the
/homefolder to anything else (I use/home-bakpersonally)
Terminal
sudo mv /home /home-bak
-
Set the extradrive to mount to
/homeat boot. We are doing this now so the partition mounts to the correct location,/homeGNOME Disks
-
Find the drive in the list on the left, and select it
-
Select the partition you want to be the home partition (likely the only partition) in the "Volumes" section
-
Click the Gear icon below the partitions
-
Turn off "User Session Defaults"
-
Changes for using the drive as a home directory:
- Mount at system startup -- Checked
- Show in user interface -- Unchecked (If this is checked, you will see your home directory twice in the Files app)
- Require additional authorization to mount -- Unchecked
- Mount Point:
/home
-
Click "OK"
-
Mount the new home partition to
/home
Press the Play button under the partitions listed in the "Volumes" section
-
-
Copy the files from
/home-bakto/home
I recommend using rsync here, as it will make sure the permissions and attributes for all the files are kept while copying your files. Without this, I have seen odd behavior from some applications when they are not copied with rsync
Make sure the first location ends with a /. This will copy the contents of /home-bak into /home. Without this trailing /, you will end up with the /home-bak folder copied into /home (e.g. /home/home-bak)
sudo rsync -avhx /home-bak/ /home
-
Reboot your system to test that the changes are working
-
Verify your data is present in the new, now current, home directory
-
Delete
/home-bak
Terminal
sudo rm -rf /home-bak
grsync seems to be a good candidate for replacing step 3 with a GUI