FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 12-29-2007, 11:17 PM
"Robert P. J. Day"
 
Default mounting /usr readonly

something i brought up a while back but, in order to prevent myself
doing something incredibly dumb and wiping out anything under /usr by
accident, i like to mount the /usr filesystem as read-only.
occasionally, when i've tried to do that manually, i've been
disallowed with the error that that filesystem is currently busy, and
one of the possible reasons is that prelink was running.

more generally, i'm assuming that (re)mounting /usr readonly will
always be disallowed if anything is currently open for write, and the
simplest way to check for that that i use is:

$ fuser -muv /usr
USER PID ACCESS COMMAND
/usr: rpjday 3142 ...e. (rpjday)gnome-keyring-d
rpjday 3143 ...e. (rpjday)gnome-session
rpjday 3208 ...e. (rpjday)dbus-launch
rpjday 3216 ...e. (rpjday)gconfd-2
rpjday 3220 ...e. (rpjday)gnome-settings-
rpjday 3228 ...e. (rpjday)gconf-helper
rpjday 3229 ...e. (rpjday)metacity
rpjday 3230 ...e. (rpjday)gnome-panel
rpjday 3232 ...e. (rpjday)nautilus
rpjday 3236 ...e. (rpjday)gnome-volume-ma
rpjday 3238 ...e. (rpjday)bonobo-activati
rpjday 3245 ...e. (rpjday)gnome-vfs-daemo
rpjday 3247 ...e. (rpjday)bluetooth-apple
rpjday 3253 ...e. (rpjday)nm-applet
rpjday 3254 ...e. (rpjday)puplet
rpjday 3255 ...e. (rpjday)python
rpjday 3261 ...e. (rpjday)pam-panel-icon
rpjday 3262 ...e. (rpjday)gnome-power-man
rpjday 3267 ...e. (rpjday)/usr/bin/sealer
rpjday 3294 ...e. (rpjday)gnome-screensav
rpjday 3306 ...e. (rpjday)mapping-daemon
rpjday 3327 ...e. (rpjday)wnck-applet
rpjday 3329 ...e. (rpjday)trashapplet
rpjday 3347 ...e. (rpjday)gam_server
rpjday 3361 ...e. (rpjday)notification-ar
rpjday 3363 ...e. (rpjday)fast-user-switc
rpjday 3365 ...e. (rpjday)clock-applet
rpjday 3367 ...e. (rpjday)mixer_applet2
rpjday 3371 ...e. (rpjday)gnome-terminal
rpjday 3381 ....m (rpjday)bash
rpjday 3462 f...m (rpjday)firefox
rpjday 3482 f...m (rpjday)run-mozilla.sh
rpjday 3487 f..e. (rpjday)firefox-bin
rpjday 3524 ....m (rpjday)bash
rpjday 3905 f..e. (rpjday)npviewer.bin
rpjday 4062 ....m (rpjday)bash


now, according to the man page for fuser, anything open for write
will be identified with an "F", so the above should be good and, in
fact, the remount worked.

can i assume that, as long as nothing is open for write, the
read-only remount should work? is there any other reason that i would
be told that the device is busy. put another way, if i run the above
command and don't see an "F", should the remount always work?

rday
--


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

Home page: http://crashcourse.ca
Fedora Cookbook: http://crashcourse.ca/wiki/index.php/Fedora_Cookbook
================================================== ======================

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-30-2007, 05:29 AM
John Summerfield
 
Default mounting /usr readonly

Robert P. J. Day wrote:

something i brought up a while back but, in order to prevent myself
doing something incredibly dumb and wiping out anything under /usr by
accident, i like to mount the /usr filesystem as read-only.
occasionally, when i've tried to do that manually, i've been
disallowed with the error that that filesystem is currently busy, and
one of the possible reasons is that prelink was running.

more generally, i'm assuming that (re)mounting /usr readonly will
always be disallowed if anything is currently open for write, and the
simplest way to check for that that i use is:

$ fuser -muv /usr
USER PID ACCESS COMMAND
/usr: rpjday 3142 ...e. (rpjday)gnome-keyring-d
rpjday 3143 ...e. (rpjday)gnome-session
rpjday 3208 ...e. (rpjday)dbus-launch
rpjday 3216 ...e. (rpjday)gconfd-2
rpjday 3220 ...e. (rpjday)gnome-settings-
rpjday 3228 ...e. (rpjday)gconf-helper
rpjday 3229 ...e. (rpjday)metacity
rpjday 3230 ...e. (rpjday)gnome-panel
rpjday 3232 ...e. (rpjday)nautilus
rpjday 3236 ...e. (rpjday)gnome-volume-ma
rpjday 3238 ...e. (rpjday)bonobo-activati
rpjday 3245 ...e. (rpjday)gnome-vfs-daemo
rpjday 3247 ...e. (rpjday)bluetooth-apple
rpjday 3253 ...e. (rpjday)nm-applet
rpjday 3254 ...e. (rpjday)puplet
rpjday 3255 ...e. (rpjday)python
rpjday 3261 ...e. (rpjday)pam-panel-icon
rpjday 3262 ...e. (rpjday)gnome-power-man
rpjday 3267 ...e. (rpjday)/usr/bin/sealer
rpjday 3294 ...e. (rpjday)gnome-screensav
rpjday 3306 ...e. (rpjday)mapping-daemon
rpjday 3327 ...e. (rpjday)wnck-applet
rpjday 3329 ...e. (rpjday)trashapplet
rpjday 3347 ...e. (rpjday)gam_server
rpjday 3361 ...e. (rpjday)notification-ar
rpjday 3363 ...e. (rpjday)fast-user-switc
rpjday 3365 ...e. (rpjday)clock-applet
rpjday 3367 ...e. (rpjday)mixer_applet2
rpjday 3371 ...e. (rpjday)gnome-terminal
rpjday 3381 ....m (rpjday)bash
rpjday 3462 f...m (rpjday)firefox
rpjday 3482 f...m (rpjday)run-mozilla.sh
rpjday 3487 f..e. (rpjday)firefox-bin
rpjday 3524 ....m (rpjday)bash
rpjday 3905 f..e. (rpjday)npviewer.bin
rpjday 4062 ....m (rpjday)bash


