设为首页 加入收藏

TOP

Linux LVM磁盘分区管理(三)
2023-07-23 13:38:17 】 浏览:89
Tags:Linux LVM 管理
tus available # open 2 LV Size 6.00 GiB Current LE 1536 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 253:1 --- Logical volume --- LV Path /dev/openeuler/root LV Name root VG Name openeuler LV UUID i3ZktA-EN9t-HJB3-y1Ok-Or1X-z0uq-3ixcbG LV Write Access read/write LV Creation host, time O-Friday, 2023-03-05 10:52:54 +0800 LV Status available # open 1 LV Size <92.00 GiB Current LE 23551 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 253:0
12. 删除VG

 If there are no logical volumes associated with the volume group(VG) and if the VG is no longer required, then remove that as well.
     [root@O-Friday ~]# vgchange -an vg01
       0 logical volume(s) in volume group "vg01" now active
     [root@O-Friday ~]# vgdisplay
       --- Volume group ---
       VG Name               vg01
       System ID
       Format                lvm2
       Metadata Areas        2
       Metadata Sequence No  11
       VG Access             read/write
       VG Status             resizable
       MAX LV                0
       Cur LV                0
       Open LV               0
       Max PV                0
       Cur PV                2
       Act PV                2
       VG Size               19.99 GiB
       PE Size               4.00 MiB
       Total PE              5118
       Alloc PE / Size       0 / 0
       Free  PE / Size       5118 / 19.99 GiB
       VG UUID               oAbeGg-j8U2-kCuO-tcmW-HQWv-MqbT-kQdipr
     
       --- Volume group ---
       VG Name               openeuler
       System ID
       Format                lvm2
       Metadata Areas        1
       Metadata Sequence No  3
       VG Access             read/write
       VG Status             resizable
       MAX LV                0
       Cur LV                2
       Open LV               2
       Max PV                0
       Cur PV                1
       Act PV                1
       VG Size               <98.00 GiB
       PE Size               4.00 MiB
       Total PE              25087
       Alloc PE / Size       25087 / <98.00 GiB
       Free  PE / Size       0 / 0
       VG UUID               I7kRIn-4XeX-0agf-OxRq-ehSi-hqJf-nvkmtU
     
     [root@O-Friday ~]# vgremove vg01
       Volume group "vg01" successfully removed
     [root@O-Friday ~]# vgdisplay
       --- Volume group ---
       VG Name               openeuler
       System ID
       Format                lvm2
       Metadata Areas        1
       Metadata Sequence No  3
       VG Access             read/write
       VG Status             resizable
       MAX LV                0
       Cur LV                2
       Open LV               2
       Max PV                0
       Cur PV                1
       Act PV                1
       VG Size               <98.00 GiB
       PE Size               4.00 MiB
       Total PE              25087
       Alloc PE / Size       25087 / <98.00 GiB
       Free  PE / Size       0 / 0
       VG UUID               I7kRIn-4XeX-0agf-OxRq-ehSi-hqJf-nvkmtU
     
13. 删除pv

 Delete physical volumes used for volume group **“vg01”**:
     [root@O-Friday ~]# pvremove /dev/sdb /dev/sdc
       Labels on physical volume "/dev/sdb" successfully wiped.
       Labels on physical volume "/dev/sdc" successfully wiped.
     [root@O-Friday ~]# pvdisplay
       --- Physical volume ---
       PV Name               /dev/sda2
       VG Name               openeuler
       PV Size               <98.00 GiB / not usable 3.00 MiB
       Allocatable           yes (but full)
       PE Size               4.00 MiB
       Total PE              25087
       Free PE               0
       Allocated PE          25087
       PV UUID               Yv3d0c-OjcH-8s93-MsfZ-1JUu-XwU3-NYyPYD
     
14. 缩减逻辑卷大小

 如果已经挂载, 先umount
     [root@O-Friday mapper]# resize2fs /dev/mapper/vg01-lv001 20G
     resize2fs 1.46.4 (18-Aug-2021)
     Please run 'e2fsck -f /dev/mapper/vg01-lv001' first.
     
     [root@O-Friday mapper]# e2fsck -f /dev/mapper/vg01-lv001
     e2fsck 1.46.4 (18-Aug-2021)
     Pass 1: Checking inodes, blocks, and sizes
     Pass 2: Checking directory structure
     Pass 3: Checking directory connectivity
     Pass 4: Checking reference counts
     Pass 5: Checking group summary information
     /dev/mapper/vg01-lv001: 11/1966080 files (0.0% non-contiguous), 167453/7861248 blocks
     [root@O-Friday mapper]# resize2fs /dev/mapper/vg01-lv001 20G
     resize2fs 1.46.4 (18-Aug-2021)
     Resizing the filesystem on /dev/mapper/vg01-lv001 to 5242880 (4k) blocks.
     The filesystem on /dev/mapper/vg01-lv001 is now 5242880 (4k) blocks long.
     
     [root@O-Friday mapper]# lvreduce -L 20G /dev/mapper/vg01-lv001
       WARNING: Reducing active logical volume to 20.
首页 上一页 1 2 3 4 5 6 下一页 尾页 3/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Linux LVS的四种工作模式 下一篇Linux进程通信 | 消息队列

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目