View Single Post
Old 05-18-2011, 11:20 PM   #10
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Quote:
Originally Posted by mpercy725 View Post
The data seen on C in mmcblk0 and mmcblk0p4 are drastically different. Thoughts why this might be?
Further to hawhill suggestion to use the "offset" option and to yifanlu highlighting that mmcblk0p4 is the vfat partition I thought I would illustrate:

The partitions:
Code:
# set up the loop device to the whole block device of the Kindle:
user$  sudo losetup /dev/loop0 /media/usb/mmcblk0.img

#show the partition table:
user$  sudo fdisk -l -u /dev/loop0

Disque /dev/loop0: 4001 Mo, 4001366016 octets
4 têtes, 16 secteurs/piste, 122112 cylindres, total 7815168 secteurs
Unités = secteurs de 1 * 512 = 512 octets
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Identifiant de disque : 0x489339d6

Périphérique Amorce  Début        Fin      Blocs     Id  Système
/dev/loop0p1   *        7688     1338943      665628   83  Linux
/dev/loop0p2         1338944     1388095       24576   83  Linux
/dev/loop0p3         1388096     1404479        8192   83  Linux
/dev/loop0p4         1404480     7815167     3205344    b  W95 FAT32
And after converting to byte offsets for each partition:
512 * 7688 = 3936256
512 * 1338944 = 685539328
512 * 1388096 = 710705152
512 * 1404480 = 719093760

Partition1 (contains the read only file system of the Kindle):
Code:
	
user$  sudo losetup -o 3936256 /dev/loop0 /media/usb/mmcblk0.img
user$  sudo mount /dev/loop0 mmc0
user$  cd mmc0
user/mmc0$ ls
bin  dev  etc  lib  linuxrc  mnt  opt  proc  sbin  sys  test  tmp  usr  var
Partition2 (contains the writeable file system of the Kindle):
Code:
user$  sudo losetup -o 685539328 /dev/loop0 /media/usb/mmcblk0.img
user$  sudo mount /dev/loop0 mmc0
user$  ls mmc0
audio  browser  eink  java  linkfonts  log  run  system
Partition4 (contains an embedded disk image of the /mnt/us user store of the Kindle):
Code:
user$  sudo losetup -o 719093760 /dev/loop0 /media/usb/mmcblk0.img
user$  sudo fdisk -l -u /dev/loop0

Disque /dev/loop0: 3282 Mo, 3282272256 octets
4 têtes, 16 secteurs/piste, 100167 cylindres, total 6410688 secteurs
Unités = secteurs de 1 * 512 = 512 octets
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Identifiant de disque : 0x00000000

Périphérique Amorce  Début        Fin      Blocs     Id  Système
/dev/loop0p1              16     6410687     3205336    b  W95 FAT32
Finaly, calculating the additional byte offset to skip the partition table of the embedded image, over to the vfat file system itself
719093760 + 512 * 16 = 719101952
Code:
user$  sudo losetup -o 719101952 /dev/loop0 /media/usb/mmcblk0.img
user$  sudo mount /dev/loop0 mmc0
user$  cd mmc0
user$  ls
audible              EuropeanPlus.keyb  linkss            screensaver-timeout
autorun.inf          fbKindle           local             shellinabox
bozohttpd            helloworld         md                sstimeout
CdcApplication1      keybru             metadata.calibre  system
configgz             keystore           mplayer           tcc
developer            kimesg             music             tcpdump
documents            kindle.ico         nano              TTSMod
driveinfo.calibre    KiTerm             nb                usbnet
dumbfrotz            linkfonts          pictures
ENABLE_HACK_UPDATES  linkjail           screen
Hope this helps
PoP is offline   Reply With Quote