LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   fsck on boot (https://www.linuxquestions.org/questions/linux-newbie-8/fsck-on-boot-924551/)

amartlk 01-19-2012 01:39 AM

fsck on boot
 
Hi

I want to run fsck on centos 5.6 on every boot.
means when server reboot it should run fsck


AMAr

amilo 01-19-2012 02:19 AM

With "tune2fs -c # device" you can adjust the mount counter.

Read man tune2fs.

amartlk 01-19-2012 04:29 AM

Hi

I want to run fsck on boot in my server centos

Mr. Alex 01-19-2012 04:45 AM

You got the answer.

amilo 01-19-2012 05:24 AM

Give a -F parameter with the shutdown command.

http://www.cyberciti.biz/faq/linux-f...boot-sequence/

for reading

siranjeevi 01-19-2012 07:04 AM

Hello,


You need to edit them in /etc/fstab file. What does your fstab file say.?..

kishore_ari 01-19-2012 07:42 AM

amartlk,

man fstab would have been your friend in this case.

The sixth field (fs_passno).
This field is used by the fsck(8) program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked.

you can change the sixth field of /etc/fstab to force the fsck.

amartlk 01-20-2012 11:23 PM

Hi

Thanks for reply i created forcefsck file , it also checked filesystem on next boot.
but i want on every boot it will run fsck on file system can it is possible

jv2112 01-21-2012 07:10 AM

Read the man page for tune2fs & review the suggestions contained in this post and you will be close to what you want. You can force it by count of mounts staring at 1 or by days starting at 1. In order to take advantage of this you need to have the drive coded for checks in the /etc/fstab file.

If you don't understand please be specific as to what you don't understand. Re asking the same question will not help others help you. :twocents:


Code:


tune2fs -c 1 /dev/sdX

or

tune2fs -i 1d /dev/sdx



vim /etc/fstab

---- Change as directed above



All times are GMT -5. The time now is 06:23 PM.