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: Tory MP in 4x4 fined for momentary lapse of concentration
    ... Martin twisted the electrons to say: ... this should be taken into account and you should be held even more ... safer car) that could've made the ... These opinions might not even be mine ... ...
    (uk.rec.cycling)
  • 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)
  • Re: Argentine railways
    ... andypurk@xxxxxxxxx twisted the electrons to say: ... population are taken into account? ... These opinions might not even be mine ... ... Let alone connected with my employer ... ...
    (uk.railway)