[sf-lug] Linux mounts ... and overmounts and ...
Rick Moen
rick at linuxmafia.com
Tue Nov 9 16:01:44 PST 2021
Quoting Michael Paoli (Michael.Paoli at cal.berkeley.edu):
> That's certainly an approach.
>
> In the land of Linux, I like to not only look at the output of
> mount, but also consult /proc/mounts - as that's the kernel's idea
> of what's mounted where, whereas the output of mount is a bit
> more human friendly ... except when it isn't - like in some
> cases/version and when /etc/mtab is stale - e.g. root filesystem
> is mounted read-only.
>
> Also, for most *nix filesystems, the inode number of the root directory
> of a filesystem, as seen from within that filesystem, is 2.
> So, e.g. ...
> $ (for mp in $(df -T -x tmpfs -x devtmpfs -x iso9660 -x fuse.zfs |
> awk '{if(NR!=1)print $7;}'); do cd "$mp" && ls -id .; done) | sort |
> uniq -c
> 18 2 .
> $
>
> Now ... Linux bind mounts ... very handy ... but still need a better
> way to determine/show with existing bind mounts, exactly what's
> mounted on what.
> Better way might exist, but don't think I've found a good/great answer
> on that one yet.
Isn't it a whole lot simpler if wondering where the contents of the /usr
filesystem went to just be able to type 'ls' and get the answer returned
to you in capital letters? Works fine, even when hitting an ENOCOFFEE
error.
More information about the sf-lug
mailing list