Operating System - Linux
1752577 Members
4316 Online
108788 Solutions
New Discussion юеВ

Re: howto force fsck on linux server

 
SOLVED
Go to solution
'chris'
Super Advisor

howto force fsck on linux server

hi

how to force fsck on SUSE 8.2 linux server setuped with Ext3 at next reboot ?

I've tried with:

# tune2fs -C 0
tune2fs 1.28 (31-Aug-2002)
Usage: tune2fs [-c max-mounts-count] [-e errors-behavior] [-g group]
[-i interval[d|m|w]] [-j] [-J journal-options]
[-l] [-s sparse-flag] [-m reserved-blocks-percent]
[-r reserved-blocks-count] [-u user] [-C mount-count]
[-L volume-label] [-M last-mounted-dir]
[-O [^]feature[,...]] [-T last-check-time] [-U UUID] device

but it doesn't work.
5 REPLIES 5
'chris'
Super Advisor

Re: howto force fsck on linux server

I think

# tune2fs -c 5 -C 0 /dev/hda3

should be correct.

But can I use this above mentioned command,
if the /dev/hda3 partition is already mounted read & write ?
Steven E. Protter
Exalted Contributor
Solution

Re: howto force fsck on linux server

if you reboot most distributions at the console:

There is a prompt to press a key in 5 seconds to force fsck. Or filesystem integrity check.

That works.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ross Minkov
Esteemed Contributor

Re: howto force fsck on linux server

Chris,

When you use the shutdown command there is a special flag that you can use -F.

The -F flag means `force fsck'. This only creates an advisory file /forcefsck which can be tested by the system when it comes up again. The boot rc file can test if this file is present, and decide to run fsck(1) with a special `force' flag so that even properly unmounted filesystems get checked. After that, the boot process should remove /forcefsck.

You can create the /forcefsck manually if you want.

HTH,
Ross
'chris'
Super Advisor

Re: howto force fsck on linux server

thanks,

# shutdown -F -r now

works perfectly.

greetings
chris
palaniappan.sp
Regular Advisor

Re: howto force fsck on linux server

Hi,
If u want to start fsck at next booting...
u can try this also..
from root or if ur r in single user mode.

#touch /force/fsck
#reboot -r now
Then next time ur system will be running fsck before mounting the filesystem.

Regds
palani.
Everything is Possible and Anything is Feasible if u try