Re: [SLUG] HD fscked?

From: Eben King (eben1@tampabay.rr.com)
Date: Fri Dec 09 2005 - 14:09:50 EST


On Fri, 9 Dec 2005, Levi Bard wrote:

> > Can you access the disk using the alternate partition tables at blocks
> > (8192*n + 1) IIRC?
>
> How do I go about doing that? Is there a flag I can pass to fdisk?

e2fsck has such an option:

 -b superblock
        Instead of using the normal superblock, use an alternative
        superblock specified by superblock. This option is normally
        used when the primary superblock has been corrupted.

But in order to e2fsck the image, you have to have attached it to a device
already, and to attach it to a device, you have to know where the partition
starts. A bit of a Catch-22.

I suppose you could:

dd bs=512 if=/dev/hda conv=noerror | gzip -9 > hda.img.gz

look at the partitions of a good drive with dd and od to see what the
beginning of a partition looks like

gzip -d < hda.img.gz | od -t x1 --address-radix=d | grep <that string>
(unless you know about where they begin, in which case you can speed things
up dramatically by supplying an appropriate "skip=" option to dd)

That should tell you where partitions begin.

gzip -d < hda.img.gz | dd bs=1k skip=<partition beginning> count=<partition
length> | file -

Just to make sure you're right... that should take only a few seconds. If
you're right,

gzip -d < hda.img.gz | dd bs=1k skip=<partition beginning> count=<partition
length> > hdan.img

Then proceed with the losetup. Don't forget to fsck with the "-b" option.

-- 
-eben    ebQenW1@EtaRmpTabYayU.rIr.OcoPm    home.tampabay.rr.com/hactar
CAPRICORN:  The stars say you're an exciting and wonderful person...
but you know they're lying.  If I were you, I'd lock my doors and
windows and never never never never leave my house again.  -- Weird Al

----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:26:27 EDT