My thoughts are, after creating the directory structure for the user on /dev/sdb I should mount that directory to the user directory for that user from within fstab. But this likely isn't the best method and I have no idea how I would handle the permissions. Can I please have some direction as to how to go about doing this?
1 Answers
In principle, you can proceed as following. The details depend on where your other drive is mounted, the specific user name, etc. Anything you do at this level obviously requires administration privileges ("root rights" in linux speak).
1. Create the new account -The easiest way to create a new user and then have the home folder of the user on another disk, would be to first create the account using the GUI (Settings - Users). Then, a full default home will be created for the user in the /home folder, with proper permissions set and all default Ubuntu configuration in place. Let us assume the login of the new user is user
. Then, a new folder /home/user
will be created.
2. Move the newly created user home folder to the other drive - Then you want to move that folder user
out to the other disk. A move will preserve all permissions and properties. To move with administrator privileges, precede the command with sudo
.
3. Link to the moved folder in the /home directory - Then, you can create a symbolic link, also named user
under the \home
folder. That symbolic link redirects to the real user
folder on the other disk. The terminal command is ln
, so it will be something like sudo ln -s /<path_to_your_second_drive>/user /home/user
. First argument is the target of the link, i.e. your user
folder on the other drive, second argument is the name of the link, i.e. user
under your /home
.
Using symbolic links is by far the simplest approach. However, another approach would be a "mount bind". This requires an extra line in the configuration file /etc/fstab
, where the folder user
on the other drive is mount-bound to an (can be empty, otherwise you just loose the space) folder user
under /home
.

- 88,010
fstab
should allow mounting filesystem with owner and/or uid options perfectly fine. I've done that long ago. But your question could use a bit of clarification as to what exactly you're trying to do. Mount filesystem as user's home during boot ?or mount it whenever ? – Sergiy Kolodyazhnyy Jun 25 '19 at 07:39I'm trying to create a specific user home on a seperate drive (/dev/sdb1/usr) under a specific directory. OR I'm trying to mount that specific directory on the drive (/dev/sdb1/usr) within the user directory on the main disk (/dev/sda2/home/usr). I am not sure which method would be better, or how to do method 1. Also not sure about what changes to permissions I will need to make in either case.
– tameddysphoria Jun 25 '19 at 08:29