On this page

  1. Links

Use mount --bind To Move The Website And Email Directory Of a ISPConfig 3 Server To a New Directory

In the following guide, I will explain the procedure on how to move the email and website directory of a ISPConfig 3 installation to a new partition. This might become handy when your current partition runs out of space. I will use a bind mount for this, a symlink will not work here as ISPConfig checks path for symlink attacks, so if the website or email path contains a symlink, ISPConfig will reject to write to that directory. In this example, I will move the www and email directory to the /home partition. You dont have to move both partitions together, so moving just the email or web partition will work as well.

Stop the email and web server

service postfix stop
service dovecot stop

When you use apache, use:

service apache2 stop

For nginx server, use:

service nginx stop

Move the email directory to the /home partition

mv /var/vmail /home/

and create a new mount point with correct permissions

mkdir /var/vmail
chown vmail:vmail /var/vmail

Move the www directory to the /home partition

chattr -i /var/www/clients/client*/web*
umount /var/www/clients/client*/web*/log
mv /var/www /home/

and create a new mountpont

mkdir /var/www

Now edit the /etc/fstab file to add the 2 bind mounts

vi /etc/fstab

add the following 2 lines right after the lines for your harddisk partitions

/home/vmail /var/vmail none bind,nobootwait,_netdev 0 0
/home/www /var/www none bind,nobootwait,_netdev 0 0

apply the new mount configuration

mount -a

and start the services

service postfix start
service dovecot start

for apache servers:

service apache2 start

for nginx servers use:

service nginx start


Share this page:

2 Comment(s)

Add comment


From: js

Where en how do I edit  /etc/fstab to make this ("remount-ro,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0") back working?

# /etc/fstab: static file system information.

# Use 'blkid' to print the universally unique identifier for a

# device; this may be used with UUID= as a more robust way to name devices

# that works even if disks are added and removed. See fstab(5).

# <file system> <mount point>   <type>  <options>       <dump>  <pass>

proc            /proc           proc    defaults        0       0

# / was on /dev/vda1 during installation

UUID=ce8a4f13-1cd5-4f40-95ad-19522d5a5d82 /               ext3    errors=remount-ro,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 0       1

UUID=992212e3-4582-459c-944b-48f05476cae7 /data-disk ext4 errors=remount-ro 0 0

/data-disk/www /var/www none bind,nobootwait,_netdev 0 0

/data-disk/vmail /var/vmail none bind,nobootwait,_netdev 0 0



From: babydunk


i would like to move the /var/backup dir because my backups are taking up far to much space for the root partition


would this be the right way to do that

mv /var/backup /home

mkdir /var/backup

nano /etc/fstab


/home/backup /var/backup none bind,nobootwait,_netdev 0 0


mount -a


service nginx start


thanks for you help in advance