V
3  
Tags
Attachments
Dobrica Pavlinušić's random unstructured stuff
GNU fdisk broken

I have been backing up whole disk image from Eee PC, and mounting it using loop file system to access partition in it. However, I have problems with GNU fdisk which reports 4Gb image as:


Disk /backup/eee/hda: 3 GB, 3997486080 bytes
255 heads, 63 sectors/track, 486 cylinders, total 7807590 sectors
Units = sectors of 1 * 512 = 512 bytes


 Device Boot Start End Blocks Id System
 /backup/eee/hda1 63 4803435 2409718 83 Linux
 /backup/eee/hda2 4819563 7759395 1469947 83 Linux
 /backup/eee/hda3 7775523 7775460 0 c FAT32 LBA
 /backup/eee/hda4 7791588 7791525 0 ef EFI FAT

For a start, disk size is wrong:


$ ls -al hda
-rwxrwxrwx 1 dpavlin root 4001292288 2008-01-20 00:59 hda


And then, even more wrong, offsets of partition seem to be wrong. When same image is examined using fdisk from util-linux, sectors are reported like this:


Disk hda: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x332b332a


Device Boot Start End Blocks Id System
 hda1 63 4819499 2409718+ 83 Linux
 hda2 4819500 7775459 1477980 83 Linux
 hda3 7775460 7791524 8032+ c W95 FAT32 (LBA)
 hda4 7791525 7807589 8032+ ef EFI (FAT-12/16/32)

And this is correct (let's ignore size for now). I can verify this by mounting second file system as:


sudo mount hda 1 -o loop,offset=`expr 4819500 \* 512`


This seems to be off-by-one error. There is bug reported against Debian package which seems related, but than again, in my case I'm examining same disk image.


 

Upload Files

Click "Browse" to find the file you want to upload. When you click "Upload file" your file will be uploaded and added to the list of attachments for this page.

Maximum file size: 50MB

 
 
 
File Name Author Date Uploaded Size

Save Page As

Enter a meaningful and distinctive title for your page.

Page Title:

Tip: You'll be able to find this page later by using the title you choose.

Page Already Exists

There is already a page named XXX. Would you like to:

Save with a different name:

Save the page with the name "XXX"

Append your text to the bottom of the existing page named: "XXX"

Upload Files

Click "Browse" to find the file you want to upload. When you click "Add file" this file will be added to the list of attachments for this page, and uploaded when you save the page.

 
 
 
Add Tags

Enter a tag and click "Add tag". The tag will be saved when you save the page.

Tag: 

Suggestions: