These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for second hard disk and home directory on the new forum.
Hello,
What the best method to add a second hard disk for home directories? Just create for example a directory /home2 and symlink everything to that hard disk or there is a feature in virtualmin to help me with that?
I mean to symlink only public_html of each website I want to store in second hard disk. Is this going to work?
Thanks
Post edited by: ela, at: 2009/02/17 01:00<br><br>Post edited by: ela, at: 2009/02/17 01:01
I don't really recommend multiple home directories. I don't think suexec will allow it, either. I believe we experimented with symbolic links and suxec in the past (though in a different context and for different reasons) and I think it refused to run things because of the linking outside of /home.
I would recommend using LVS to add the new disk to the volume, and then resize the file system...but if you aren't using LVS, this won't be an option. Red Hat Magazine has some pretty good coverage of LVM and resizing file systems and such.
http://magazine.redhat.com/2008/07/16/tips-and-tricks-what-is-the-proced...
Another option would be to backup your /home, and then add it to either a volume or as a stripe in a RAID. Or, if the new disk is "big enough", just copy everything over to it, and remount it as /home.
Links are never going to be the best choice for something like this.
Virtualmin does have a rather old-fashioned feature where it can put homes into different directories under /home based on the first letter...so, something like, /home/v/virtualmin/ and /home/j/joesdomain, etc. But this is primarily for organization in an environment with thousands of virtual servers. There was also a time where some UNIX file systems got really slow with more than a few hundred files, so sub-directories would be used to keep any individual directory small. But, that's old news. Hasn't been relevant in many, many years. Almost certainly better to keep it flat. And I definitely wouldn't recommend it in your case, where it would be a hack to work around a too small /home. Make /home bigger. That's the only sane option.
--
Check out the forum guidelines!
Oh, yeah, I hope I don't need to remind you that you should have known-good backups before doing anything like this. (You should have known-good backups at all times...but definitely in this case.)
--
Check out the forum guidelines!
Thank you very much for your reply. I have something else in my mind. For example if I use a symlink for /home/domain/public_html to /disk/domain/public_html shouldn't work? I am just testing it right now and I don't have any problems yet.
I dunno. Again, it's not something I'd do. Have you tried running scripts under suexec with the symlinks? I would think it wouldn't work, but I may not understand how suexec determines paths.
--
Check out the forum guidelines!