20
Июн
0

Изменение размера LVM раздела в CentOS

Имеем.
[root@server /]# pvs
File descriptor 7 (pipe:[27791]) leaked on pvs invocation. Parent PID 4878: bash
PV VG Fmt Attr PSize PFree
/dev/sda2 vg_ss lvm2 a— 931,02g 0
[root@server /]# vgs
File descriptor 7 (pipe:[27791]) leaked on vgs invocation. Parent PID 4878: bash
VG #PV #LV #SN Attr VSize VFree
vg_ss 1 3 0 wz—n- 931,02g 0
[root@server /]# lvs
File descriptor 7 (pipe:[27791]) leaked on lvs invocation. Parent PID 4878: bash
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert
lv_home vg_ss -wi-ao— 873,49g
lv_root vg_ss -wi-ao— 50,00g
lv_swap vg_ss -wi-ao— 7,53g
Необходимо увеличить или уменьшить размер раздела lv_home vg_ss -wi-ao— 873,49g, к примеру уменьшить на 500G. Cоответственно -L -500G или -L +500G.
[root@ss /]# lvreduce -r -L -500G /dev/mapper/lv_home

File descriptor 7 (pipe:[27791]) leaked on lvreduce invocation. Parent PID 4878: bash
Path required for Logical Volume «lv_home»
Please provide a volume group name
Run `lvreduce —help’ for more information.

Опция -r это изменение размера и файловой системы без потери данных.

[root@ss /]# lvreduce -r -L -500G /dev/vg_ss/lv_home
File descriptor 7 (pipe:[27791]) leaked on lvreduce invocation. Parent PID 4878: bash
Do you want to unmount "/home"? [Y|n] y
fsck from util-linux-ng 2.17.2
/dev/mapper/vg_ss-lv_home: 17126/57245696 files (0.4% non-contiguous), 11537886/228979712 blocks
resize2fs 1.41.12 (17-May-2010)
Resizing the filesystem on /dev/mapper/vg_ss-lv_home to 97907712 (4k) blocks.
The filesystem on /dev/mapper/vg_ss-lv_home is now 97907712 blocks long.

Reducing logical volume lv_home to 373,49 GiB
Logical volume lv_home successfully resized

Для проверки — lvs

Enjoyed reading this post?
Subscribe to the RSS feed and have all new posts delivered straight to you.

Comments are closed.

Celadon theme by the Themes Boutique