Ubuntu – how can I symlink the home folder from another drive


More specifically, I want to have the user folder for my home account another disk that has more space, but keep my other smaller accounts on my ssd. I was able to copy my user folder to another disk, but now I need to link it to the home folder on my ssd, I want it accessible from a normal boot, and please don't tell me that what I did was not the best thing, I just want an answer. How do I get it to create a link that goes from /home/username to /extra-home/username and is recognised by the system when loading the user folders?

Best Answer

Remember that your permissions will need to be the same. In addition to symlink, on more recent distros and filesystems, as root you can also use bind-mount:

mkdir /home/username 
mount --bind --verbose /extra-home/username /home/username

This is useful for allowing access "through" the /home directory to subdirs via daemons that are otherwise configured to avoid pathing through symlinks (apache, ftpd, etc.).

You have to remember (or init script) to bind upon restarts, of course.

Related Question