Net Llama wrote:
>
> --- Collins Richey <[EMAIL PROTECTED]> wrote:
> > On Sun, 8 Jul 2001 10:12:50 -0700 (PDT) Net Llama <[EMAIL PROTECTED]>
> > wrote:
> > > --- Joel Hammer <[EMAIL PROTECTED]> wrote:
> > > > I would like to run fsck on my root directory without having to
> > > > reboot.
> > > > Could someone tell me if this is possible and if so, how do do it?
> > >
> > > Sure its possible. (re)Booting has really no relationship to
> > running
> > > fsck. Remount / as readonly:
> > > mount -o ro,remount /
> > >
> > > THen run the fsck as normal. When done, remount / as read-write:
> > > mount -o rw,remount /
> > >
> > > ANd you're done.
> > >
> >
> > Just out of curiosity (I'm on reiserfs, and this is past history), but
> > don't you need to backout to single user mode first? Otherwise
> > running daemons that want to wirte to /va/log /tmp etc. may complain?
>
> Sure you could do it but its not required. But since he didn't want to
> reboot, I failed to see the point in changing runlevels, as its
> virtually the same thing, only takes less time.
>
Be careful, you're playing with fire here.
The filesystem you want to check must be unmounted or mounted read-only.
In most runlevels besides state 1, daemons that want to write and flush
the cache to disk, etc., (not to mention users) are or can be active.
fsck is not an ordinary program. It does _direct_ writes to the disk.
If the disk is mounted rw, then after fsck performs an unbuffered disk
write, kflushd could come behind and write the buffers to disk --
BBOOOOOMMMMMMM! file system corruption.
If you _know_ what you're doing (which programs will be writing where)
and you are sure the root partition does not contain any of the files to
be written to, and you umount the root partition, etc., etc., then you
can do as the llama says. But the very nature of your question suggests
to me you aren't sure. When it comes to filesystems, I suggest you err
on the side of caution rather than throw caution to the wind. As Dirty
Harry was known to ask: Do you feel lucky today?
Ciao,
David A. Bandel
--
Focus on the dream, not the competition.
-- Nemesis Racing Team motto
_______________________________________________
http://linux.nf -- [EMAIL PROTECTED]
Archives, Subscribe, Unsubscribe, Digest, Etc
->http://linux.nf/mailman/listinfo/linux-users