Ask filesystem if it is mounted
Posted
by Brian
on Server Fault
See other posts from Server Fault
or by Brian
Published on 2010-05-20T18:24:57Z
Indexed on
2010/05/20
18:32 UTC
Read the original article
Hit count: 186
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.
© Server Fault or respective owner