LinuxQuestions.org
Register a domain and help support LQ
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 06-14-2010, 04:14 PM   #1
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Rep: Reputation: 46
When to e2fsck a drive?


Other than when there are errors in the messages log or when you have file system problems, when should you e2fsck volumes? I have a lot of volumes that have 500GB to 1TB of data on them, and it takes quite a while to e2fsck them, so wondering if its something that should be done regularly, or only when there are actually problems.
 
Old 06-14-2010, 04:17 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 164Reputation: 164
I would suggest migrating to a journaling file system once you get above about 250g (even 250g is a long fsck.) That being said, if you see an error it's a good idea and anytime you get a unexpected reboot it's likely to be forced and also anytime it goes longer than a set period of time it will force a fsck on reboot to ensure consistency... really though, journaled is good and non-journaled is becoming increasingly less feasible as file system sizes increase.
 
Old 06-14-2010, 04:19 PM   #3
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
All my largers volumes are ext3 so they have the journal. A lot of my systems have the automated checks after a certain date and after a certain number of mount counts disabled. So I'm really not sure if i should re-enable that stuff or what.
 
Old 06-14-2010, 04:21 PM   #4
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,200

Rep: Reputation: 397Reputation: 397Reputation: 397Reputation: 397
i would say regularly, perhaps either weekly or monthly and set it up perhaps on a cron job to be done when you are going to be away from the computer
of course if memory serves a properly configured fstab will force an fsck after so many mounts (or is that just a function of the FS?) either way on ounce of prevention is often worth at least a pound of cure hence the recommendation that fsck be a regular thing, how often should be based on how much time you can spare vs how much you can afford to lose the data ON the drives

also backup backup backup, at least the stuff you can absolutely not afford to do without, obviously terebyes of data woudnt necessarily be practical to completely back up all the time. again an ounce of prevention is worth a pound of cure.
 
Old 06-14-2010, 04:25 PM   #5
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
Thanks frieza. That's kinda my problem, as the servers are used 7 days a week, so my downtime windows are small, especially if a check runs on that much data. but sounds like its something I should do regularly though. I just wasn't sure if there were no actual errors in the messages file if it was just a waste of time or not.
 
Old 06-14-2010, 04:29 PM   #6
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,542
Blog Entries: 23

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
Hi,

Quote:
Originally Posted by rjo98 View Post
Other than when there are errors in the messages log or when you have file system problems, when should you e2fsck volumes? I have a lot of volumes that have 500GB to 1TB of data on them, and it takes quite a while to e2fsck them, so wondering if its something that should be done regularly, or only when there are actually problems.
The usage and filesystem type may be one indicator. If you reboot a lot then the 'tune2fs' would be what you should look into for ext3/4;

Quote:
excerpt from 'man tune2fs';
NAME

tune2fs - adjust tunable filesystem parameters on ext2/ext3 filesystems SYNOPSIS

tune2fs [ -l ] [ -c max-mount-counts ] [ -e errors-behavior ] [ -f ] [ -i interval-between-checks ] [ -j ] [ -J journal-options ] [ -m reserved-blocks-percentage ] [ -o [^]mount-options[,...] ] [ -r reserved-blocks-count ] [ -s sparse-super-flag ] [ -u user ] [ -g group ] [ -C mount-count ] [ -L volume-name ] [ -M last-mounted-directory ] [ -O [^]feature[,...] ] [ -T time-last-checked ] [ -U UUID ] device DESCRIPTION

tune2fs allows the system administrator to adjust various tunable filesystem parameters on Linux ext2/ext3 filesystems.
Look at the 'man tune2fs' for available options. Plus I would perform maintenance on low usage periods for any form of maintenance. If you do use the 'e2fsck' then it should be performed while in single user mode. Either boot into single or use a LiveCD or installer CD to boot the machine then do the maintenance, this will prevent potential problems during the maintenance.


Just a few more links to aid you;

Linux Documentation Project
Rute Tutorial & Exposition
Linux Command Guide
Utimate Linux Newbie Guide
LinuxSelfHelp
Getting Started with Linux
Bash Reference Manual
Advanced Bash-Scripting Guide
Linux Home Networking
Virtualiation- Top 10


The above links and others can be found at 'Slackware-Links'. More than just SlackwareŽ links!
 
Old 06-14-2010, 04:31 PM   #7
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,200

