I have a directory mounted as /dev/md2/MyDir. All is great with that.
I want to bind the directory /var/lib/MyDir to it, so that when any application goes to look inside /var/lib/MyDir they actually get to see /mnt/md2/MyDir
apparently all I need to do (as root) is mount --bind /var/lib/MyDir /mnt/md2/MyDir and all will work
I issue the command, no errors. If I add "-v" then I get the message "mount /var/lib/MyDir bound on /mnt/md2/MyDir
mount -l shows the mount as existing.
But in reality it doesn't exist, as drilling into /var/lib/MrDir doesn't reveal what is inside /mnt/md2/MyDir
So why is mount not working - and why does it think it is ?
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
bind mount refuses to work - but no errors anywhere ?
Re: bind mount refuses to work - but no errors anywhere ?
You can only use the bind option for an existing directory, not for devices. Think of mount --bind as something like a shortcut.
So you need to remove that option for /dev/md2/MyDir and instead specify the necessary options for the filesystem used on the RAID volume.
So you need to remove that option for /dev/md2/MyDir and instead specify the necessary options for the filesystem used on the RAID volume.
Re: bind mount refuses to work - but no errors anywhere ?
Bloom wrote:You can only use the bind option for an existing directory, not for devices. Think of mount --bind as something like a shortcut.
So you need to remove that option for /dev/md2/MyDir and instead specify the necessary options for the filesystem used on the RAID volume.
But they are both existing directories. I'm not trying to link a device, but a directory (on a device).
Re: bind mount refuses to work - but no errors anywhere ?
Ah, okay.
The arguments of mount are:
So if you want visitors to /var/lib/MyDir to in fact see the contents of /mnt/md2/MyDir, the first is the target and the second is the source.
You had them reversed. It should be:
Unless you plan to put that in your /etc/fstab, you could do the same with a softlink:
The arguments of mount are:
Code: Select all
mount [options] source target
You had them reversed. It should be:
Code: Select all
mount --bind /mnt/md2/MyDir /var/lib/MyDir
Code: Select all
ln -s /mnt/md2/MyDir /var/lib/MyDir
Re: bind mount refuses to work - but no errors anywhere ?
Ah, facepalm moment I think !
Thanks for your patience !
Thanks for your patience !