Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 12-09-2006, 07:30 AM   #1
Registered: Nov 2003
Location: Hong Kong
Posts: 35
Blog Entries: 1

Rep: Reputation: 15
Angry Guaranteed filesystem corruption on unclean shutdown?

In the recent year, I was been unable to cleanly shutdown the system 5 times. In 4 of the times, the filesystem is severely corrupted such that most, if not all, files (inodes technical) become unusable. The cases happened on different Linux distribution & different kernel versions

Case 1: Debian Unstable x86_64, 2.6.18 kernel (custom build)
The power was unplugged accidentally after the computer was idle for several hours.
Result: after running e2fsck and blindly answering 'y' on all questions, ALL files and directories are moved under /lost+found...
ls /lost+found was beautiful (with highlight based on file type)

Case 2: RHEL 4 x86, vmware, 2.6.9 (vendor build)
This was a high loading VM. Several minutes after telling it to do some memory intensive work (needs much swapping), I found that the VM was rebooting. I don't know why, but I guess it was caused by hangcheck timer.
Result: Ran e2fsck. After answering 'y' several times, I gave up. And then many files could not found (e.g., /sbin/shutdown, so that I need another unclean shutdown)

Case 3: Fedora Core 6 x86_64, 2.6.18 kernel (vendor build)
I was running 'badblocks' on a logical partition, and using 'pup' to update software. The system loading should be low. Suddenly the computer became unresponsive. All keys (including Alt-F?, CapLock, Ctrl+Alt+Del) have no effect. The harddisk light flashed for several hours (which must be much longer than the badblocks needed). Eventually, I pressed Reset
Result: ls some directories gives ext2 errors (forget to copy). ls some files gives IO errors. When running e2fsck, I noted that it says something like 'Root directory is not a directory. Fix?'

Case 4: Fresh reinstall of Fedora Core 6 x86_64, 2.6.18 kernel (vendor build)
Computer hangs after completing installation process. Presed Reset
Result: same as about

It seems ext3 (or e2fsck) is extremely intolerant about power failure. I know one is supposed to cleanly umount before reboot. But it is always possible that power fails or machine hangs. I am really tired of waiting the thing to install and collecting traces of important data all over my harddisks and CD-ROMs (Don't tell me to backup. The point of this post is filesystem corruption, not data loss.) I am now typing this on Windows

Have anyone had similar experience? What can I do if the computer hangs or someone know nothing about computer unplug the power cable?
Old 12-09-2006, 09:15 AM   #2
Senior Member
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy jessie stretch buster
Posts: 1,621

Rep: Reputation: 98

I am not sure if my experience is helpful.

I had similar situation when I had hardware failure. Disk drive was lousy. Chenged to new drive problem went away.

When case 2 or 3 happens, check syslog and dmesg.

Happy penguins!

Last edited by kaz2100; 12-09-2006 at 09:17 AM.
Old 12-09-2006, 11:19 AM   #3
LQ Newbie
Registered: Mar 2006
Posts: 26

Rep: Reputation: 15
I think ext3 is extremely tolerable.
My box hung many times because of my own stupidity and could only be recycled by power button on many occasions and I switched off UPS by mistake so power "failed" many times and never the filesystem was damaged...

I had a running domino server, samba, apache and other disk intensive programs.

But because I am not very experienced with Linux it is only IMHO.
Your problem could have to do with your hardwre setup. If it is the same machine.
Old 12-09-2006, 12:16 PM   #4
Registered: Nov 2003
Location: Hong Kong
Posts: 35
Blog Entries: 1

Original Poster
Rep: Reputation: 15
I thought about hardware problem. But Case 2 happens in a VM. It seems unlikely to be hardware related.

Cases 1, 3, 4 happen on the same machine. 3 and 4 on the same day...
Old 12-09-2006, 12:46 PM   #5
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,891

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
I live in a rural area where power interruptions are frequent (weather related). I use ext3, and I have never run e2fsck. On re-boot after power is restored, the ext3 journal is restored automatically.

Given the problems you describe, it's time to consider kernel-related problems, as in 'configuration'.

In /etc/sysconfig/kernel, there is this stanza:
# This variable contains the list of modules to be added to the initial
# ramdisk by calling the script "mk_initrd"
# (like drivers for scsi-controllers, for lvm or reiserfs)
INITRD_MODULES="amd74xx sata_nv sata_sil jbd ext3"
Check your file to see if INITRD_MODULES includes ext3. If it is there, then should check the kernel config file in /usr/src/linux to see what is/is not compiled relative filesystem journaling.
Old 12-09-2006, 03:20 PM   #6
LQ Veteran
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 85
The first question for the OP that I'd have is: What filesystem are you using? I'll assume ext2, and if so, I'd strongly suggest using a journaled filesystem such as ext3 or reiserfs.

Over the past couple of years, California has struggled with providing stable electricity, and unfortunately blackouts occur probably once or twice a year. Fortunately my machines have recovered (so far) without any problems or data loss under reiserfs. As a side note, making backups is always a good idea.

BTW, if you are using ext2 and want to convert it ext3, it's pretty easy to do
Old 12-10-2006, 02:46 AM   #7
Registered: Dec 2004
Location: Malta
Distribution: Debian Sid
Posts: 806

Rep: Reputation: 43
For what my experience is worth, ext3 shrugs aside such trivialities as power failures. On boot Debian just restores the filesystems and you'll miss this if you blink.

When I used ext2 I did have occasional glitches after power failures but, to be honest, nothing as bad as the OP describes.
Old 12-10-2006, 06:41 AM   #8
Registered: Nov 2003
Location: Hong Kong
Posts: 35
Blog Entries: 1

Original Poster
Rep: Reputation: 15
How stupid I didn't mentioned ext3...

Today I tried again... repeated everything in Case 4.

But e2fsck says filesystem is clean after pressing reset ... Using FC6 now


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
Unclean Shutdown: X Libraries Reported As Missing on Reboot weibullguy Linux - Newbie 11 06-30-2006 10:58 AM
unclean shutdown causes "Couldn't find matching filesystem: label=" error irnerdette Red Hat 3 06-02-2006 01:44 PM
Fedora Core 2 logout causes unclean shutdown Ethan Linux - General 0 10-12-2004 01:57 PM
httpd: Unclean shutdown of previous Apache run mfitzpat Linux - Software 1 04-14-2004 02:08 PM
Unclean shutdown from power failure... filesystem check errors macisaac Linux - General 4 12-26-2003 07:50 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:12 AM.

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