User Tools

Site Tools


Sidebar

* [[start]] * [[som|System on module]] * [[usomiq-beaglebone|Mentorel Beaglebone uSomIQ]] * [[usomiq|uSomIQ AM335x]] * [[somiq|SomIQ family]] * [[blueshark|BlueShark family]] * [[devkit|DevKits]] * [[usomiq-bone-cape|uSomIQ Bone Cape]] * [[somiqboard|Somiqboard]] * [[atoll|Atoll]] * [[expansion|Expansion boards]] * [[somiq-wlan|SomIQ-WLAN]] * [[os|OS support]] * [[ubuntu|Ubuntu Linux]] * [[sw-hints|SW hints]] * [[tslib|Tslib]] * [[qt-embedded|Qt embedded]] Follow us * [[http://twitter.com/mentorel|Twitter]] * [[http://www.linkedin.com/company/mentorel|LinkedIn]] * [[https://www.facebook.com/mentorel.company|Facebook]] * [[https://plus.google.com/105868322858146792212/posts|Google+]] * [[http://www.mentorel.com|MENTOREL home page]]

extract-fs-img

How to extract a filesystem from a disk image

# sfdisk -l -uS image-file
Disk image-file: 0 cylinders, 0 heads, 0 sectors/track
Warning: The partition table looks like it was made
for C/H/S=*/255/32 (instead of 0/0/0).
For this listing I'll assume that geometry.
Units = sectors of 512 bytes, counting from 0
Device Boot Start End #sectors Id System
image-filep1 32 261119 261088 83 Linux
image-filep2 261120 4267679 4006560 82 Linux swap / Solaris
image-filep3 4267680 142253279 137985600 83 Linux
image-filep4 0 - 0 0 Empty

Now, suppose you want to extract partition number 3. You can see that it starts at block 4267680 and is 137985600 blocks long. This translates into:

# dd if=image-file of=partition3-file skip=4267680 count=137985600

Now, peeking into the contents of the partition is as easy as:

# mount -t ext3 -o loop partition3-file /mnt/hack
extract-fs-img.txt · Last modified: 2014/04/04 04:47 (external edit)