LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-19-2012, 02:39 AM   #1
amartlk
Member
 
Registered: Sep 2010
Location: Nagpur India
Posts: 347

Rep: Reputation: 1
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
 
Old 01-19-2012, 03:19 AM   #2
amilo
Member
 
Registered: Oct 2011
Location: Nederland
Distribution: Debian, Centos, Ubuntu
Posts: 78

Rep: Reputation: Disabled
With "tune2fs -c # device" you can adjust the mount counter.

Read man tune2fs.
 
1 members found this post helpful.
Old 01-19-2012, 05:29 AM   #3
amartlk
Member
 
Registered: Sep 2010
Location: Nagpur India
Posts: 347

Original Poster
Rep: Reputation: 1
Hi

I want to run fsck on boot in my server centos
 
Old 01-19-2012, 05:45 AM   #4
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Rep: Reputation: Disabled
You got the answer.
 
Old 01-19-2012, 06:24 AM   #5
amilo
Member
 
Registered: Oct 2011
Location: Nederland
Distribution: Debian, Centos, Ubuntu
Posts: 78

Rep: Reputation: Disabled
Give a -F parameter with the shutdown command.

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

for reading

Last edited by amilo; 01-19-2012 at 06:27 AM.
 
1 members found this post helpful.
Old 01-19-2012, 08:04 AM   #6
siranjeevi
Member
 
Registered: May 2010
Location: India
Posts: 79

Rep: Reputation: 7
Hello,


You need to edit them in /etc/fstab file. What does your fstab file say.?..
 
Old 01-19-2012, 08:42 AM   #7
kishore_ari
LQ Newbie
 
Registered: Apr 2011
Posts: 12

Rep: Reputation: 5
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.
 
Old 01-21-2012, 12:23 AM   #8
amartlk
Member
 
Registered: Sep 2010
Location: Nagpur India
Posts: 347

Original Poster
Rep: Reputation: 1
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
 
Old 01-21-2012, 08:10 AM   #9
jv2112
Member
 
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Rep: Reputation: 103Reputation: 103
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.


Code:
tune2fs -c 1 /dev/sdX

or 

tune2fs -i 1d /dev/sdx



vim /etc/fstab

---- Change as directed above

Last edited by jv2112; 01-21-2012 at 08:11 AM. Reason: typo
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
After fsck Can't boot cychowhk Linux - Server 4 10-03-2011 06:45 AM
use fsck = no boot seede Fedora 4 10-19-2005 10:34 PM
automatic fsck on boot. fsck errors. nixel Slackware 1 05-17-2004 08:51 AM
fsck on boot pjviitas Linux - General 2 02-21-2004 08:15 PM
fsck on boot pjviitas Linux - Software 1 02-21-2004 05:05 PM


All times are GMT -5. The time now is 03:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration