[root@jay-linux image]# fdisk -lu rhel6u2.img
You must set cylinders.
You can do this from the extra functions menu.
Disk rhel6u2.img: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00048b34
Device Boot Start End Blocks Id System
rhel6u2.img1 * 2048 1026047 512000 83 Linux
Partition 1 does not end on cylinder boundary.
rhel6u2.img2 1026048 104857599 51915776 8e Linux LVM
Partition 2 has different physical/logical endings:
phys=(1023, 254, 63) logical=(6527, 21, 22)
[root@jay-linux image]# echo $((2048*512))
1048576
[root@jay-linux image]# mount -o loop,offset=1048576 rhel6u2.img /media/
[root@jay-linux image]# cd /media/
[root@jay-linux media]# ls
config-2.6.32-220.el6.x86_64 initramfs-3.5.0.img System.map-2.6.32-279.el6.x86_64
config-2.6.32-279.el6.x86_64 lost+found System.map-3.5.0
efi symvers-2.6.32-220.el6.x86_64.gz vmlinuz
grub symvers-2.6.32-279.el6.x86_64.gz vmlinuz-2.6.32-220.el6.x86_64
initramfs-2.6.32-220.el6.x86_64.img System.map vmlinuz-2.6.32-279.el6.x86_64
initramfs-2.6.32-279.el6.x86_64.img System.map-2.6.32-220.el6.x86_64 vmlinuz-3.5.0
[root@jay-linux media]# echo $((1026048*512))
525336576
[root@jay-linux media]# umount /media
[root@jay-linux media]# cd /home/image/
[root@jay-linux image]# umount /media
[root@jay-linux image]# mount -o loop,offset=525336576 rhel6u2.img /media/
mount: unknown filesystem type ‘LVM2_member‘
(镜像文件中的LVM分区mount的问题,本文最后单独说明)
[root@jay-linux image]# fdisk -lu sles11sp2-i386.img
You must set cylinders.
You can do this from the extra functions menu.
Disk sles11sp2-i386.img: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0002d3be
Device Boot Start End Blocks Id System
sles11sp2-i386.img1 2048 4208639 2103296 82 Linux swap / Solaris
Partition 1 does not end on cylinder boundary.
sles11sp2-i386.img2 * 4208640 41943039 18867200 83 Linux
Partition 2 has different physical/logical endings:
phys=(1023, 254, 63) logical=(2610, 212, 34)
[root@jay-linux image]# echo $((4208640*512))
2154823680
[root@jay-linux image]# mount -o loop,offset=2154823680 sles11sp2-i386.img /media
[root@jay-linux image]# cd /media/
[root@jay-linux media]# ls
bin dev home lost+found mnt proc sbin srv sys usr
boot etc lib media opt root selinux success tmp var
[root@jay-linux image]# umount /media/