Moving $HOME to a separate data partition?

Ralf Mardorf kde.lists at yahoo.com
Wed Oct 13 20:04:55 UTC 2021


Assuming the default login shell bash, when running

$ sudo mkdir /mnt/home
$ sudo mount /dev/sda3 /mnt/home/
$ sudo cp -ai /home/bosse/ /mnt/home/

the result is

/mnt/home/bosse/dir1/
/mnt/home/bosse/dirn/
/mnt/home/bosse/big1/
/mnt/home/bosse/bign/

with all privileges and attributes preserved. Symbolic links are
just copied, not followed.

When running

$ sudo mkdir /mnt/bosse
$ sudo mount /dev/sda3 /mnt/bosse/
$ sudo cp -ai /home/bosse/{dir1,dirn,big1,bign} /mnt/bosse/

The result is

/mnt/bosse/dir1/
/mnt/bosse/dirn/
/mnt/bosse/big1/
/mnt/bosse/bign/

with all privileges and attributes preserved. Symbolic links are
just copied, not followed.

The user gets read/write access by just mounting, no symbolic links or
bind mounts are needed. No need to care about chown, chmod, umask.

Links and/or bind mounts might be useful, but aren't needed. Be
careful, try to avoid using links and/or bind mounts comparable to the
way some inexperienced programmers write spaghetti code. 




More information about the ubuntu-users mailing list