fscking problem

Red Squirrel

No Lifer
May 24, 2003
70,253
13,621
126
www.anyf.ca
I had to reboot my server to test a shutdown/startup script, well to my suprise, my file system is corrupted, or near that state. I had a nightmare with that in the past so now I'm pretty much trembling, especially because the holidays are near and I really don't want to have to be reinstalling a linux server, which is a long and tedious process.

Anyway, what happends is it starts doing a fsck, stays stuck at like 0.2, then slowly goes up then says something like "unexpected inconsistency" then spits out a bunch of stuff (this is at startup, so no way of copy and pasting it) then says to run fsck manually and press ctrl+D

Well if I try to run fsck manually, it says that it will damage my file system if it's mounted. :eek:

So what do I do? I don't want to have to go to the server room every time I reboot.
 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
reboot with a live CD and run the check

you do any strange partition stuff lately (ala Partition Magic?)
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
If your filesystem got corrupted just by a normal reboot, you've got some hardware problems you should look into fixing.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
When I first scanned the headling, I didn't see "fsking". Had to look again. Might be the scotch.
 

Red Squirrel

No Lifer
May 24, 2003
70,253
13,621
126
www.anyf.ca
lol well it applied both ways. ;)

Not sure what caused the corruption. Perhaps one of the power outages (we had a couple in a row) had it shut down bad or something, though that would destroy all the data (had it happen before) which was not the case here (though I figured when I saw that screen, that I was doomed). Only thing I've fully tested the UPS and it does trip fast enough every time so I doubt it was power related.

Never thought of using a live CD though, I'll have to try that out next time. Might go do a forced one anyway to be safe. Probably something I should do regularly.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
If you don't have a live cd handy, try booting into single user mode.

If this is an x86 box, run memtest. This stuff shouldn't be happening these days, especially with the journalling FSes Linux has (oh how I wish they would be released under a different license :().
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Perhaps one of the power outages (we had a couple in a row) had it shut down bad or something, though that would destroy all the data (had it happen before) which was not the case here (though I figured when I saw that screen, that I was doomed). Only thing I've fully tested the UPS and it does trip fast enough every time so I doubt it was power related.

Dirty power can cause components to die, but if it was the power killing the drive you would see symptoms all of the time, not just when the system wasn't shut down properly.

Might go do a forced one anyway to be safe. Probably something I should do regularly.

No, you shouldn't do that regularly because there's no reason. The journaling keeps the filesystem in a consistent state, the data is another matter though. But unless you're running some off the wall filesystem patches, it's not the filesystem's fault and running fsck all of the time will just waste time.