mv /var/vmail using howtoforge tutorial

Discussion in 'General' started by W-C, Jan 29, 2018.

  1. W-C

    W-C Member

    Hello,

    One of our servers is running out of space on /home partition in which resides /var/vmail, I added a new HDD and and mounted on /home2.
    I follow this tutorial (https://www.howtoforge.com/use_moun...ctory_of_a_ispconfig_server_to_a_new_location) changing the all the parameters from /home to /home2.
    When I check the /home2 partition I can see the bind mount "linked to /home/vmail"
    ------------------------------------------------------------------------
    [root@mail home2]# ls -lha
    lrwxrwxrwx 1 vmail vmail 12 Mar 28 2014 vmail -> /home/vmail/

    -------------------------------------------------------------------------
    When I checked the fstab file I confirmed that the /var/vmail is redirecting to the new partition:
    [root@mail home2]# cat /etc/fstab
    #
    # /etc/fstab
    # Created by anaconda on Thu Oct 27 03:42:32 2011
    #
    # Accessible filesystems, by reference, are maintained under '/dev/disk'
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    /dev/mapper/vg_natsrv-lv_root / ext4 defaults 1 1
    UUID=d1ad404e-0239-44af-8b5a-5b2af346ce68 /boot ext4 defaults 1 2
    /dev/mapper/vg_natsrv-lv_home /home ext4 defaults 1 2
    /dev/mapper/vg_natsrv-lv_swap swap swap defaults 0 0
    UUID=9eeb3ec9-015a-44f9-8d16-4eefb296a4c8 /home2 ext4 defaults 1 2
    /home2/vmail /var/vmail none bind,nobootwait,_netdev 0 0
    tmpfs /dev/shm tmpfs defaults 0 0
    devpts /dev/pts devpts gid=5,mode=620 0 0
    sysfs /sys sysfs defaults 0 0
    proc /proc proc defaults 0 0
    -------------------------------------------------------------------------------

    But when I check the mount devices I still see /var/vmail on /home partition:
    [root@mail ~]# mount
    /dev/mapper/vg_natsrv-lv_root on / type ext4 (rw)
    proc on /proc type proc (rw)
    sysfs on /sys type sysfs (rw)
    devpts on /dev/pts type devpts (rw,gid=5,mode=620)
    tmpfs on /dev/shm type tmpfs (rw)
    /dev/sda1 on /boot type ext4 (rw)
    /dev/mapper/vg_natsrv-lv_home on /home type ext4 (rw)
    /dev/sdb1 on /home2 type ext4 (rw)
    none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
    sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
    /dev/sdc on /mnt/1TB_eHDD type ext4 (rw)
    /home/vmail on /var/vmail type none (rw,bind,_netdev,nobootwait)

    -----------------------------------------------------------------------------
    Also the /var/vmail are still consuming the space of /home partition:

    [root@mail ~]# df -Th
    Filesystem Type Size Used Avail Use% Mounted on
    /dev/mapper/vg_natsrv-lv_root
    ext4 50G 30G 18G 64% /
    tmpfs tmpfs 4.0G 0 4.0G 0% /dev/shm
    /dev/sda1 ext4 485M 88M 372M 20% /boot
    /dev/mapper/vg_natsrv-lv_home
    ext4 98G 88G 5.3G 95% /home
    /dev/sdb1 ext4 230G 188M 218G 1% /home2
    /dev/sdc ext4 917G 483G 389G 56% /mnt/1TB_eHDD

    -----------------------------------------------------------------------

    How I can fix the issue and move the /var/vmail directory to /home2 partition correctly?

    Kind regards,
     
    Last edited: Feb 1, 2018

Share This Page