some files from /home mounted somewhere else

never2far

Active Member
May 6, 2008
34
0
56
Hello,
Here is a situation:
/home partition is on SSD and some directories have big files that can be served from a normal HDD... so I've created a new partition (/extra) on a HDD and mounted (initially with bind) some directories from /home like this:
Code:
mount -o bind /extra/home/user/public_html/pic /home/user/public_html/pic
After this step cPanel started to create the new accounts in the new location(/extra/home/...)

So the solution I have found was to mount using --no-mtab and then new accounts were created again in /home partition. The complete line was like that:

Code:
 mount -o bind --no-mtab /extra/home/user/public_html/pic /home/user/public_html/pic
So now the questions :)

1. Why cPanel on the first situation (mount without --no-mtab) started to create the new accounts under /extra/home/xxx?
2. How good is the second solution (mount with --no-mtab) and if you think there is another way to to the same thing please explain.
3. Let's suppose that there are partitions mounted using --no-mtab ...how can I detect those? From what I have searched there is no file that can identify /extra/home/xxx as being mounted with --bind option.

Thank you
 

Jeff Shotnik

Well-Known Member
Oct 10, 2012
61
0
6
Denver, Colorado, United States
cPanel Access Level
DataCenter Provider
1. cPanel likely was looking for a match to the home directory setting within WHM. If there are multiple matches, it probably uses the last match, which would have been the bind mount in /etc/mtab.
2. -no-mtab sounds like a good solution to me.
3. How are you mounting them in the first place - manually, or via fstab? If via fstab, you'll see the bind mounts in /etc/fstab. If mounting manually with -no-mtab, you'll see the mount in /proc/mounts