[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Detecting ro Filesystem



On Sun, May 04, 2003 at 04:27:49PM +0100, steve@einval.com wrote:
> You could parse the output of /proc/mounts and see that way...

In that case you must do a longest match on the output, and make sure you
use a correct physical path (i.e. resolv all symlinks).

# realpath /opt
/usr/local/opt
# LANG=C mount | grep "on /usr/local/opt"
# LANG=C mount | grep "on /usr/local"
/dev/vg0/usr_lv on /usr/local type xfs (rw)

The point here is not to search for /opt in mount result and not to find
/usr as a first match. I am not sure if grepping for the path can be done
with a awk or sed script in a single run easyly.

Greetings
Bernd
-- 
  (OO)      -- Bernd_Eckenfels@Wendelinusstrasse39.76646Bruchsal.de --
 ( .. )  ecki@{inka.de,linux.de,debian.org} http://home.pages.de/~eckes/
  o--o     *plush*  2048/93600EFD  eckes@irc  +497257930613  BE5-RIPE
(O____O)  When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl!



Reply to: