///PV层操作////
****初始化硬盘,分配PVID
[root@vol.test:/]#chdev -l hdisk1 -a pv=yes
[root@vol.test:/]#lspv
hdisk0 00f6cb19748f5fd3 rootvg active
hdisk1 00f6cb198552b3a2 None
****删除硬盘PVID
[root@vol.test:/]#chdev -l hdisk6 -a pv=clear
[root@vol.test:/]#lspv
hdisk0 00f6cb19748f5fd3 rootvg active
hdisk1 none None
****系统中删除硬盘
[root@vol.test:/]#rmdev -l hdisk6
****查看物理设备信息
lsdev
****当PV加入卷组时这两条命令可用
lspv chpv
///VG层操作////
***创建卷组
[root@vol.test:/]#mkvg -y test01vg -s 8 hdisk1 hdisk2
test01vg
[root@vol.test:/]#lsvg
rootvg
test01vg
[root@vol.test:/]#lsvg -o
test01vg
rootvg
***删除卷组
[root@vol.test:/]#reducevg -d test01vg hdisk1 hdisk2
ldeletepv: Volume Group deleted since it contains no physical volumes.
[root@vol.test:/]#lsvg
rootvg
***编辑卷组
添加硬盘
[root@vol.test:/]#extendvg test01vg hdisk3
[root@vol.test:/]#lsvg -p test01vg
test01vg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk1 active 31 31 07..06..06..06..06
hdisk2 active 31 31 07..06..06..06..06
hdisk3 active 31 31 07..06..06..06..06
删除硬盘
[root@vol.test:/]#reducevg test01vg hdisk3
[root@vol.test:/]#lsvg -p test01vg
test01vg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk1 active 31 31 07..06..06..06..06
hdisk2 active 31 31 07..06..06..06..06
镜像卷组
[root@vol.test:/]#extendvg test01vg hdisk5
[root@vol.test:/]#mirrorvg -c 2 test01vg hdisk5
[root@vol.test:/]#lsvg -p test01vg
test01vg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk1 active 31 30 07..05..06..06..06
hdisk2 active 31 29 07..04..06..06..06
hdisk5 active 63 60 13..10..12..12..13
[root@vol.test:/]#unmirrorvg test01vg hdisk5
[root@vol.test:/]#lsvg -p test01vg
test01vg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk1 active 31 30 07..05..06..06..06
hdisk2 active 31 29 07..04..06..06..06
hdisk5 active 63 63 13..13..12..12..13
激活卷组
[root@vol.test:/]#chvg -an test01vg
[root@vol.test:/]#
[root@vol.test:/]#chvg -ay test01vg
rmlv [ -B ] [ -f ] [ -p Physical Volume ] LogicalVolume ...
rmfs [ -r | -i ] FileSystem
==========================
[root@node1:/]#lsattr -El hdisk2|grep size /加入卷组后查看卷大小
[root@node1:/]#bootinfo -s hdisk24 /加入卷组前查看卷大小
[root@node1:/]#rmdev -Rdl hdisk24 /从ODM库删除PV
-y'bitvg' '-n' -V'34' '-C' hdisk24
-y'bitvg' '-f' '-n' -V'41' '-C' hdisk24
阅读(645) | 评论(0) | 转发(0) |