如何挂载一个xen的.img

输出文件是415.img,看下里面内容吧:

 

--------------------------------------------

网上别人做法是:

1. First you need to find out the partitions and the startsector of partitions:
[root@xen rruban]# file rheltest.imgrheltest.img: x86 boot sector, GRand Unified Bootloader (0.94); partition 1: ID=0x83, active, starthead 1, startsector 63, 208782 sectors; partition 2: ID=0x8e, starthead 0, startsector 208845, 3871665 sectors, code offset 0x48
There are 3 partitions inside the image file. The startsector of each partition is also listed. Boot partition will have start sector 63.
2. Now you need to get the sector size:
[root@xen]fdisk -lu rheltest.img
Disk rheltest.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 rheltest.img1 * 63 208844 104391 83 Linux rheltest.img2 208845 4080509 1935832+ 8e Linux LVM
The above shows the sector byte size is 512 byte.
3. To calculating the offset: offset = start_sector x sector_byte_size.
The startsector is 63 for the first partition, therefore the first partition offset is: 63x512=32256
4. Finally, to mount the xen image, use:
mount -o loop,offset=32256 test.img /foldername

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值