now, according to the man page for fuser, anything open for write
will be identified with an "F", so the above should be good and, in
fact, the remount worked.

can i assume that, as long as nothing is open for write, the
read-only remount should work? is there any other reason that i would
be told that the device is busy. put another way, if i run the above
command and don't see an "F", should the remount always work?

rday


Add ro to the mount options in /etc/fstab and see what complains.

This is supposed to work, and if you're running 100 or more Linux guests
on a Zed box (folk run a lot more than this) it's highly likely you want
to do this.




--

Cheers
John

-- spambait
1aaaaaaa@coco.merseine.nu Z1aaaaaaa@coco.merseine.nu
-- Advice
http://webfoot.com/advice/email.top.php
http://www.catb.org/~esr/faqs/smart-questions.html
http://support.microsoft.com/kb/555375

You cannot reply off-list:-)

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-30-2007, 08:10 AM
"Robert P. J. Day"
 
Default mounting /usr readonly

On Sun, 30 Dec 2007, John Summerfield wrote:

> Robert P. J. Day wrote:

... snip ...

> > can i assume that, as long as nothing is open for write, the
> > read-only remount should work? is there any other reason that i
> > would be told that the device is busy. put another way, if i run
> > the above command and don't see an "F", should the remount always
> > work?

> Add ro to the mount options in /etc/fstab and see what complains.

but that wasn't the question. again, if i try to, in one operation,
remount a filesystem readonly with "mount -o remount,ro", is the only
possible reason that remount could fail is if something on that
filesystem is open for writing, which would show up in the output of
"fuser -muv"?

or is it possible that that remount could fail because of "device
busy" and i run that fuser command and i don't see anything marked
with "F", which means there's another reason for the remount failure,
and what might that be?

i guess i could just download and RTFS.

rday
--

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

Home page: http://crashcourse.ca
Fedora Cookbook: http://crashcourse.ca/wiki/index.php/Fedora_Cookbook
================================================== ======================

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-30-2007, 08:28 PM
John Summerfield
 
Default mounting /usr readonly

Robert P. J. Day wrote:

On Sun, 30 Dec 2007, John Summerfield wrote:


Robert P. J. Day wrote:


... snip ...


can i assume that, as long as nothing is open for write, the
read-only remount should work? is there any other reason that i
would be told that the device is busy. put another way, if i run
the above command and don't see an "F", should the remount always
work?



Add ro to the mount options in /etc/fstab and see what complains.

^^^^^^^^^^^^^^^^^


but that wasn't the question. again, if i try to, in one operation,
remount a filesystem readonly with "mount -o remount,ro", is the only
possible reason that remount could fail is if something on that
filesystem is open for writing, which would show up in the output of
"fuser -muv"?


I've previously found it beyond my ability to find (using lsof)
everything that's open on a filesystem (I seem to recall problems with
an nfs mount). In my case I suspected a kernel module.




or is it possible that that remount could fail because of "device
busy" and i run that fuser command and i don't see anything marked
with "F", which means there's another reason for the remount failure,
and what might that be?


About the only thing I'm sure about "device busy" messages is that it
does not mean the device is busy.






--

Cheers
John

-- spambait
1aaaaaaa@coco.merseine.nu Z1aaaaaaa@coco.merseine.nu
-- Advice
http://webfoot.com/advice/email.top.php
http://www.catb.org/~esr/faqs/smart-questions.html
http://support.microsoft.com/kb/555375

You cannot reply off-list:-)

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-30-2007, 09:40 PM
Robert Nichols
 
Default mounting /usr readonly

Robert P. J. Day wrote:

On Sun, 30 Dec 2007, John Summerfield wrote:


Robert P. J. Day wrote:


... snip ...


can i assume that, as long as nothing is open for write, the
read-only remount should work? is there any other reason that i
would be told that the device is busy. put another way, if i run
the above command and don't see an "F", should the remount always
work?



Add ro to the mount options in /etc/fstab and see what complains.


but that wasn't the question. again, if i try to, in one operation,
remount a filesystem readonly with "mount -o remount,ro", is the only
possible reason that remount could fail is if something on that
filesystem is open for writing, which would show up in the output of
"fuser -muv"?

or is it possible that that remount could fail because of "device
busy" and i run that fuser command and i don't see anything marked
with "F", which means there's another reason for the remount failure,
and what might that be?


One big issue with remounting /usr read-only is the presence of
unlinked files that are still held open by a process. Prelink
results in a lot of those because the original file is unlinked
and replaced by the newly prelinked version. If any running
process using the original file is still running, the inode and
related data blocks cannot be freed, and until that is done the
filesystem remains "busy." If you run "lsof /usr | grep -i del"
you will probably see a lot of such files. After a full prelink,
you will probably find it necessary to go down to single-user
mode, and most likely kill off one or two strays that didn't get
stopped.

--
Bob Nichols "NOSPAM" is really part of my email address.
Do NOT delete it.

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 

Thread Tools




All times are GMT. The time now is 05:57 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org