Using mount --bind to save space on partition

BassTeQ

Well-Known Member
Aug 31, 2008
76
8
58
Hi all,

I have created a bind mount to move data to a larger partition. Mount is showing this
Code:
/usr/local/stuff on /home/stuff type none (rw,bind)
Once mounted I copy some files into /usr/local/stuff, but when I run command 'df' it's now showing less free space then I had before? Any ideas?

Thanks
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Hello :)

You can try recalculating disk space usage with the following command:

Code:
/scripts/fixquotas
Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
You can paste the output from the following commands:

Code:
mount
cat /etc/fstab
Thank you.
 

BassTeQ

Well-Known Member
Aug 31, 2008
76
8
58
Output from mount

Code:
/dev/sda5 on / type ext3 (rw,noatime,usrquota)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda8 on /home type ext3 (rw,noatime,usrquota)
/dev/sda6 on /tmp type ext3 (rw,noexec,nosuid)
/dev/sda3 on /usr type ext3 (rw,noatime,usrquota)
/dev/sda2 on /var type ext3 (rw,noatime,usrquota)
/dev/sda1 on /boot type ext3 (rw,noatime)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/tmp on /var/tmp type none (rw,noexec,nosuid,bind)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/sdb2 on /backup/var type ext3 (rw)
/dev/sdb3 on /backup/usr type ext3 (rw)
/dev/sdb6 on /backup/tmp type ext3 (rw)
/dev/sdb8 on /backup/home type ext3 (rw)
/dev/sdb5 on /backup/basedir type ext3 (rw)
/usr/local/stuff on /home/stuff type none (rw,bind)
Output from fstab

Code:
/dev/sda5               /                       ext3    noatime,defaults,usrquota        1 1
/dev/sda8               /home                   ext3    noatime,defaults,usrquota        1 2
/dev/sda6               /tmp                    ext3    noatime,defaults        1 2
/dev/sda3               /usr                    ext3    noatime,defaults,usrquota        1 2
/dev/sda2               /var                    ext3    noatime,defaults,usrquota        1 2
/dev/sda1               /boot                   ext3    noatime,defaults        1 2
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
/dev/sda7               swap                    swap    defaults        0 0
/usr/local/stuff       /home/stuff          none    bind            0 0
Thanks!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Feel free to open a support ticket using the link in my signature so we can take a closer look and determine if there are any obvious problems with your configuration. You can post the ticket number here so we can update this thread with the outcome.

Thank you.
 

BassTeQ

Well-Known Member
Aug 31, 2008
76
8
58
Hi Michael,

I've worked out the issue, in /etc/fstab I had the directories around the wrong way. I've changed it to this

Code:
/home/stuff            /usr/local/stuff          none    bind            0 0
When I then 'mount /home/stuff' is doesn't occupy any space in /usr, which is what I was expecting to see.

Thanks for your help!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Thank you for updating us with the outcome. I am happy to see you were able to resolve the issue.