[email protected]:~# mount -o loop /data/kvm-pool/windows7.img /media/B/ mount:您必须指定文件系统类型
直接挂载是会失败,我们先使用fdisk -l 看一下磁盘信息:
[email protected]:~# fdisk -l /data/kvm-pool/windows7.img Disk /data/kvm-pool/windows7.img: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors Units = 扇区 of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x9c75197d 设备 启动 起点 终点 块数 Id 系统 /data/kvm-pool/windows7.img1 * 2048 206847 102400 7 HPFS/NTFS/exFAT /data/kvm-pool/windows7.img2 206848 41940991 20867072 7 HPFS/NTFS/exFAT
可以看到,这个磁盘镜像包含了两个分区。磁盘包含了两个分区,我们尝试挂载第二个分区。通过上面的信息可以看到,第二个分区起始位置是206848扇区,每个扇区大小是512 Bytes, 所以起始位置是2048*512(B)。然后我们来挂载该分区:
[email protected]:~# mount -o loop,offset=$((206848*512)) /data/kvm-pool/windows7.img /media/B/ The disk contains an unclean file system (0, 0). The file system wasn‘t safely closed on Windows. Fixing. [email protected]:~# ls /media/B/ autoexec.bat hiberfil.sys Program Files Users CloudMusic pagefile.sys Recovery Windows config.sys PerfLogs $Recycle.Bin Documents and Settings ProgramData System Volume Information
时间: 2024-10-24 16:17:31