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.
|
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.
|
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.
|
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. |
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.
|
Hi,
Quote:
Quote:
:hattip: 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 :hattip: The above links and others can be found at 'Slackware-Links'. More than just SlackwareŽ links! |
Quote:
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.. |
Hi,
Quote:
:hattip: |
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.
|
Thanks everybody.
|
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? |
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.
|
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.
|
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.
|
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. :) |
Good call Chris! You're the best!
|
Well, as others have mentioned, a server should have scheduled downtimes for maintenance anyway, so the trick is to do all the things that require a reboot at the same time...
HOWEVER, do make sure you have a FULL backup first and have everything documented about what you are gong to do and also your backout/recovery plan. Also need a test system (just a basic one) to test recovery procedures & backups ie restores. A backup doesn't always do what you think(!) |
One more question
Hello, can someone answer this for me: If I set the fs_passno (6th field) in fstab to zero, would the command
/sbintune2fs -c 0 /dev/mapper/VGxyzLVabc do the same thing; that is, disable fsck? Perhaps the tune2fs disables all fsck-ing; the line-by-line changes on /etc/fstab to fs_passno only disable that line? Thanks for your input! |
Restate the question
chrism01, good point about the reboot needed for a / fsck
Let me re-state the question of fsck. My customer (20+ years in unix) made this statement: "If you have a true journaled filesystem, you don't need fsck." The meaning of the word "true" is open to debate, however, he makes a good point. The journal should tell the story. What does everyone think? |
Great in theory, until you get an ext3 error due to journal file corruption
|
All times are GMT -5. The time now is 11:46 AM. |