LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 04-05-2010, 10:45 AM   #1
[GOD]Anck
Member
 
Registered: Dec 2003
Location: The Netherlands
Distribution: Slackware
Posts: 171

Rep: Reputation: 33
prevent file system corruption on hard lock-up


I've recently had my file system irrecoverably corrupted after a hard lock-up. This has happened to me before, a couple weeks ago, and both times I've had to reinstall. I don't know what is causing the lock-ups (possibly the binary nvidia driver..), but I would like my file system to be intact or at least recoverable next time it happens.

What is the "safest" way to mount things?

I'll be using ext3 with data=journal, but I've read that disk write caching combined with a kernel crash or power loss can still screw things up. Supposedly, mounting with barrier=1 helps some, but doesn't work with LVM? Would it be wise to turn off disk write caching completely? I understand there's a performance penalty, but if it helps keep the file system consistent in case of disaster..

Are there any other tricks or options to help alleviate file system corruption after an unclean reboot?

Running updated slackware 12.2 w/ 2.6.27.31 kernel..

Last edited by [GOD]Anck; 04-05-2010 at 10:46 AM.
 
Old 04-05-2010, 11:35 AM   #2
rg3
Member
 
Registered: Jul 2007
Distribution: Slackware Linux
Posts: 504

Rep: Reputation: Disabled
Regarding disk caching, you should not turn it off. The performance and lifetime penalty on your hard drive is huge. Which file system were you using that it got corrupted without possibilities to recover?
 
Old 04-05-2010, 11:36 AM   #3
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 227Reputation: 227Reputation: 227
Have you tied the "Raising Elephants Is So Utterly Boring" keys? This should shut your system down in a controlled manner when it's locked up.
Press Alt + SysRq (Print Screen) and in order hit the "REISUB" keys - hence the odd mnemonic phrase.
 
Old 04-05-2010, 12:14 PM   #4
[GOD]Anck
Member
 
Registered: Dec 2003
Location: The Netherlands
Distribution: Slackware
Posts: 171

Original Poster
Rep: Reputation: 33
The first time, I was using reiserfs, and the second time it was ext3 (in ordered mode).. fsck wouldn't even run, unable to load shared library x. I booted a live CD, ran fsck, rebooted and then init complained about missing libraries as well, possibly due to fsck moving things to l+f?

When it froze up, I did try the SysRq save, but it didn't help. The screen was blank and wouldn't come on, I couldn't ssh in, so I don't really know if the machine was even responding to key presses at all.
 
Old 04-05-2010, 12:44 PM   #5
LuckyCyborg
Member
 
Registered: Mar 2010
Posts: 124

Rep: Reputation: 19
Use EXT4FS, Luke! And stay in a super-duper-zero-day-updated slackware-current.

12.2 have the age of my granny...
 
0 members found this post helpful.
Old 04-06-2010, 02:22 PM   #6
[GOD]Anck
Member
 
Registered: Dec 2003
Location: The Netherlands
Distribution: Slackware
Posts: 171

Original Poster
Rep: Reputation: 33
Well, I didn't want to run -current because it changes rapidly and things may break, but I also didn't want to run 13.0 because I use KDE and the version in 13.0 is.. well.. let's not go there.

Anyway, I've been reading a bit (actually, a lot) and I think I'm just going to upgrade the kernel on my 12.2 installation to 2.6.33+; from that version onwards, dm has full barrier support so I should be able to use LVM, mount my filesystems with data=journal,barrier=1 and still leave disk write caching on.
 
Old 04-07-2010, 02:28 AM   #7
LuckyCyborg
Member
 
Registered: Mar 2010
Posts: 124

Rep: Reputation: 19
Quote:
Originally Posted by [GOD]Anck View Post
Well, I didn't want to run -current because it changes rapidly and things may break, but I also didn't want to run 13.0 because I use KDE and the version in 13.0 is.. well.. let's not go there.
I known what your heart want... How about:

http://slackware.cs.utah.edu/pub/sla...for-slack13.0/

Quote:
Originally Posted by [GOD]Anck View Post
Anyway, I've been reading a bit (actually, a lot) and I think I'm just going to upgrade the kernel on my 12.2 installation to 2.6.33+; from that version onwards, dm has full barrier support so I should be able to use LVM, mount my filesystems with data=journal,barrier=1 and still leave disk write caching on.
You should update also the filesystems and kernel utilities too...
 
Old 04-07-2010, 04:14 AM   #8
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
I've never had the filesystem become "irrecoverably corrupted" after a hard lock-up. It has always been fixed by an fsck, at least with JFS, and for as long as I've been using it.
 
Old 04-07-2010, 12:13 PM   #9
[GOD]Anck
Member
 
Registered: Dec 2003
Location: The Netherlands
Distribution: Slackware
Posts: 171

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by LuckyCyborg View Post
You should update also the filesystems and kernel utilities too...
What, exactly, would I need to update besides the kernel? The filesystems already know about barriers, so does mount.. As far as I can tell, the only piece missing is the ability for device-mapper to pass on the barriers to underlying devices (syslog agrees), and that was added in 2.6.33.. Or am I forgetting something?
 
Old 04-07-2010, 05:31 PM   #10
[GOD]Anck
Member
 
Registered: Dec 2003
Location: The Netherlands
Distribution: Slackware
Posts: 171

Original Poster
Rep: Reputation: 33
I just tried it and it seems to be working. All I did was compile and install a 2.6.33.2 kernel, enable flush barriers in fstab, and reboot. Well, and I switched back to reiserfs, but this should work equally well with ext3. My log now shows:

Code:
Apr  8 00:09:46 quad kernel: reiserfs: enabling write barrier flush mode
Apr  8 00:09:46 quad kernel: reiserfs: using flush barriers
whereas before the upgrade it showed:

Code:
Apr  7 23:19:39 quad kernel: reiserfs: disabling flush barriers on dm-3
I'll mark this resolved, even though it's kind of hard to test without yanking the power cord.

Last edited by [GOD]Anck; 04-07-2010 at 05:36 PM.
 
  


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
[SOLVED] External USB hard drive - file corruption taylorkh Linux - Hardware 4 05-06-2009 12:15 PM
File system corruption nitinbaldi Linux - Kernel 1 02-20-2007 07:32 PM
File System Corruption - Causes and Consequences? Ingla Linux - General 3 10-10-2006 11:59 AM
possible file system corruption beosmr.x Mandriva 23 06-08-2006 11:48 PM
Best file system for corruption protection? Wyk3d Mandriva 3 12-24-2004 06:17 PM


All times are GMT -5. The time now is 07:16 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