Sponsored Content
Full Discussion: SATA drive FAT recover
Special Forums Hardware SATA drive FAT recover Post 302505018 by Corona688 on Wednesday 16th of March 2011 01:49:34 AM
Old 03-16-2011
That's not how grep works... or how FAT works, for that matter... The name and the contents are never in the same place.

You'd be better off looking for the string "FAT16" or "FAT32" in the drive with a hex editor. That'll help you find where the FAT partition begins.

---------- Post updated at 11:36 PM ---------- Previous update was at 11:30 PM ----------

Here's what my FAT32 USB drive looks like:

Code:
$ sudo dd if=/dev/sdc | hexdump -C | head -n 40
00000000  fa be 00 7c bf 00 7a b9  00 01 fc 0e 1f 0e 07 f3  |...|..z.........|
00000010  a5 ea 16 7a 00 00 bb be  7b 33 c9 80 3f 80 75 06  |...z....{3..?.u.|
00000020  fe c5 8b f3 eb 07 80 3f  00 75 02 fe c1 83 c3 10  |.......?.u......|
00000030  81 fb fe 7b 72 e5 83 f9  04 74 0b 81 f9 03 01 74  |...{r....t.....t|
00000040  0a bb a5 7a eb 2c bb 87  7a eb 27 8b 4c 02 8b 14  |...z.,..z.'.L...|
00000050  b8 01 02 bb 00 7c cd 13  73 05 bb bc 7a eb 13 2e  |.....|..s...z...|
00000060  a1 fe 7d 3d 55 aa 74 05  bb bc 7a eb 05 ea 00 7c  |..}=U.t...z....||
00000070  00 00 2e 8a 07 3c 00 74  0c 53 bb 07 00 b4 0e cd  |.....<.t.S......|
00000080  10 5b 43 eb ed eb fe 4e  6f 20 62 6f 6f 74 61 62  |.[C....No bootab|
00000090  6c 65 20 70 61 72 74 69  74 6f 6e 20 69 6e 20 74  |le partiton in t|
000000a0  61 62 6c 65 00 49 6e 76  61 6c 69 64 20 50 61 72  |able.Invalid Par|
000000b0  74 69 74 6f 6e 20 74 61  62 6c 65 00 49 6e 76 61  |titon table.Inva|
000000c0  6c 69 64 20 6f 72 20 64  61 6d 61 67 65 64 20 42  |lid or damaged B|
000000d0  6f 6f 74 61 62 6c 65 20  70 61 72 74 69 74 69 6f  |ootable partitio|
000000e0  6e 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |n...............|
000000f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001b0  00 00 00 00 00 00 00 00  f4 f1 10 f0 00 00 00 01  |................|
000001c0  0c 0f 0c 04 e0 a0 80 1f  00 00 80 40 ef 00 00 00  |...........@....|
000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000200  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000210  55 53 42 20 54 65 73 74  65 72 20 32 30 30 38 2d  |USB Tester 2008-|
00000220  31 30 2d 33 30 20 31 2e  30 30 20 35 62 00 00 00  |10-30 1.00 5b...|
00000230  32 30 30 38 2f 31 31 2f  32 35 00 00 00 00 00 00  |2008/11/25......|
00000240  31 32 3a 33 33 3a 34 37  00 00 00 00 00 00 00 00  |12:33:47........|
00000250  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
003f0000  eb 58 90 29 5e 76 56 4b  49 48 43 00 02 08 90 08  |.X.)^vVKIHC.....|
003f0010  02 00 00 00 00 f8 00 00  20 00 10 00 80 1f 00 00  |........ .......|
003f0020  80 40 ef 00 b8 3b 00 00  00 00 00 00 02 00 00 00  |.@...;..........|
003f0030  01 00 08 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
003f0040  00 01 29 53 6a af d5 20  20 20 20 20 20 20 20 20  |..)Sj..         |
003f0050  20 20 46 41 54 33 32 20  20 20 fa 33 c9 8e d1 bc  |  FAT32   .3....|
003f0060  f8 7b 8e c1 bd 78 00 c5  76 00 1e 56 16 55 bf 22  |.{...x..v..V.U."|
003f0070  05 89 7e 00 89 4e 02 b1  0b fc f3 a4 8e d9 bd 00  |..~..N..........|
003f0080  7c c6 45 fe 0f 8b 46 18  88 45 f9 38 4e 40 7d 25  ||.E...F..E.8N@}%|
003f0090  8b c1 99 bb 00 07 e8 97  00 72 1a 83 eb 3a 66 a1  |.........r...:f.|
003f00a0  1c 7c 66 3b 07 8a 57 fc  75 06 80 ca 02 88 56 02  |.|f;..W.u.....V.|
$ sudo dd if=/dev/sdc1 | hexdump -C | head
00000000  eb 58 90 29 5e 76 56 4b  49 48 43 00 02 08 90 08  |.X.)^vVKIHC.....|
00000010  02 00 00 00 00 f8 00 00  20 00 10 00 80 1f 00 00  |........ .......|
00000020  80 40 ef 00 b8 3b 00 00  00 00 00 00 02 00 00 00  |.@...;..........|
00000030  01 00 08 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000040  00 01 29 53 6a af d5 20  20 20 20 20 20 20 20 20  |..)Sj..         |
00000050  20 20 46 41 54 33 32 20  20 20 fa 33 c9 8e d1 bc  |  FAT32   .3....|
00000060  f8 7b 8e c1 bd 78 00 c5  76 00 1e 56 16 55 bf 22  |.{...x..v..V.U."|
00000070  05 89 7e 00 89 4e 02 b1  0b fc f3 a4 8e d9 bd 00  |..~..N..........|
00000080  7c c6 45 fe 0f 8b 46 18  88 45 f9 38 4e 40 7d 25  ||.E...F..E.8N@}%|
00000090  8b c1 99 bb 00 07 e8 97  00 72 1a 83 eb 3a 66 a1  |.........r...:f.|

