fdisk -l <img file>ลองใช้คำสั่ง โดยทั่วไปถ้า.imgไฟล์ทั้งหมดเป็นดิสก์จากการพูดของ KVM VM พวกเขากำลังเทคนิคดิสก์เสมือนจริง
ตัวอย่าง
ฉันมี CentOS KVM VM ซึ่งแสดงเช่นนั้นด้วยfileคำสั่ง:
$ file centostest.img 
centostest.img: x86 boot sector; partition 1: ID=0x83, active, starthead 1, startsector 63, 208782 sectors; partition 2: ID=0x8e, starthead 0, startsector 208845, 20755980 sectors, code offset 0x48
ทำงานfdiskกับมัน
$ sudo /sbin/fdisk -lu /kvm/centostest.img
last_lba(): I don't know how to handle files with mode 81ed
You must set cylinders.
You can do this from the extra functions menu.
Disk /kvm/centostest.img: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
              Device Boot      Start         End      Blocks   Id  System
/kvm/centostest.img1   *          63      208844      104391   83  Linux
/kvm/centostest.img2          208845    20964824    10377990   8e  Linux LVM
Partition 2 has different physical/logical endings:
     phys=(1023, 254, 63) logical=(1304, 254, 63)
หากคุณต้องการติดตั้งหนึ่งในพาร์ติชั่นเหล่านี้คุณสามารถทำได้ดังนี้:
fdisk (เอาต์พุตกระบอกสูบ)
- ขนาดบล็อก 512 ไบต์และบล็อกเริ่มต้นคือ 63 
- ออฟเซ็ตคือ 512 * 63 = 32256
fdisk (ภาคเอาท์พุท)
- block-size 512 ไบต์และ start-block คือ 1
- ออฟเซ็ตคือ 512 * 1 = 512
ดังนั้นคำสั่ง mount จะเป็น:
ในกระบอกสูบ
$ mount -o loop,offset=32256 centostest.img /mnt/tmp
หากต้องการเมาท์พาร์ติชันอื่น (512 * 208845 = 106928640):
$ mount -o loop,offset=106928640 centostest.img /mnt/tmp
ในภาค
$ mount -o loop,offset=512 centostest.img /mnt/tmp
หากต้องการเมาท์พาร์ติชันอื่น (512 * 14 = 7168):
$ mount -o loop,offset=7168 centostest.img /mnt/tmp
บันทึก
วิธีนี้จะใช้งานได้หากการเมานต์สามารถกำหนดประเภทของระบบไฟล์ภายใน "พาร์ติชัน" ที่คุณพยายามเมาต์ คุณอาจต้องรวม-t autoหรือเจาะจงและบอกmountว่ามันเป็น-t ext4ตัวอย่าง
อ้างอิง
               
              
# mount -t auto -o ro,loop,offset=512 gmapsupp.img /mnt/iso/\mount: you must specify the filesystem type