Re: API for detecting if a partition/filesystem is mounted?
- From: Tim Southerwood <ts@xxxxxxxxxx>
- Date: Wed, 22 Aug 2007 22:45:45 +0100
ben coughed up some electrons that declared:
On 2007-08-21, David Schwartz <davids@xxxxxxxxxxxxx> wrote:
On Aug 20, 9:10 pm, ben <bensc...@xxxxxxxxxxxxxxx> wrote:
I am writing a program that needs to determine if partitions are
mounted or unmounted. Given a string such as "/dev/sda2" which
functions should I be using or which man page should I be looking at?
The program is in C and the kernel is 2.6.x.
This is much more difficult to do than you might think. For example, /
dev/sda2 might be part of a RAID group that is mounted as '/dev/md0'.
You can certainly parse '/proc/mounts'.
Your right, I will need to account for md devices. Thank you.
Don't forget LVM.
Tim
.
- References:
- Prev by Date: some problems about qvfb
- Next by Date: Re: Emulating a slow terminal
- Previous by thread: Re: API for detecting if a partition/filesystem is mounted?
- Next by thread: Re: API for detecting if a partition/filesystem is mounted?
- Index(es):
Relevant Pages
|
|