e2fsck

e2fsck

Post by Tony » Fri, 15 Jan 1999 04:00:00



Is there a way to force Linux to do an e2fsck on a partition when it is
rebooted.
At times I have to reboot a system via telnet from a remote location.
Normally I have to reboot because of a problem with the system and at times
it is only resolved if someone or myself runs e2fsck.
I would like to be able to reboot the PC and have it run e2fsck without me
having to go to where the PC is and manually do an e2fsck.
I guess I could put this in one of the files loaded at boot time, but can I
make it do the check and fix any errors it finds without having to wait for
a key input to answer yes to a question?
Thanks
Tony
 
 
 

e2fsck

Post by Cameron Spitze » Sat, 16 Jan 1999 04:00:00




>Is there a way to force Linux to do an e2fsck on a partition when it is
>rebooted.
>I would like to be able to reboot the PC and have it run e2fsck without me
>having to go to where the PC is and manually do an e2fsck.
>I guess I could put this in one of the files loaded at boot time, but can I
>make it do the check and fix any errors it finds without having to wait for
>a key input to answer yes to a question?

man e2fsck
e2fsck -c -f -p -y /dev/hda6

In Debian there is a file /etc/init.d/checkroot.sh which runs at boot time.
If you run Debian, you could put your e2fsck command right after
    echo "Checking root file system..."
    fsck $force $fix /
(but you'd have to create a file /forcefsck) or right before the
mount -n -o remount,rw /

On another distribution you'll find those same operations in some other script.

Cameron

 
 
 

e2fsck

Post by Juergen Hein » Sat, 16 Jan 1999 04:00:00



>Is there a way to force Linux to do an e2fsck on a partition when it is
>rebooted.

Yes, either run e2fsck with -f or, if shutdown is called with -F, the
file /forcefsck will be created and you can evaluate it in your
boot script. Here it depends and my bcheckrc looks like this ...

[blablabla]
if [ -f /forcefsck ]
then
   FSFORCEFSCK=-f
fi
[blablabla]
         /sbin/e2fsck $FSFORCEFSCK -p $FSDEV; FSSTATUS=$(( FSSTATUS | $? ))
[blablabla]

... you get the idea. How to do it finally depends, so I cannot just
send you my bcheckrc in the hope it works.

Cheers,
Juergen

--
\ Real name     : Jrgen Heinzl                 \       no flames      /

  \ Phone Private : +44 181-332 0750              \                  /

 
 
 

1. Using e2fsck & Superblocks

How to figure out where the superblocks are? I had a disk crash (related
to external environment - heat - got that fixed now), and the fs (ext2)
has a few errors in it, but am unable to completely clean up the boot
process now.  I have used fsck, and it seems to fix things, but then on
the next boot the fs check tells me there are still some inconsistencies.
The system seems to work fine.

QUESTION: Trying to use e2fsck, with the "-b 8193" option (try another
superblock) - I cannot find the right block number against 'b' for it to
work.  Is there a utility that will >>>>>list the superblocks, <<<<<    as
they were read out on the screen when I initially installed Linux?  Then I
would be able to try e2fsck and hopefully finaly clean up my filesystem.  I am
using 1.1.61 without any problems.

Thanks - Rick

2. Real-time futexes (priority inheritance/protection /robust support) take 4

3. Looking for defrag for ext2fs and Question about e2fsck

4. Issues with Virtual Hosting on Apache

5. e2fsck: root inode isn't a directory???

6. Token-Ring driver (transmitter access conflict)

7. e2fsck problem....

8. hub.freebsd.org: SMTP access denied !!! Why ? !!!!

9. e2fsck gives "bad magic number..."! Help!

10. who calls e2fsck?

11. RAM disks and e2fsck

12. e2fsck

13. Questions about e2fsck