Operating System - Linux
1828307 Members
3289 Online
109975 Solutions
New Discussion

forcing fsck on reboot ...

 
K.C. Chan
Trusted Contributor

forcing fsck on reboot ...

All,
I can force ext3 to fsck on next reboot. But is there a way where you tell it to also mark bad block on a partition? Thanks. I was thinking if there's a way to hack the startup script like rc.sysinit to do the fsck with bad block checking on? Thanks.
Reputation of a thousand years can be determined by the conduct of an hour
2 REPLIES 2
Vitaly Karasik_1
Honored Contributor

Re: forcing fsck on reboot ...

AFAIK,

e2fsck -c

is what you need - just put it in your sysinit

Vitaly
Sergejs Svitnevs
Honored Contributor

Re: forcing fsck on reboot ...

With e2fsck versions 1.26 or laterthis can be done using the command:

e2fsck -cc

if cc option is specified then the bad block scan will be done using a non-destructive read-write test.

With older versions of e2fsprogs, you'll need to run "badblocks -n" manually.

Regards,
Sergejs