1.用 loop 方式挂载 vmdk 文件
losetup /dev/loop0 docker_pull-flat.vmdk
2.查看分区
[root@localhost]# parted /dev/loop0
GNU Parted 3.1
使用 /dev/loop0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit B
(parted) p
Model: Loopback device (loopback)
Disk /dev/loop0: 161061273600B
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: Number Start End Size Type File system 标志
1 1048576B 1074790399B 1073741824B primary xfs 启动
2 1074790400B 161061273599B 159986483200B primary lvm (parted) q
3.进行 loop2 挂载
losetup -o 1074790400 /dev/loop2 /dev/loop0
4.查看 loop2 挂载分区
[root@localhost]# blkid
/dev/sda1: UUID="34146325-5f34-4883-ad6d-ac7b7edcb888" TYPE="xfs"
/dev/sda2: UUID="ca3f34ed-b355-49ff-b273-ab264f6ba17a" TYPE="swap"
/dev/sda3: UUID="04507ecc-64d0-40bf-9745-538fcc3c4a0d" TYPE="xfs"
/dev/loop2: UUID="VSyFa2-lmxS-MQ1A-8Gfu-ISEO-7ZhN-JHm12P" TYPE="LVM2_member"
/dev/mapper/centos-swap: UUID="f8816976-de66-4544-aaeb-b91b9e1cb40f" TYPE="swap"
/dev/mapper/centos-home: UUID="02eb6a55-9387-4625-b2a0-bc079225c1b8" TYPE="xfs"
/dev/mapper/centos-root: UUID="79772ae2-d506-461b-bb54-663a3e35ca89" TYPE="xfs"
/dev/loop0: PTTYPE="dos"
5.挂在数据分区
mount /dev/mapper/centos-home /mnt/