Run the following command to mount the imgfile of the Ubuntu Virtual Machine:
"Sudo Mount-o loop XXX. img/mnt/xxx ",
System prompt:
"Mount: You must specify the filesystem type"
After "-T ext3" is added, the following error occurs:
mount : wrong fs type , bad option, bad superblock on /dev/loop2 , missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so |
First of all, it should be noted that this is because the IMG file contains MBR at the beginning, and the system cannot recognize it ...... The imgfile is equivalent to a hard disk that contains an operating system, and we need to mount part of the file system, so we need to bypass MBR.
Execute: fdisk-ul XXX. IMG, and display a lot of information, such:
Disk 3059.img: 4294 MB, 4294967296 bytes 255 heads, 63 sectors /track , 522 cylinders, total 8388608 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: 0x000bdbdc Device Boot Start End Blocks Id System 3059.img1 * 63 7903979 3951958+ 83 Linux 3059.img2 7903980 8385929 240975 5 Extended 3059.img5 7904043 8385929 240943+ 82 Linux swap / Solaris |
When we see this line, we find that the Linux file system starts from 63rd, so we should start mounting from this place during mounting.
3059. img1 * 63 7903979 3951958 + 83 Linux
This information can be used to output data. The slice size is 512.
Units = sectors of 1*512 = 512 bytes
So we need to mount it from 512*63
Last run:
(SUDO) Mount-o loop, offset = 32256 XXX. img/mnt/xxx ......
Note: The mount command automatically identifies the file system type of the partition based on the file system's superblock. If it cannot be identified, it will read and match entries in/etc/filesystems.