通过loop方式挂载raw格式镜像
来源:互联网 发布:天知地知你知我知 编辑:程序博客网 时间:2024/06/05 11:47
虚拟机的镜像可以直接通过loop的方式来进行挂载,这种方式你必须先计算出镜像中每个分区的偏移量(fdisk -lu可查看),然后通过loop的方式的挂载,加上偏移量
详细命令如下
[root@centos images]# cd /var/lib/libvirt/images/[root@centos images]# fdisk -lu ubuntu.raw You must set cylinders.You can do this from the extra functions menu.Disk ubuntu.raw: 0 MB, 0 bytes255 heads, 63 sectors/track, 0 cylinders, total 0 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x000ccae5 Device Boot Start End Blocks Id Systemubuntu.raw1 * 2048 38862847 19430400 83 LinuxPartition 1 has different physical/logical endings: phys=(1023, 254, 63) logical=(2419, 25, 38)ubuntu.raw2 38864894 40957951 1046529 5 ExtendedPartition 2 has different physical/logical beginnings (non-Linux?): phys=(1023, 254, 63) logical=(2419, 58, 6)Partition 2 has different physical/logical endings: phys=(1023, 254, 63) logical=(2549, 131, 14)ubuntu.raw5 38864896 40957951 1046528 82 Linux swap / Solaris[root@centos images]# echo $((2048*512))1048576[root@centos images]# mount -o loop,offset=1048576 ubuntu.raw /image/[root@centos images]# umount /image/
PS:这个方式的镜像必须是Raw格式的。
当然你也可以通过kpartx的方式进行挂载,详见 通过kpartx方式挂载raw格式镜像
0 0
- 通过loop方式挂载raw格式镜像
- 通过kpartx方式挂载raw格式镜像
- 通过qemu-nbd方式挂载qcow2镜像格式
- qcow2、raw、vmdk等镜像格式
- qcow2、raw、vmdk等镜像格式
- qcow2、raw、vmdk等镜像格式
- qcow2、raw、vmdk等镜像格式
- qcow2、raw、vmdk等镜像格式
- qcow2、raw、vmdk等镜像格式
- 转:qcow2、raw、vmdk等镜像格式
- 转:qcow2、raw、vmdk等镜像格式
- KVM qcow2、raw、vmdk等镜像格式和转换
- 虚拟机镜像文件格式-raw
- 转-挂载raw和qcow2格式的KVM硬盘镜像
- qcow2、raw、vmdk等镜像格式的比较和基本转换
- qcow2、raw、vmdk等镜像格式的比较和基本转换
- qcow2、raw、vmdk等镜像格式的比较和基本转换
- qcow2、raw、vmdk等镜像格式的比较和基本转换
- 基于Servlet、JSP、JDBC、MySQL的一个简单的用户注册模块(附完整源码)
- 安卓实训第十一天--DOM、SAX解析XML
- erlang---启动参数学习/研究
- vim命令
- C/C++中容易造成内存溢出的函数
- 通过loop方式挂载raw格式镜像
- 区别getReadableDatabase()与getWritableDatabase()
- Android进阶之大话设计模式
- 【人生的四个不能等】
- linux下杀死进程全权讲解
- 哈夫曼编码与解码
- "家园"的详细设计(2)
- ios开发属性列表例子
- 全局变量报错:UnboundLocalError: local variable 'i' referenced before assignment