Re: API for detecting if a partition/filesystem is mounted?



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
.



Relevant Pages

  • Re: Whats the difference between User Accounts and User Accounts2 (userpasswords2)
    ... were electrons flow from + to -. ... > leaving it only in the pwd 2 interface. ... > person changes an account using that interface to no longer ... It is reserved for WINDOWS XP Professional ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Electrons in the universe
    ... The algorithm needs to take all that into account. ... want to come up with a function that estimates the number of electrons ... it needs to take into account all the free electrons that may be out ...
    (sci.physics)