it might be a stupid question but:
http://dwaves.de/2015/05/26/linux-search-find-files-locate-find-linux-locate-scope/
bind mounts under linux:
as far as i understand it: you can mount the same dir in two different places.
but where is the difference to hardlinks?
The bind mounts. Since Linux 2.4.0 it is possible to remount part of the file hierarchy somewhere else. The call is:
mount –bind olddir newdir
is it just another way of making a folder accessible? (but its not actually using any network protocol because it's all local)
please provide some examples pros/cons.
thanks :)
In general hard link is filesystem object, mount point - is kernel entity. Hardlink will persistent during reboot, mount point - isn't.
The difference is that mount --bind
works. Linux does not allow you to create hard links to directories.
Modern OS generally don't allow the manual creation of directory hard links because this can result in hard-to-detect cycles that would cause most recursive programs to choke. Such issues could enable DoS attacks and exploitable crashes.
mount --bind
allows the same functionality, but in a safe way. Any directory mounted under itself will simply appear empty when you try to recurse into it, thereby breaking any such cycles.
You can also mount --bind
individual files. In this case, the difference is that mount --bind
works across filesystems.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With