Linux lvreduce命令:减小逻辑卷大小。
Linux lvreduce命令 功能描述
使用lvreduce命令可以减少逻辑卷的大小。当减小逻辑卷的大小时要特别小心,因为减少了的部分数据会丢失。
Linux lvreduce命令 语法
lvreduce [选项] [逻辑卷名称|逻辑卷路径]
命令中各选项的含义如表所示。
Linux lvreduce命令 示例
减少卷组vg1中的逻辑卷lv1的大小,减少3个逻辑盘区
[root@rhel ~]# lvreduce -l -3 vg1/lv1
WARNING: Reducing active logical volume to 99.99 GiB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lv1? [y/n]: y //输入y确认减小逻辑卷的大小
Reducing logical volume lv1 to 99.99 GiB
Logical volume lv1 successfully resized
将逻辑卷lv1的大小减少到140GB
[root@rhel ~]# lvreduce -L 140G /dev/vg1/lv1
WARNING: Reducing active logical volume to 140.00 GiB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lv1? [y/n]: y //输入y确认减小逻辑卷的大小
Reducing logical volume lv1 to 140.00 GiB
Logical volume lv1 successfully resized
将逻辑卷lv1的大小减少10GB
[root@rhel ~]# lvreduce -L -10G /dev/vg1/lv1
WARNING: Reducing active logical volume to 130.00 GiB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lv1? [y/n]: y //输入y确认减小逻辑卷的大小
Reducing logical volume lv1 to 130.00 GiB
Logical volume lv1 successfully resized