I am trying to check for the current status of a mounted partition, rw/ro. On Cent6 /proc/self/mountinfo has some interesting info. One of the items contained in the output for each mount point is "mount options: per-mount options." the other one is "super options: per-super block options."
I am wondering how these compare to each other. I have read man pages till I am blue in the face and the animal book on Understanding The Linux Kernel. What I would like to know specifically is that if for some reason a drive all of a sudden because ro, Linux detects and issue and tried to protect itself, would the super options be changed as well, or would those reflect the original state of the drive? I am looking for an absolute way to test if a drive it rw according to the OS. Fstab won't work, and I have been reading not to trust mount, /proc/mounts was what I have been using as mountinfo is not available to be on my Cent5 boxes. I know I can just touch a file but I was looking for an OS level way, not a "user" level way. What I hoped was I could compare the mount-options and super-options and if they match good, if not fail.
I would also take any more reading tips, I have read through a fair amount of commit notes on mountinfo as well and some of the bug reports from Redhat about /proc/mounts which is what led me to mountinfo in the first place.
Thanks