On 12/26/2013 01:11 PM, Robert P. J. Day wrote: > On Thu, 26 Dec 2013, Bart Trojanowski wrote: > >> Similar to chroots, I use bind mounts for containers. This is useful >> to give all containers access to the same /home or for distributing >> /etc/resolv.conf. The latter is actually a very cool use case of >> bind mounts... you can bind a file, not just a directory. > > yes, i was playing with that very feature earlier this morning. it's > not that there's a lack of info on bind mounts; rather, there's a lack > of really good *examples* of its use. Besides what other already said I commonly use it to find out why / (or any other fs with multiple fs mounted on top) is filled up mount --bind / /mnt/root du -sh /mnt/root/*|sort -h since then all the mounted fs won't get included and it even catch if someone manage to fill up /dev, /proc, /sys or /tmp before it's properly mounted. Another use is when I booted a cd in rescue mode and the real fs is mounted under /mnt. "chroot /mnt" kind of works but you have to mount /proc, /sys & /dev properly and for that I normally use bind mount --bind /dev /mnt/dev and so on, and no issues to cleanly umount it later. /ps
Attachment:
signature.asc
Description: OpenPGP digital signature