I have more than one home partition. I need all services to use both the old and new partitions.


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » System Level » File System

I have more than one home partition. I need all services to use both the old and new partitions.Last Modified: Sep 18, 2012, 3:53 pm
As your /home partition fills up, adding a 2nd partition is an option.
For this example, we'll call it:

/home2

There are a few things you'll need to update in order to make use of this 2nd partition.

1) System quotas.   Similar to /home, you'll need to mount /home2 with the usrquota,grpquota option and calculate the system quotas.

2) Tell DA about the new partition, so that quotas are included from it:
http://www.directadmin.com/features.php?id=611

3) Set your useradd (or related) binary to create new home directories in /home2.  This can vary per OS, but on RedHat/CentOS systems, you'd edit:

/etc/default/useradd

and set the new home, eg:

HOME=/home2

DA itself does not specify which home partition is to be used for useradd (or pw).

4) Exim is the last item that does not always do full lookups on /etc/passwd, so a few changes are required.
You can either a) either edit the /etc/exim.conf with these changes, but this will have a slight performance hit, as the /etc/passwd would need to have a lookup for each email.
or you can b) create links for all Users to the new home, so that the /home/user paths point to /home3/user.

Option b) would be as follows:
- Create the file:

/usr/local/directadmin/scripts/custom/user_create_post.sh


- Then add the following code, and chmod the script to 755:

#!/bin/sh

NEWHOME=/home3/$username
OLDHOME=/home/$username

if [ -d "${NEWHOME}" ] && [ ! -e "${OLDHOME}" ]; then
   ln -s $NEWHOME $OLDHOME
   chown -h $username:$username $OLDHOME
fi
exit 0;

and if you need to create the links for existing Users, you can run it manually for each user like this (depending on your shell)

username=username ./user_create_post.sh

where you'd replace usernamne with the user you'd like to create links for.

 
Related Helpfiles
I have more than one home partition. I need exim to find all home paths.

2003 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST