Re: unable to recover ext3 - please help

From: Gordon Henderson (gordon_at_lion.drogon.net)
Date: 10/15/04


Date: Fri, 15 Oct 2004 10:43:39 +0000 (UTC)

In article <cko6rp$86e$1@panorama.wcss.wroc.pl>,
Maciej Mrozowski <reavertm@hotmail.com> wrote:
>hi
>yesterday my gentoo has freezed (propably due to hard disk cable
>corruption).
>It booted properly, but after that, some files begin to vapour. I rebooted
>system immediately (reset switch) and changed the ide cable. Next time my
>linux hasn't started reporting typical kernel error message - unable to
>mount root. I used rescue cd and started to recover filesystems. For root
>partition it was only necessary to find a superblock to make fsck recover
>important files. Unfortunataly i didn't managed to recover second ext3
>partition. fsck.ext3 has failed with message:
>"ext3 recovery flag clear, but journal has data. Recovery flag not set in
>backup superblock, so running journal anyway.
>fsck.ext3: unable to set superblock flags on /usr/local"
>i have absolutely no idea what to do now. unfortunately this partition
>contains data very important for me (for example, location of meeting of my
>project group for tomorrow) and I just don't want to think what's going to
>happen with me if i loose all of this.I would like to repair that filesystem
>(even with corrupted directory structure with all of them moved to
>lost+found, like it was after running fsck on my first partition) rather
>than recover number of files using some recovery tools, because i just don't
>have so much disk space.

It's obviously not important enough for you to keep a backup of, so
just format the entre disk and install from scratch, miss the meeting,
lose your job, end up on the dole, lost, forlorn, and pennyless, all
because you never bothered to take the simple steps of making a backup.

However, here is what I'd do in this situation ...

It sounds like you've recovered root, so boot the machine in maintenance
mode. Under Debian you pass the -b flag to the kernel via Lilo. (Note,
this is a lower-level than single user with the -s flag) This should
leave you with / mounted read-only and nothing else mounted. (Although
mount will lie to you and tell you other disks are mounted) I don't know
what Gentoo will do though - hopefully it will be sensible.

Re-mount root read/write -

  mount -oremount,rw /

Mount your failed partition as ext2, read-only:

  mount -r -t ext2 /dev/hdaX /mnt

(/dev/hdaX is the partition that /usr/local resides under)

See if your files exist under /mnt. If so, copy them to some space under
root. If not, then recover then from backup. Oops, you were too lazy
to do this. Better luck next time. If the files are damaged and lost,
then you might get lots of errors from the kernel as it tries to read
them. In extreme caes theres the possibility of a kernel crash, although
I haven't seen this for some time.

Then you can umount it and fsck it - as an ext2 filesystem.

  umount /dev/hdaX
  fsck -t ext2 -fC -y /dev/hdaX

if it found any errors, do it again until it runs clean.

Remount it as before, and try to find your most important files and copy
them to somewhere under root.

At this point, you've probably done as much as you can without delving
into serious low-level voodoo.

If it looks in-tact after the fscking, you can re-create the journal with

  tune2fs -j /dev/hdX

and then reboot your machine. However, if it's that badly hosed, I'd
rebuild the machine.

AND KEEP A BACKUP NEXT TIME!

Good luck...

Gordon



Relevant Pages

  • Re: duplicating system disks
    ... We had a discussion with our Platinum suport TAMS and the Engineering ... :know some specifics about file time stamps when using the backup command. ... I asked specifically about using it to CLONE an OS disk. ... etc) I'd be looking at how to recover the core critical ...
    (comp.os.vms)
  • Re: Early (non-euphoric) impressions of MacBook Pro
    ... In the meantime I had been reading up about backup software for the Mac, ... Worthy of OS/2, in fact. ... And disk maintenance? ... that's so much worse than having a disk from which I can recover ...
    (comp.os.os2.advocacy)
  • Re: what to do about "cannot dump to dumpdev hd(1/41): space for
    ... smoke out anything that would point to root being there. ... whole disk division and maybe boot but nothing else. ... I've see that before when a client used Microlite Backup ... alter the file system and log its results to /tmp/logfsck. ...
    (comp.unix.sco.misc)
  • Re: ReiserFS vs hard disk
    ... > slave and I tried to at least recover some files. ... sector probelms will say track-xxx head-yyy sector-zz ... overwrote last weeks good backup with yesterday's bad data ... you can read your data dozens of different ways before the disk really ...
    (Debian-User)
  • Re: HELP!How to recover .f file from exsting .o or bin file?
    ... how can I recover the original .f file? ... Plus, of course, a system backup to a separate disk (or other medium, ... thus I shut down all the related configurations and started ...
    (comp.lang.fortran)