pvcreate /dev/sdb
vgextend VG_NAME /dev/sdb
sudo lvextend -l +100%FREE <LV_PATH> sudo resize2fs <LV_PATH> # filesystem ¤¬ext3 / ext4 ¤Î¾ì¹ç
[root@testserver01 ~]# pvs --segments /dev/sda2 PV VG Fmt Attr PSize PFree Start SSize /dev/sda2 vg_testserver01 lvm2 a-- 105.00g 70.00g 0 8960 # ¡ /dev/sda2 vg_testserver01 lvm2 a-- 105.00g 70.00g 8960 17919 # ¢
[root@testserver07 ~]# lvscan ACTIVE '/dev/VolGroup00/LogVol00' [119.81 GiB] inherit ACTIVE '/dev/VolGroup00/LogVol01' [16.00 GiB] inherit
[root@testserver07 ~]# vgscan Reading all physical volumes. This may take a while... Found volume group "VG_rhel71" using metadata type lvm2 Found volume group "VolGroup00" using metadata type lvm2
[root@testserver07 ~]# lvscan inactive '/dev/VG_rhel71/LV_swap' [16.00 GiB] inherit inactive '/dev/VG_rhel71/LV_root' [183.66 GiB] inherit ACTIVE '/dev/VolGroup00/LogVol00' [119.81 GiB] inherit ACTIVE '/dev/VolGroup00/LogVol01' [16.00 GiB] inherit
[root@testserver07 ~]# lvchange -a a /dev/VG_rhel71/LV_root [root@testserver07 ~]# lvchange -a a /dev/VG_rhel71/LV_swap [root@testserver07 ~]# lvscan ACTIVE '/dev/VG_rhel71/LV_swap' [16.00 GiB] inherit ACTIVE '/dev/VG_rhel71/LV_root' [183.66 GiB] inherit ACTIVE '/dev/VolGroup00/LogVol00' [119.81 GiB] inherit ACTIVE '/dev/VolGroup00/LogVol01' [16.00 GiB] inherit
[root@testserver14 ~]# lvscan ACTIVE '/dev/VG_rhel71/LV_root' [183.66 GiB] inherit ACTIVE '/dev/VolGroup00/LogVol00' [119.81 GiB] inherit ACTIVE '/dev/VolGroup00/LogVol01' [16.00 GiB] inherit
[root@testserver14 ~]# lvremove /dev/VG_rhel71/LV_root Do you really want to remove active logical volume LV_root? [y/n]: y Logical volume "LV_root" successfully removed
[root@testserver14 ~]# vgremove VG_rhel71 Volume group "VG_rhel71" successfully removed
[root@testserver14 ~]# pvremove /dev/sdb2
[root@azitf01 ~]# pvdisplay /dev/hda: open failed: No medium found --- Physical volume --- PV Name /dev/sda2 VG Name VG00 PV Size 73.50 GB / not usable 1.47 MB Allocatable yes (but full) PE Size (KByte) 32768 Total PE 2352 Free PE 0 Allocated PE 2352 PV UUID tfO5Jh-MvjS-8KOo-QMNJ-SwZu-eYxa-5hty2V
[root@azitf01 ~]# vgdisplay -v VG00 --- Volume group --- VG Name VG00 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 9 VG Access read/write VG Status resizable MAX LV 0 Cur LV 8 Open LV 8 Max PV 0 Cur PV 1 Act PV 1 VG Size 73.50 GB PE Size 32.00 MB Total PE 2352 Alloc PE / Size 2352 / 73.50 GB Free PE / Size 0 / 0 VG UUID olVTyn-boKT-yBOW-OYRg-Loou-Fekd-3Q8rQb --- Logical volume --- LV Name /dev/VG00/root VG Name VG00 LV UUID wKyFLg-IO0n-ZQGE-STyH-d9ui-d7ae-YpzVPT LV Write Access read/write LV Status available # open 1 LV Size 7.81 GB Current LE 250 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %util sda 0.00 0.00 0.00 73.00 0.00 20.51 575.34 73.55 1719.53 13.71 100.10 sda1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 sda2 0.00 0.00 0.00 73.00 0.00 20.51 575.34 73.55 1719.53 13.71 100.10 dm-0 0.00 0.00 0.00 1.00 0.00 0.00 8.00 15.02 30186.00 1001.00 100.10 dm-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 dm-2 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 dm-3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 dm-4 0.00 0.00 0.00 0.00 0.00 0.00 0.00 5258.88 0.00 0.00 100.10 dm-5 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 dm-6 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 dm-7 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
[root@azitf01 mapper]# ll total 0 crw------- 1 root root 10, 63 Jul 19 18:55 control brw-rw---- 1 root disk 253, 1 Jul 19 18:55 VG00-home brw-rw---- 1 root disk 253, 4 Jul 19 18:55 VG00-opt brw-rw---- 1 root disk 253, 0 Jul 19 18:55 VG00-root brw-rw---- 1 root disk 253, 7 Jul 19 18:55 VG00-SWAP brw-rw---- 1 root disk 253, 6 Jul 19 18:55 VG00-tmp brw-rw---- 1 root disk 253, 5 Jul 19 18:55 VG00-usr brw-rw---- 1 root disk 253, 2 Jul 19 18:55 VG00-var brw-rw---- 1 root disk 253, 3 Jul 19 18:55 VG00-var_tmp
e2fsck -f /dev/VolGroup00/LogVol02
resize2fs /dev/VolGroup00/LogVol02 450G # 450G¤Ë½Ì¾®
lvreduce -L 450G /dev/VolGroup00/LogVol00
lvcreate --size 165.43G --name LogVol03-RAC-test VolGroup00
lvdisplay pvdisplay vgdisplay
[root@testvm61a ~]# swapon -s Filename Type Size Used Priority /dev/dm-1 partition 16097144 0 -1 [root@testvm61a ~]# swapoff -a [root@testvm61a ~]# swapon -s Filename Type Size Used Priority
[root@testvm61a ~]# lvreduce -L 2G /dev/VolGroup00/LogVol01 WARNING: Reducing active logical volume to 2.00 GiB THIS MAY DESTROY YOUR DATA (filesystem etc.) Do you really want to reduce LogVol01? [y/n]: y Reducing logical volume LogVol01 to 2.00 GiB Logical volume LogVol01 successfully resized
[root@testvm61a ~]# lvextend -L +14G /dev/VolGroup00/LogVol00 Extending logical volume LogVol00 to 22.88 GiB Logical volume LogVol00 successfully resized
[root@testvm55a .vnc]# vgdisplay | grep Free Free PE / Size 412 / 12.88 GB [root@testvm55a .vnc]# lvextend -l +100%FREE /dev/VolGroup00/LogVol00 [root@testvm55a .vnc]# vgdisplay | grep Free Free PE / Size 0 / 0
[root@testvm61a ~]# resize2fs /dev/VolGroup00/LogVol00 resize2fs 1.41.12 (17-May-2010) Filesystem at /dev/VolGroup00/LogVol00 is mounted on /; on-line resizing required old desc_blocks = 1, new_desc_blocks = 2 Performing an on-line resize of /dev/VolGroup00/LogVol00 to 5996544 (4k) blocks. The filesystem on /dev/VolGroup00/LogVol00 is now 5996544 blocks long.
[root@vmdb6 testdb]# xfs_growfs /dev/VG_rhel72/LV_root meta-data=/dev/mapper/VG_rhel72-LV_root isize=256 agcount=4, agsize=5464064 blks = sectsz=512 attr=2, projid32bit=1 = crc=0 finobt=0 data = bsize=4096 blocks=21856256, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=0 log =internal bsize=4096 blocks=10672, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 data blocks changed from 21856256 to 35037184
[root@testvm61a ~]# mkswap /dev/VolGroup00/LogVol01 mkswap: /dev/VolGroup00/LogVol01: warning: don't erase bootbits sectors on whole disk. Use -f to force. Setting up swapspace version 1, size = 2097148 KiB no label, UUID=898fa2d1-594e-4607-af0c-c08fecb4566c [root@testvm61a ~]# swapon /dev/VolGroup00/LogVol01 [root@testvm61a ~]# swapon -s Filename Type Size Used Priority /dev/dm-1 partition 2097144 0 -1