/home Folder

Intro

(Nearly) all my data is stored in a separate partition. In this way, it is quite easy to make a fresh install without losing (any) data. Info copied from askUbuntu. (here and here).

How to

First you want the UUID of the drive so it can be reliably mounted.

sudo blkid

That will return a list of all your partitions and their UUIDs. Just note the UUID of the partition you want mounted as home. If you are not sure, which one is the correct one, you can open them in the File Explorer and then “Open in Terminal”. The UUID should be part of the path.

Then you just need to edit /etc/fstab to auto-mount that partition as /home.

sudoedit /etc/fstab

And add a line like this:

UUID=b14a4271-89b5-4ace-b91a-b604e7329b11 /home ext4 defaults 0 2

Reboot. If you cannot login (black screen), force a reboot, and then change to TTY (Ctrl+Alt+F2). Apply permissions on all files and directories in the new /home folder:

sudo chown -R $USER:$USER /home/$USER
sudo chmod -R a+rwX,o-w /home/$USER

Reboot and try to login in GUI again. If it still does not work, according to one forum, also

sudo mkhomedir_helper $USER

might help (but I did not try myself as of January 2025).