Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I would like to setup a server (Centos) and this server has got two hard drives. In the first hard drive I wish to install Centos 5.7 and the second hard drive I plan to dedicate to home directories of the users.
Normally if I create home directory for users, it is like /home/john, /home/mark, /home/leena. But now I want to create home directories to be in /mnt/data/home/john, /mnt/data/home/mark and /mnt/data/home/leena where the second hard drive mounted at /mnt/data. Whenever these users login, they should be directed to /mnt/data/home/(users).
I have searched on the internet on how to setup this, but seems does not help me much.
It would be pleasure if I can get some help or guide to achieve this.
Do you want to set that up for all users you will create going forward? Do you already have /mnt/data/home created? If answer to both the questions is "yes" then you can simply edit /etc/default/useradd script as follows:
I would like to setup a server (Centos) and this server has got two hard drives. In the first hard drive I wish to install Centos 5.7 and the second hard drive I plan to dedicate to home directories of the users.
separation of system/code and user data, always a good idea.
Quote:
Originally Posted by vjramana
Normally if I create home directory for users, it is like /home/john, /home/mark, /home/leena. But now I want to create home directories to be in /mnt/data/home/john, /mnt/data/home/mark and /mnt/data/home/leena where the second hard drive mounted at /mnt/data. Whenever these users login, they should be directed to /mnt/data/home/(users).
I'd rather recommend you to keep the standard /home/* directories, and mount your second hard disk to /home instead of /mnt/data.
If you want to do that, copy all existing home directories first, for example /home/john to /mnt/data/john (while the second hard disk is mounted to /mnt/data). When you copied all existing profiles from /home, unmount the drive from /mnt/data an re-mount it to /home. I'd recommend to do that by a static mount in /etc/fstab.
Result: The home directories remain "standard" (/home/user), but they're located on the second hard disk.
Once you established that everything works, you log in as root, temporarily unmount the /home volume, and delete everything in the original /home directory to regain the space. Re-mount /home, and you're done.
I have checked on my system and it works perfectly fine. Did you compare the permissions of /home and /mnt/data/home.
It appears to me that user does not have read / excute permissions on /mnt/data and thus it is not able to get into his home directory. Default /home permissions are drwxr-xr-x. You have to setup /mnt/data/home the same way. Paste the output of the following commands:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.