...so you can see my FAT32 partition begins at offset 003f0000. The partition table this translates to:
Code:
$ sudo /sbin/fdisk -ul /dev/sdc

Disk /dev/sdc: 8032 MB, 8032092160 bytes
5 heads, 32 sectors/track, 98048 cylinders, total 15687680 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xf010f1f4

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            8064    15687679     7839808    c  W95 FAT32 (LBA)
$

---------- Post updated at 11:37 PM ---------- Previous update was at 11:36 PM ----------

That start number is related:

Code:
$ printf "%x\n" $((8064*512))
3f0000
$ echo "$((0x3f0000/512))
8064
$

---------- Post updated at 11:49 PM ---------- Previous update was at 11:37 PM ----------

Then, if you know the offset of your vfat partition you can (as a special -o loop trick) mount part of a disk, letting you get at it without altering your partition table!

Code:
$ mount -t vfat -o loop,ro,offset=$((0x3f0000)) /dev/sdc /mnt/gentoo
ls /mnt/gentoo
BOOTEX.LOG                                montg.iaf
...
$

 

8 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

The best partitioning schem for a 250GB Sata hard drive & a 75GB SCSI hard drive

Hi I have 2 75GB SCSI hard drives and 2 250GB SATA hard drives which are using RAID Level 1 respectively. I wana have both FTP and Apache installed on them as services. I'm wondering what's the best partitioning schem? I wana use FC3 as my OS, so, I thought I can use the 75GB hard drive as the /... (0 Replies)
Discussion started by: sirbijan
0 Replies

2. UNIX for Advanced & Expert Users

trying to setup a sata drive using a sata to scsi adaptor

trying to setup a sata drive using a sata to scsi adaptor I have a sata 1TB Deskstar that I had setup before and during shipment from a facilty to another, the disk failed. The handling was not great, lots of throwing boxes, etc. I have a new disk from Hitachi (thankyou Hitachi) anyway, I don't... (1 Reply)
Discussion started by: mndavies
1 Replies

3. Hardware

Connect SATA Laptop HardDrive to Desktop SATA Slots

Hello everybody, I need to connect a laptop 2.5 SATA hard drive to a Desktop board (which uses 3.5' SATA hard drives). I've tried the connectors and they fit excellent in the 2.5 SATA connectors. The problem is that the laptop hard drive uses 5v and the PC's power source sends 12v. So, my... (4 Replies)
Discussion started by: Zykl0n-B
4 Replies

4. Solaris

Cannot recover OS hard drive from a set of snapshots

I have installed Solaris 11 Express on my computer and set up a script to make daily snapshots of all filesystems and send them to a backup disc. Now I'm trying to replace the system disc using a set of captured snapshots. I have found an article on that topic on the internet and have been... (6 Replies)
Discussion started by: RychnD
6 Replies

5. Hardware

Question on SATA 300 vs SATA 600

I have an upgrade path in mind for a new computer that will be stocked with a 2TB SATA 300 hard disk. This is a choice based on information that SATA 300 is not necessarily faster than SATA 600. The upgrade path in a year time or so would then involve the purchase of an SSD that would contain the... (4 Replies)
Discussion started by: figaro
4 Replies

6. UNIX for Advanced & Expert Users

Strange FAT filesystem

My Garmin GPS device has a slot for an SD card. I'm using a 32 GB SD card which holds 22 GB data currently. If I attach my device to a USB port it shows two devices, the internal memory and the SD card. I have no problems with the internal memory which holds only 2 GB of data. I can mount... (2 Replies)
Discussion started by: HJarausch
2 Replies

7. UNIX for Dummies Questions & Answers

Reading QNX created FAT ZIP drive in WIndows 7

Hi All, One of our clients has an old QNX server system that writes history backups on ZIP disks. They then wish to take these back up ZIP disks, plug them into a Win7 box with an external ZIP drive and copy them across to an external Hard Drive. The files can be seen on the Win7 box but wont... (3 Replies)
Discussion started by: Beldanan
3 Replies

8. Hardware

Hitachi SATA hard disk drive password locked

Hi everyone (see attachments) I bought an HP Elitebook 8460p on eBay and it came with a password-locked Hitachi hard drive which I was told is the original hard drive. I don't know the password for the drive and running the diagnostics tools I see the hard drive is healthy. I tried booting... (9 Replies)
Discussion started by: milhan
9 Replies
All times are GMT -4. The time now is 11:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy