File System Errors After Power Outage

1 view
Skip to first unread message

arch3angel

unread,
Sep 22, 2008, 6:38:06 PM9/22/08
to Akron Linux Users Group
Hello Everyone,

We had that power outage not long ago and when my Debain server came
back online (I plugged it in and started it up) it went through the
checking of the hard drives and said there was issues with it. It ran
fsck and told me the /dev/sda9 partition and /dev/sda5 were
corrupted. These partitions are my /home and /usr, the question comes
with how do I fix thie issue so the system will boot normally again?

Now after it runs the check it states I can put in the password for
root and be dropped into a maintenance shell or press Control-D and
boot normal. I do the booting normal and everything appears to be
find except MySQL fails to start.

Is it possible to repair this with fsck and if so what is the full
command to do so?

here is a link to my dmesg log file:

http://pastebin.com/f7215a1cb

Thanks for all the help!

Jim Ramsey

unread,
Sep 22, 2008, 10:03:41 PM9/22/08
to Akro...@googlegroups.com
Hmmm.

Let's assume for the moment that you are not in a hurry.

Reboot your machine and enter the root password to
get to the maintenance shell.

Run fsck against the /usr partition ( /dev/sda5 ?).
Respond n (for NO) to all questions and try to get
as sense of how much damage you have. In most cases,
you could just go ahead and respond y (for YES) to
everything, but I'm being carefull.

If you don't appear to have lost entire major directories,
repeat the fsck and respond y. You can even use fsck -y /dev/sdaN
I believe.

If fsck really doesn't want to work right this way, get a
live CD distribution like Knoppix and boot it and use fsck
from it to fix your file systems. You can even Knoppix to
backup whatever you can.

Repeat the procedure with /home ( /dev/sda9 ?).

Regards,

Jim Ramsey

> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups "Akron Linux Users Group" group.
> To post to this group, send email to Akro...@googlegroups.com
> To unsubscribe from this group, send email to AkronLUG+u...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/AkronLUG?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
>


signature.asc

Scott McCarty

unread,
Sep 23, 2008, 9:29:31 AM9/23/08
to Akro...@googlegroups.com
I assume you do NOT have backups? I looked at your log output and it
looks like sda8 has problems with the filesystem. Worse than that, it
looks, to me, that sda5 & sda9 have problems with the hardware? You
can try the e2fsck command, but that is complaining about a scsi sense
code error, that is usually a hardware issue.

The actual command to safely check each of the file systems are below.
These commands are considered safe, but there is no guarantee that
any file system check will work. The only thing guaranteed to work is
a backup. If you can't boot up enough to run these commands, any
"live" CD such as knoppix, gentoo, even a redhat boot CD will do. The
live CD will boot, then provide you with the ability to run commands.
Make sure that the partitions are not "mounted" when you run the
e2fsck checks.

/sbin/e2fsck -p /dev/sda8
/sbin/e2fsck -p /dev/sda9

If you have further questions, please let me know.

Scott M

Jim Ramsey

unread,
Sep 23, 2008, 11:19:22 AM9/23/08
to Akro...@googlegroups.com
Scott saw what I missed.

You have a 160GB SATA hard drive, I believe.
I'm also assuming that you will shortly be in
the market for a new hard drive but need to
secure as much of the contents of the old one
as possible.


I would suggest the following.

Get a knoppix CD distribution and an external USB hard drive.
They aren't expensive and they are really usefull.

You may want to reformat the USB drive to EXT3 instead of FAT
or NTFS to use it with Linux.

Use the Knoppix distribution to mount the the variuse partitions
on the SATA drive read-only and copy them to the USB hard drive.
You can use "cp -av" or "rsync" to do the copying.

In addition, I have a marvelous little tool for converting ATA
and SATA drives into USB drives. With that, it's possible to
do the backup using an entirely different computer.


Another simple suggestion... If this disk failure is heat related
at all, you may find that you can turn you machine off for a while
and then start it up and run it without error. This is another advantage
of the conversion tool I described above. You can keep the old
drive cooler while you copy off data.

Regards,

Jim Ramsey


On Monday 22 September 2008 18:38:06 arch3angel wrote:
>

signature.asc

Scott McCarty

unread,
Sep 23, 2008, 12:09:17 PM9/23/08
to Akro...@googlegroups.com
Jim, agreed. If there is no backup, I would try and make one of as
much data as I can now.

Scott M

Matthew Shannon

unread,
Sep 23, 2008, 10:10:19 PM9/23/08
to Akro...@googlegroups.com
Another utility to try would be ddrescue. It can take a block device and copy to another, retrying bad sectors until it gets as much data as possible. A typical scenario would be to plug in another blank drive and use 'ddrescue /dev/sd? /dev/sd?' to copy from the bad drive to the new one. It will make a direct copy of everything possible to recover without sending the drive off to Ontrack (or anyone else that does professional, clean room recoveries). Then you should be able to get what you need off of the new drive without having to worry about making the problem worse. I've used this succsessfully on a few of my customers systems, in fact I have one going right now! Filesystem shouldn't matter as it copies block by block, I've used it on FAT32 and NTFS drives. Hopefully I'm not too late on this suggestion!

stevea

unread,
Sep 24, 2008, 10:47:17 AM9/24/08
to Akro...@googlegroups.com
Just a quick addendum to JimR's note.

Make absolutely certain the file system is unmounted before using fsck.
Expect to find some lost files in the lost+found directory, but the
file names will be missing. Use 'file' and such to figure out what
these missing files are - if possible,

-S

Reply all
Reply to author
Forward
0 new messages