Mounting a hard disk image including partitions using Linux
ต้องการ Mount เฉพาะบาง Partition จาก Disk Image ที่สร้างด้วย > dd เพื่อมาใช้งาน
สร้าง Image ด้วย
# dd if=/dev/had of=hda.img 30544113+0 records in 30544113+0 records out
ก่อนอื่นหา Offset ของ Partition ที่ต้องการ Mount ก่อน
# parted hda.img GNU Parted 1.7.1 Using /data/rabbit/disk_image/test2 Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) unit Unit? [compact]? B (parted) print Disk /data/rabbit/disk_image/test2: 10262568959B Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 32256B 106928639B 106896384B primary ext3 boot 2 106928640B 1184440319B 1077511680B primary linux-swap 3 1184440320B 10256924159B 9072483840B primary ext3 (parted) quit
สุดท้ายทำการ Mount ได้ด้วยคำสั่ง
#mount -o loop,ro,offset=32256 hda.img /mnt/rabbit
อ้างอิง http://www.andremiller.net/content/mounting-hard-disk-image-including-partitions-using-linux
Categories: Linux OS