如何挂载linux虚拟机克隆磁盘?

时间:2014-02-03 06:29:52

标签: virtual-machine qemu kvm

我创建了一个CentOS克隆的磁盘映像,如URL here中所指定的那样,我能够按照下面的指定安装基本磁盘映像

To get base disk image details:
   1) fdisk -lu raw.img

To mount the base disk image:
   2) losetup /dev/loop0 raw.img -o $((9766912   * 512))
   3) file -s /dev/loop0
   4) mount /dev/loop0 /mnt
   5) cd /mnt
   6) ls -l
       bin/    etc/    lost+found/     mnt/    orig_boot/  
       sbin/   sys/           var/    boot/   home/   media/          
       proc/   selinux/        tmp/  wlcv_root_info/ ....

 To umount the base disk image:
   7) umount /mnt
   8) losetup -d /dev/loop0

但我无法在克隆的磁盘上获得相同的内容:(并且我收到以下错误消息

-sh-4.1# mount /dev/loop0 /mnt
     mount: you must specify the filesystem type

 -sh-4.1# mount -t ext3 /dev/loop0 /mnt
   mount: wrong fs type, bad option, bad superblock on /dev/loop0,
          missing codepage or helper program, or other error
          In some cases useful info is found in syslog - try
          dmesg | tail  or so

我尝试使用ext2,ext3和ext4文件系统类型,但似乎没有任何帮助。请指导我安装克隆磁盘,以便查看克隆磁盘中创建的所有文件。

1 个答案:

答案 0 :(得分:0)

你试过这个吗?

mount -r <fstype> <fsdev> <fsdir>

       -r:     Mount read only.
       fstype: The filesystem type to mount
       fsdev:  The name of a block device to mount.
       fsdir:  The directory to mount to.

编辑:

不知道你身边发生了什么。你可能试一试。看看这个问题Mount complains a wrong fs type, bad option, or a bad superblock。另请尝试mount -t auto

相关问题