Ask filesystem if it is mounted
- by Brian
How can I see if a (ext3) filesystem is mounted by asking the filesystem directly (i.e. the same way that the system does when it boots and sees that it was not unmounted cleanly)? Checking the output of mount is no good because the filesystem might be mounted by a virtual machine.
I know I can run fsck and it will abort if the filesystem is mounted, but I don't need to actually check the filesystem.