[gentoo-user] Re: Corrupt xD card with photos

2006-09-12 Thread Remy Blank
Sven Köhler wrote:
 First thing that i see is:
 where the hell is /dev/sda1? Yes, there should be a FAT partition on
 that xD card, but it's not there.
 
 So first step:
 Re-create a primary FAT partition without formatting it (for example use
 cfdisk)

This is worth a try. However, I would first dump the whole card to a
file, make a copy of the file, and try all recovery attempts on the
copy. This way, you can always go back to the original and try something
else.

Make a copy:

  dd if=/dev/sda of=xd.img bs=1M

Make a working copy:

  cp xd.img xd_work.img

Re-create the partition table:

  fdisk -b 512 -C 1024 -H 5 -S 50 xd_work.img

Enter: n, p, 1, 1, 1024, t, 6, w

(Not quite sure about the partition type (6), you might want to try
other types like FAT32 (b))

Try to mount the partition:

  mkdir mnt
  mount -o ro,loop,offset=25600 xd_work.img mnt

(25600 is 50 (number of sectors) * 512 (bytes per sector), that's the
start of the first partition)

Most of this will have to be done as root, so please be careful.

Good luck!
-- Remy


Remove underscore and suffix in reply address for a timely response.

-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] Re: Corrupt xD card with photos

2006-09-12 Thread Mick
On Tuesday 12 September 2006 08:26, Remy Blank wrote:

 This is worth a try. However, I would first dump the whole card to a
 file, make a copy of the file, and try all recovery attempts on the
 copy. This way, you can always go back to the original and try something
 else.

Blast!  Too late now - I've tried to recreate the partition table (see other 
message).  But this is a very sensible approach and I should have thought of 
it at the time.  Thank you very much for your advice - well worth bookmarking 
this one!

 Make a copy:

   dd if=/dev/sda of=xd.img bs=1M

 Make a working copy:

   cp xd.img xd_work.img

 Re-create the partition table:

   fdisk -b 512 -C 1024 -H 5 -S 50 xd_work.img

 Enter: n, p, 1, 1, 1024, t, 6, w

 (Not quite sure about the partition type (6), you might want to try
 other types like FAT32 (b))

 Try to mount the partition:

   mkdir mnt
   mount -o ro,loop,offset=25600 xd_work.img mnt

 (25600 is 50 (number of sectors) * 512 (bytes per sector), that's the
 start of the first partition)

 Most of this will have to be done as root, so please be careful.

 Good luck!
 -- Remy


 Remove underscore and suffix in reply address for a timely response.

-- 
Regards,
Mick


pgpb7TxvOWHBC.pgp
Description: PGP signature


[gentoo-user] Re: Corrupt xD card with photos

2006-09-11 Thread Sven Köhler
 I was handed what seems to be a corrupt xD flash card to extract the last 
 photo from it.  When the WinXP system at work coughed and died on it 
 (couldn't read it) I thought that my Linux would do better.  Anyhow, I've 
 inserted it into my Fuji camera and this is what dmesg shows:
 
 ===
 usb 2-1: new full speed USB device using uhci_hcd and address 4
 usb 2-1: configuration #1 chosen from 1 choice
 scsi2 : SCSI emulation for USB Mass Storage devices
 usb-storage: device found at 4
 usb-storage: waiting for device to settle before scanning
   Vendor: FUJIFILM  Model: USB-DRIVEUNIT Rev: 1.00
   Type:   Direct-Access  ANSI SCSI revision: 00
 SCSI device sda: 256000 512-byte hdwr sectors (131 MB)
 sda: Write Protect is off
 sda: Mode Sense: 07 00 00 00
 sda: assuming drive cache: write through
 SCSI device sda: 256000 512-byte hdwr sectors (131 MB)
 sda: Write Protect is off
 sda: Mode Sense: 07 00 00 00
 sda: assuming drive cache: write through
  sda: unknown partition table
 sd 2:0:0:0: Attached scsi removable disk sda
 sd 2:0:0:0: Attached scsi generic sg0 type 0
 usb-storage: device scan complete
 

First thing that i see is:
where the hell is /dev/sda1? Yes, there should be a FAT partition on
that xD card, but it's not there.

So first step:
Re-create a primary FAT partition without formatting it (for example use
cfdisk)

 Mount fails:
 
 $ mount /dev/sda
 mount: wrong fs type, bad option, bad superblock on /dev/sda,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail  or so
 
 
 and dmesg then shows:
 
 FAT: bogus number of reserved sectors
 VFS: Can't find a valid FAT filesystem on dev sda.
 FAT: bogus number of reserved sectors
 VFS: Can't find a valid FAT filesystem on dev sda.
 
 
 This is what fdisk shows:
 
 # fdisk /dev/sda
 Device contains neither a valid DOS partition table, nor Sun, SGI or OSF 
 disklabel
 Building a new DOS disklabel. Changes will remain in memory only,
 until you decide to write them. After that, of course, the previous
 content won't be recoverable.
 
 Warning: invalid flag 0x of partition table 4 will be corrected by w(rite)
 
 Command (m for help): p
 
 Disk /dev/sda: 131 MB, 131072000 bytes
 5 heads, 50 sectors/track, 1024 cylinders
 Units = cylinders of 250 * 512 = 128000 bytes
 
Device Boot  Start End  Blocks   Id  System
 
 Command (m for help): 
 
 
 
 Is there a Linux (or even M$Windoze?) way of me recovering the last photo, 
 that doesn't involve reconstructing raw data with a hexeditor?

Maybe your are abled to mount the FAT partition after you fixed the
partition table. Well, fixing it basically means: delete it, and
create a new one. Typically, the FAT partition simply comsumes the whole
disk. There should be a fair chance, that (c)fdisk chooses the same
start/end-sectors for the partition like any other tool (including the
camera).

Good luck!



signature.asc
Description: OpenPGP digital signature