Detect storage device by checking mounted file system to Linux
Hi,
Is there any API to detect file system information in a host. I mean, if a host contains hard disk, USB pen drive and a SD Card connected via PCMCIA slot, is it possible to check if file systems of these storage devices are mounted to the OS? statfs or fstatfs requires file name or file descriptor as pre-requisite, what about if we do not know any file in these devices, but would like to check what kind of storage device is attached to the host by checking file system mounted to it :) |
If I get you right, then ...
Code:
mount Code:
df -h |
See getmntent(3) You may use it on /etc/mtab (and perhaps /proc/mounts too)
|
You can find a file system by label or uuid with findfs. It isn't always accurate though, and I'm not sure how it works over a network.
ta0kira |
Thank you! :)
|
All times are GMT -5. The time now is 06:06 AM. |