Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a second large storage hdd mounted in Ubuntu in /media/storage. I would like my home directories for me and all future users of the system to be located on this storage drive as well.

I was thinking that the easiest way to accomplish this was to move /home to /media/storage/home and then create a symlink so that /home points to /media/storage/home. Would this work okay?

The only reason I ask, is because I know that a users home directory has a lot of special configuration information stored in it, so I didn't know if this would screw up anything on the system.

Are there any better alternative methods to relocating the home directory?

share|improve this question
up vote 6 down vote accepted

What you describe is one strategy that will work.

Another would be mounting the drive at /home directly, instead of at /media/storage. If you did this you'd probably want to move any existing data into other folders so you don't end up with extra /home/foo subdirectories.

The main potential problem with both strategies is that no home directories will be available if mounting the storage drive fails for some reason. If that happens, the symlink strategy will probably fail harder; the direct-mount strategy will leave an actual directory, so programs that attempt to access /home/foo will fail, but simply accessing /home will still succeed.

share|improve this answer
And if you have the /home/foo directories hidden by the mount, if the disk ever fails, people will still be able to login. Especially for graphical logins, inability to write to a users home directory means that they can't login. – KeithB Feb 10 '10 at 19:23
@KeithB: yes. you could leave skeletal home directories to be hidden by the mount, although that might not be the optimal choice. it becomes a question of whether you'd want the user to login with a restricted, basic configuration, or whether you'd want the logins to fail so you know to fix the problem. (i thought about making that point in the answer, but it opens up other cans of worms that are a little tangential to the issue at hand.) – quack quixote Feb 10 '10 at 19:29
Okay so I guess my biggest concern is that if my storage drive fails, that /home will not be accessible. The main reason that I want my /home directories on a different drive that the primary OS drive/partition is that my primary drive that the OS is installed on is only like 100 gigs and between multiple users filling up their home directories, that will fill up fast. So having /home on the much larger storage drive would be much better. Is there anyway to have some sort of cascading setup where if /home is on a separate drive that fails to mount, it looks for it elsewhere? – Jake Wilson Feb 10 '10 at 19:36
@Jakobud: it sounds possible but i don't know of an existing solution for that; might need custom scripting to implement. i wouldn't worry about it; you've got good reasons to make this change, and in the event of a mount failure, i'd probably want the system to idle (with logins disallowed or basically useless) until i could handle it manually. – quack quixote Feb 10 '10 at 19:58
you could also look into a solution like LVM that would allow you to have the /home directories to take up space on both drives, but applying LVM to a non-LVM system basically means reinstalling, so it would be some work. if this is for home use, don't worry about it; if for a commercial server, an LVM strategy might be worth considering. – quack quixote Feb 10 '10 at 20:01

Instead of symlinking the whole /home dir to someplace else (say /media/storage/home), create symlinks for every user separately and leave your admin account unlinked so admin can always login

/home/admin is /home/admin

/home/billy is linked to /media/storage/home/billy

share|improve this answer
are there actually any distributions using /home/admin istead of /root as the homefolder for root? either way i think it would still be easier to simply move the admins ~/ somewhere else than creating a symlink for each user. – Baarn Jan 31 '12 at 0:51

You must log in to answer this question.

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