Ubuntu – Home directory on external drive

home-directorysyncusb-driveuser datausers

I have two (K)Ubuntu-computers in two different homes. I want them to share the user directory, however.

The optimum would be to have a local user profile on my hard drive and one on my external drive. Syncing the files via cloud or something completely different would also be okay if it is possible but not preferable though.

I tried to create a user with KUser whose home directory is located on the external drive but I was not able to log in. Using usermod -d is not working, too. The method mentioned by david förster did not allow me to log in using the desktop manager.

Thanks in advance 😀

Best Answer

Sorry I disagree with the method you want to use and the proposed answer is far too difficult for something as simple as this.

You should not put /home/ on an external disk. You only put the user directories inside /home/$USER/ on an external disk. The system supports putting your user directories elsewhere with the file ~.config/users-dirs.dirs. Perfect for this kind of setup. No need to mess with user-ids, UUIDs are anything else.

1 simple reason why you do not put /home/ on an external disk: There will be a problem in the future where the external disk does not mount and you will not be able to boot. Making it harder to fix you problems since you will need to fix it from a live session or grub rescue.

Keep /home/ next to your /. When the system does not find the external disk it will boot into an empty (blank) Desktop where /home/$USER/ is used as the base directory. But everything still works and you can use the desktop session to browse the web/AU for the problem you face.

And all you need to do is add both users to the same group and chown the external disk to that group.

Mind also that the external disk MUST be ext if you want to put your /home/ on it. You can not use NTFS. When you use the method describe above you can use NTFS (the directories in /home/$USER/ do not require file permissions that /home/ must have to function).

Related Question