Well /proc/mounts contains the list of mounted file systems, but I'm not sure that this will tell you anything that mount does not, although, mount does not seem to access it:
No, the contents of /proc is maintained by the kernel. Programs such as mount interact with the kernel using the system call api.
A mount does not give certainty to the existence of the underlying medium. A filesystem is just an abstraction of the underlying data, it's not a physical thing.
An error will occur when, but not until, the kernel tries to access filesystem data on a non-existent device. The kernel maintains a buffer for accessing data on a device. The buffer is not necessarily read from or written to the device synchronously with accesses to the data by programs. Delays of up to 30s writing to the device can be expected.
Anyway, are you sure that detecting that these devices are mounted as filesystems is what you want? Sometimes when you have intermittent connectivity, the mounting and unmounting can get into a bit of a mess, because it can take a long time for IOs that are in flight to time out, and the file system will remain mounted until the buffers can be flushed. If you know the device name, it would be much more accurate to test the physical connection in /sys/block.
Dick - ---------------------------------------------------------------------- You can find the EdLUG mailing list FAQ list at: http://www.edlug.org.uk/list_faq.html
|
This archive is kept by wibble+RM@xxx.xxx.xxx Morpheux | HomePage |