mount bind, preserving directory contents
Hi everyone
Just had a bit of a scary moment when messing about with mount --bind I have a directory full of files/directories that I wished to make accessible under another mount point (for FTP users) So I ran... Code:
mount --bind /var/ftp/user/newmountpount /mnt/raid6/folder/ So here's my question... Is there a way to have it so that the files/sub-directories are there when the mount bind is both mounted and unmounted? Or is it a case of moving the existing files somewhere else. Doing the mount --bind Moving the files back again. Then I guess I should also make an entry in fstab to re-mount when the machine is restarted. Cheers, B |
The manual says "--move" moves the directory tree from A to B but "--bind" makes the directory tree accessible in both places. So I wonder how you determined the "files where not there". If it's over FTP then maybe there's a problem with access permissions? (And wrt permissions also see Fuse-bindfs.)
|
The destination folder is also a samba share and as soon as i did a bind mount the files disappeared from the share.
Also i tried an ls -lah and there were no files returned in the file listing |
I think you got the source and destination switched. Here is some information from the mount manual page.
Quote:
|
Everytime, when you mount something in one directory, it contents will be hidden and you see only the new content from mounted device. If you want to see two or more devices in one place look for unionfs. But I don't known if it works with samba. Anyway, why do you want to mount ftp directory in samba shared directory, create other directory and mount to it.
|
Hi everyone
Thanks for the info. Thanks to your help I've figured it out. I had the src and destination switched around the wrong way in my mount --bind command. Fortunately it didn't trash the data in that directory. So for the record, what I actually wanted to do was this... Code:
mount --bind /mnt/raid6/folder/ /var/ftp/user/newmountpount Cheers, B |
All times are GMT -5. The time now is 08:50 PM. |