LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 12-09-2006, 07:30 AM   #1
pigsa
Member
 
Registered: Nov 2003
Location: Hong Kong
Posts: 31
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
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy jessie
Posts: 1,436

Rep: Reputation: 83
Hi

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
yuri_d
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
pigsa
Member
 
Registered: Nov 2003
Location: Hong Kong
Posts: 31
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
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,772

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
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:
Quote:
# 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
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Milwaukee, WI
Distribution: Mint
Posts: 6,642

Rep: Reputation: 69
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
davcefai
Member
 
Registered: Dec 2004
Location: Malta
Distribution: Debian Sid
Posts: 764

Rep: Reputation: 32
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
pigsa
Member
 
Registered: Nov 2003
Location: Hong Kong
Posts: 31
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
 
  


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
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


All times are GMT -5. The time now is 05:15 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration