Допустим у нас есть образ диска в формате img, снятый напрмер с помощью dd if=/dev/sda of=test.img
Нужно достать из него контент.
Смотрим партиции на образе:
# sfdisk -l -uS test.img
Disk test.img: cannot get geometry
Disk test.img: 8 cylinders, 255 heads, 63 sectors/track
Units = sectors of 512 bytes, counting from 0
Device Boot Start End #sectors Id System
test.img1 * 1 144584 144584 83 Linux
test.img2 0 - 0 0 Empty
test.img3 0 - 0 0 Empty
test.img4 0 - 0 0 EmptyВ данном случае в образе только одна партиция, ее и достанем:
# dd if=test.img of=extract.img skip=1 count=144584
143359+0 records in
143359+0 records outТеперь можно монтировать раздел:
# mount -o loop extract.img /tmp/test
# mount | grep test
/dev/loop0 on /tmp/test type ext3 (rw)Первоисточник