On Wed, 05 Apr 2006, Mike McCarty wrote:

> Brad Sawatzky wrote:
> >On Wed, 05 Apr 2006, Mike McCarty wrote:
> >
> >>Ali Milis wrote:
> >>
> >>>Johannes Wiedersich wrote:
> >>>
> >>>>The debian default of my sarge installations is that the ext3-FS are
> >>>>fsck'ed about every 30 mounts or 180 days (whatever comes first).
> >>>
> >>>This is just my  Euro 0.01 opinion:
> >>>
> >>>180 days is reasonable for new disks.
> >>>Perhaps you would like to lower it when your disk goes old.
> >
> >[ . . . ]
> >
> >>A related question is how to do it without taking the machine down
> >>uncleanly or fiddling an arcane file somewhere. I've thought about
> >>perhaps doing...
> >>
> >>$ mount -o remount -o ro /dev/hda5
> >>$ fsck /dev/hda5
> >>$ mount -o remount -o rw /dev/hda5
> >>
> >>(I have /dev/hda5 mounted as / on my machine.) Is there any
> >>exposure in this? I'm pretty leery of running fsck on a
> >>r/w file system.
> >
> >Running fsck on a r/w file system is a Bad Plan(TM).  (I don't think fsck
> >will even do it without a force flag.)
> 
> You don't seem to be responding to what I wrote. Did you intend to?
> My issue is whether remounting / as ro, doing the fsck, and the
> remounting rw looks reasonable. I don't need confirmation that
> a mounted rw file system should not be fsck'd.

I was just affirming your "pretty leery of running fsck on a r/w file
system" comment above -- unnecessary I guess.  In retrospect, the rest of
answer applied to a different post in the thread -- argh.

To answer your question, you can technically do what you want, but unless
feeling lucky you'll want to drop to single-user (runlevel 1) or you'll
leave your system in an indeterminate state -- even then I might anticipate
some processes spewing errors when they can no longer write to their
log-files after you remount read-only.  And if you're going to single-user
anyway you may as well just reboot...

If you're really stuck (ie. remote access to your box and you suspect fs
damage), get as close to single-user as you can (shutdown what you can
without hosing your connection), remount ro and give it a shot.  (Having
/var and /home on separate partitions would help minimize problems.) 
Not recommended though.

FYI, if you simply want to force a fsck on the next boot (ignoring the
various filesystem flags), just run 'touch /forcefsck' anytime before you
shutdown.  (Apologies if this was mentioned in an earlier post, I missed
the start of the thread.)

-- Brad


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to