首页 技术 正文
技术 2022年11月12日
0 收藏 821 点赞 2,170 浏览 1611 个字

1、查看计算节点上虚机挂载的卷

[root@xgto01n010243186070 ~]# virsh domblklist instance-
Target Source
------------------------------------------------
vda /os_instance/026deca9-64a9-4cb4-830d-6806356be1bb/disk

2、查看计算节点上的vg

[root@xgto01n010243186070 ~]# vgdisplay
--- Volume group ---
VG Name vg_os
System ID
Format lvm2
Metadata Areas
Metadata Sequence No
VG Access read/write
VG Status resizable
MAX LV
Cur LV
Open LV
Max PV
Cur PV
Act PV
VG Size 4.04 TiB
PE Size 4.00 MiB
Total PE
Alloc PE / Size / 3.24 TiB
Free PE / Size / 813.12 GiB
VG UUID Dgvra8-axy2-H6iR-KQKN-t1hL-L89y-6ONv6l

3、创建lvm卷

[root@xgto01n010243186070 ~]# lvcreate -n test36 -L 1.5 vg_os
Rounding up size to full physical extent 4.00 MiB
Logical volume "test36" created.

4、查看创建的lvm卷

[root@xgto01n010243186070 ~]# lvdisplay |grep test36
LV Path /dev/vg_os/test36
LV Name test36

5、virsh  attach-disk挂载卷

virsh attach-disk instance- /dev/vg_os/test36 vdb --driver qemu --mode shareable

6、查看虚机挂载的lvm卷

[root@xgto01n010243186070 ~]# virsh domblklist instance-
Target Source
------------------------------------------------
vda /os_instance/026deca9-64a9-4cb4-830d-6806356be1bb/disk
vdb /dev/vg_os/test36

7、卸载虚机额外挂载的lvm卷

virsh detach-disk <domain> <target> [--persistent] [--config] [--live] [--current]
virsh detach-disk instance- vdb
[root@xgto01n010243186070 ~]# virsh detach-disk instance- vdb
Disk detached successfully

8、检查lvm卷是否卸载成功

[root@xgto01n010243186070 ~]# virsh domblklist instance-
Target Source
------------------------------------------------
vda /os_instance/026deca9-64a9-4cb4-830d-6806356be1bb/disk

9、移除创建的lvm卷

[root@xgto01n010243186070 ~]# lvremove /dev/vg_os/test36
Do you really want to remove active logical volume vg_os/test36? [y/n]: y
Logical volume "test36" successfully removed
[root@xgto01n010243186070 ~]# lvdisplay |grep test36
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,093
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,569
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,417
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,190
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,825
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,908