Rep: Reputation: 397Reputation: 397Reputation: 397Reputation: 397
Quote:
Originally Posted by rjo98 View Post
Thanks frieza. That's kinda my problem, as the servers are used 7 days a week, so my downtime windows are small, especially if a check runs on that much data. but sounds like its something I should do regularly though. I just wasn't sure if there were no actual errors in the messages file if it was just a waste of time or not.

yep, even big servers like the World of warcraft game servers undergo scheduled downtime for such maintenance, that would be my recommendation, create a check-list of routine maintenance tasks that require downtime (file system checks, database maintenance, system updates/patches, etc..) then schedule the downtime based on a worst case scenario of how long it would take to perform said tasks (baring something going horribly wrong) and make sure that the user base of your server is aware of this downtime.

my company manages a web server that is in constant use and even we have to occasionally schedule downtime to perform system updates/patches etc..

Last edited by frieza; 06-14-2010 at 04:34 PM.
 
Old 06-14-2010, 04:32 PM   #8
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,542
Blog Entries: 23

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
Hi,

Quote:
Originally Posted by rjo98 View Post
Thanks frieza. That's kinda my problem, as the servers are used 7 days a week, so my downtime windows are small, especially if a check runs on that much data. but sounds like its something I should do regularly though. I just wasn't sure if there were no actual errors in the messages file if it was just a waste of time or not.
Definitely perform the maintenance off peak and in single user mode for a Server. Maintenance schedules will help you to prevent potential traps.
 
Old 06-14-2010, 04:33 PM   #9
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
Really all these servers are are samba shares for the most part, no db's or anything like that. wish there was a way to get an idea of how long the e2fsck would actually take on the drives, then at least i'd know how long to schedule the downtime for, rather than a wait and see for the first time i go to run it.
 
Old 06-14-2010, 04:35 PM   #10
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
Thanks everybody.
 
Old 05-19-2011, 06:18 AM   #11
kwutchak
LQ Newbie
 
Registered: Jul 2009
Location: Singapore
Distribution: Gentoo, Kubuntu
Posts: 4

Rep: Reputation: 0
Question Cron online fsck

Is there any well known linux app to manage "online" fsck of disks?

I restarted one of my servers today, which has several Tb ext3 partitions. Many of these had come up to their "check forced" limit, so the server took a long time to come up.

It occurred to me that I could offline these partitions regularly and fsck them (I'm thinking cron job) so that the outage only affects one file system at a time at the most advantageous time and doesn't disable the entire server at the worst possible time.

I could write a cron script to achieve this, but is there already a package out there that does something like this?
 
Old 05-23-2011, 12:23 PM   #12
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
no software out there to do it that i know of or anyone's every told me about, you'd just have to write a script and cron it just as if you were doing it manually. i think you just do a umount for the volume, your e2fsck with whatever options, then a mount for the volume again. you cant check a mounted volume.
 
Old 02-12-2012, 04:14 PM   #13
hokie1999
LQ Newbie
 
Registered: Feb 2011
Posts: 20

Rep: Reputation: 0
Follow up on fsck

I am considering setting my servers - running Oracle Enterprise Linux 6 on HP blades, ext 3 filesystems - without a fsck every X reboots. That is, setting tune2fs -c 0 /dev/mapper/VGxxxlvyyyy. The servers run Web, application, and database platforms. The servers are less than a year old; about 30 total. What are your thoughts on this? Thanks.

Last edited by hokie1999; 02-12-2012 at 04:15 PM.
 
Old 02-12-2012, 05:37 PM   #14
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
Nothing wrong with doing that, you can always boot them into single user mode and check the filesystems during a maintenance window. What I usually do is leave it turned on for everything except my larger data volumes, as the other ones don't take long at all during a reboot. But it all depends on environment and uptime concerns.
 
Old 02-12-2012, 06:22 PM   #15
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Just remember that for the root partition ('/'), that requires a reboot for fsck.
You can justify that by doing it whenever you do a kernel update, which also requires a reboot.
 
1 members found this post helpful.
  


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
Help with FS check with e2fsck itsakc Linux - Newbie 2 04-20-2010 06:17 AM
e2fsck, during boot, trying to check incorrect drive using LABEL hmccurdy Slackware 4 08-18-2007 04:18 PM
Does e2fsck indicate which blocks are bad on your hard drive??? CANTOR Linux - Software 8 06-19-2005 04:05 AM
e2fsck Eugney Slackware 2 06-03-2005 12:13 PM
e2fsck is dumb Half_Elf Linux - Software 6 06-13-2003 12:51 PM


All times are GMT -5. The time now is 09:08 AM.

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