1

I wish to mount a new disk at /disk on my raspberry server. My /home/iago-lito folder and the /root folder are standing on the SD card, which is fine to me. But I would like subsequent new user home folders to be stored on the disk.

Instead of messing around with partitions and /home/newuser{1,2,3,..} mounting points, I intend to simply link each home folder to the disk, with:

ln -s /disk/home/newuser1 /home/newuser1

Is it okay to do something that simple? Are there downsides in terms of safety, performance or security?

4
  • 1
    It might get very confusing if the amount of users grow. Alternatively you also could configure a different user HOME directory than /home/<user> when creating the user. It also could be /disk/home/<user> which can also be changed in /etc/passwd afterwards.
    – Thomas
    Commented Feb 12, 2017 at 9:11
  • @Thomas Do you mean adduser newuser1 --home /disk/home/newuser1? This sounds neat. What should I do with /etc/passwd then?
    – iago-lito
    Commented Feb 12, 2017 at 9:17
  • 1
    Yes, --home would set the location of the user's home directory. You do not have to toch /etc/passwd if you create the user with --home. That only would be necessary if you already added a user with /home/<user> and want to change it to /disk/home/<user>.
    – Thomas
    Commented Feb 12, 2017 at 9:20
  • @Thomas Great. Feel free to post adduser newuser --home /any/fancy/location as an answer then :) Cheers!
    – iago-lito
    Commented Feb 12, 2017 at 9:23

1 Answer 1

1

Creating symbolic links for each user home directory might get confusing if the amount of users grow and you have to take care of creating the symbolic links.

Alternatively you also could configure a different user HOME directory than /home/<user> when creating the user.
It also could be /disk/home/<user> which can also be changed/moved afterwards or for already existing users in /etc/passwd or by using usermod.

Depending on your distribution, the option to change default user home directory when creating the user would be --home or --home-dir. In doubt look it up in the corresponding man page.
An example for your case would be as follows.

adduser newuser --home /disk/home/newuser

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .