I have a shared web server that users can SSH / SFTP into to access their web content.  Each users home directory is in a change root, and I use "mount -o bind" to put their respective webpage's document root into their home directory.  Recently I was made aware that the contents of the mount's source are not the same as the mount point's, which I don't see how that is possible.<div>
<br></div><div>The file system is 3 virtual disks...each part of the same volume group.  I have three LVMs, "/" , "/chroot" , and "/var".</div><div><br></div><div>Here's the entry in /etc/fstab...</div>
<div><br></div><div>/var/www/<a href="http://example.com">example.com</a>   /chroot/home/user1/<a href="http://example.com">example.com</a>   none    defaults,bind   0   0</div><div><br></div><div>The mount is active, yet running a recursive diff between "/var/www/<a href="http://example.com">example.com</a>" and "/chroot/home/user1/<a href="http://example.com">example.com</a>" shows numerous differences.</div>
<div><br></div><div>Here's "mount" output</div><div>------------------</div><div><div>/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)</div><div>proc on /proc type proc (rw)</div><div>sysfs on /sys type sysfs (rw)</div>
<div>devpts on /dev/pts type devpts (rw,gid=5,mode=620)</div><div>/dev/sda1 on /boot type ext3 (rw)</div><div>tmpfs on /dev/shm type tmpfs (rw)</div><div>none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)</div><div>/dev/mapper/VolGroup00-lv_chroot on /chroot type ext3 (rw)</div>
<div>/var/www/<a href="http://example.com">example.com</a> on /chroot/home/user1/<a href="http://example.com">example.com</a> type none (rw,bind)</div><div>/dev/mapper/VolGroup00-lv_var on /var type ext3 (rw)</div><div><br>
</div></div><div><br></div><div>I honestly have no idea how this is possible.  Is using "mount -o bind" not the best method to give a chrooted user access to a single directory outside the chroot?  Would it be better to leave the web root in the chroot and have Apache (outside chroot) reference that location?</div>
<div><br></div><div>Thanks</div><div>- Trey</div>