mounting /usr read-only -- didn't this *used* to work?

Robert P. J. Day rpjday at crashcourse.ca
Sun Oct 21 10:08:37 UTC 2007


  once upon a time, after i set up my fedora system, i had a habit of
re-mounting the entire /usr filesystem read-only so that, even as
root, i couldn't do something indescribably stupid and destroy
valuable files.  (theoretically, this remounting should be fine since,
according to the FHS, the contents of /usr should be static and
shareable.)

  all i would do (and demo to students in class, as well, since they
thought it was tres cool), was to use mount with the remount option:

    # mount -oro,remount /usr

  if i try that nowadays, though, i get:

  # mount -oro,remount /usr
  mount: /usr is busy

i can certainly do the above with one of my currently unused
partitions like, say, /opt, but i'm not sure why the /usr filesystem
is considered "busy."

  i'm unsure of the semantics of remounting a FS as read-only -- will
it fail if some file is currently opened with write access?  i've
used "fuser" to (apparently) verify that nothing like that seems to be
happening.  thoughts?  does anyone else remember doing this on earlier
fedora systems, and does it work on your latest version of fedora?
thanks.

rday

p.s.  obviously, if you're going to modify /usr by, say, installing
new packages, you'd temporarily remount /usr RW, do the install, then
switch it back.

p.p.s.  this is with filesystems all running under LVM2.

-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
========================================================================




More information about the fedora-list mailing list