• Mounting VMDK files in Linux


    1.用 loop 方式挂载 vmdk 文件

    1 losetup /dev/loop0 docker_pull-flat.vmdk

    2.查看分区

     1 [root@localhost]# parted /dev/loop0
     2 GNU Parted 3.1
     3 使用 /dev/loop0
     4 Welcome to GNU Parted! Type 'help' to view a list of commands.
     5 (parted) unit B                                                           
     6 (parted) p                                                                
     7 Model: Loopback device (loopback)
     8 Disk /dev/loop0: 161061273600B
     9 Sector size (logical/physical): 512B/512B
    10 Partition Table: msdos
    11 Disk Flags: 
    12 
    13 Number  Start        End            Size           Type     File system  标志
    14  1      1048576B     1074790399B    1073741824B    primary  xfs          启动
    15  2      1074790400B  161061273599B  159986483200B  primary               lvm
    16 
    17 (parted) q

    3.进行 loop2 挂载

    1 losetup -o 1074790400 /dev/loop2 /dev/loop0

    4.查看 loop2 挂载分区

    1 [root@localhost]# blkid 
    2 /dev/sda1: UUID="34146325-5f34-4883-ad6d-ac7b7edcb888" TYPE="xfs" 
    3 /dev/sda2: UUID="ca3f34ed-b355-49ff-b273-ab264f6ba17a" TYPE="swap" 
    4 /dev/sda3: UUID="04507ecc-64d0-40bf-9745-538fcc3c4a0d" TYPE="xfs" 
    5 /dev/loop2: UUID="VSyFa2-lmxS-MQ1A-8Gfu-ISEO-7ZhN-JHm12P" TYPE="LVM2_member" 
    6 /dev/mapper/centos-swap: UUID="f8816976-de66-4544-aaeb-b91b9e1cb40f" TYPE="swap" 
    7 /dev/mapper/centos-home: UUID="02eb6a55-9387-4625-b2a0-bc079225c1b8" TYPE="xfs" 
    8 /dev/mapper/centos-root: UUID="79772ae2-d506-461b-bb54-663a3e35ca89" TYPE="xfs" 
    9 /dev/loop0: PTTYPE="dos"

    5.挂在数据分区

    1 mount /dev/mapper/centos-home /mnt/
  • 相关阅读:
    解决使用vim-go插件时候保存go代码导致设置好的折叠消失的问题
    golang中从一个日期开始往后增加一段时间
    linux kernal oom killer 学习
    awk学习笔记
    FlexMonkey实战
    如何阅读一本书-读书笔记
    Oracle性能问题sql调优脚本集
    了解ORACLE培训OCA-OCP-OCM课程表
    Sublime Text 3设置笔记
    【总结】AngularJs学习总结
  • 原文地址:https://www.cnblogs.com/wangjq19920210/p/9341878.html
Copyright © 2020-2023  润新知