gabriel rosenkoetter on Mon, 8 Jul 2002 02:00:07 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] corrupted partition table on CF card


On Sun, Jul 07, 2002 at 05:34:59PM -0600, W. Chris Shank wrote:
> oh shit, it worked this time! i swear i tried this yesterday and it didn't
> work. look like dd successfully pulled all data from card. at least i think
> it did. the card is 64M total, but it wasn't nearly full. would that matter?
> should the dd snapshot be 64M? Now that I have this data down, how can i
> recover the image files?

Dunno. In what format are they stored?

If they're JPEGs (or any other standard image format), then recognize
them the same way file(1) does. See your local magic file. Mine's
at /usr/share/misc/magic. You should probably also have a magic(5)
describing the file format.

NetBSD's magic says that if you've got a BE short at byte position 0
that contains 0xffd8, you might looking at the beginning of a JPEG.
(You might very well be looking at something else of course.) There
are (many) further conditions beyond that, so you should be able to
track down where your files start and end. From there, dd them out
of the file you've just preserved (use the seek= and count= flags),
and you should be well on your way.

Keep a backup of the file you dd'ed off, of course, so you don't
lose it.

> dd if=/dev/sdb of=cflash_out
> 125184+0 records in
> 125184+0 records out

You did, in fact get very nearly 64 MBs:

125184 blocks * 512 bytes/block = 64094208 bytes

That's within the standard screw-the-customer-by-approximate-
labeling distribution.

-- 
gabriel rosenkoetter
gr@eclipsed.net

Attachment: pgpA91YO46VT8.pgp
Description: PGP signature