2020.08.04
1. 디스트 현환 조회
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 111.8G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 110.6G 0 part
├─centos-root 253:0 0 50G 0 lvm /
└─centos-swap 253:1 0 15.6G 0 lvm
…
# lvscan
WARNING: Device for PV WW1CSe-5oqs-KdaW-aaGk-3E0J-PAit-6Lpnww not found or rejected by a filter.
Couldn't find device with uuid WW1CSe-5oqs-KdaW-aaGk-3E0J-PAit-6Lpnww.
ACTIVE '/dev/centos/swap' [15.62 GiB] inherit
inactive '/dev/centos/home' [510.91 GiB] inherit
ACTIVE '/dev/centos/root' [50.00 GiB] inherit
#
2. LV 삭제
# lvremove /dev/centos/home
Logical volume "home" successfully removed
#
3. unkown VG 삭제
--removemissing
Removes all missing physical volumes from the volume group, if there are no logical volumes allocated on those.
# pvs
WARNING: Device for PV Uyiq5J-nZkw-4bsO-n2tD-pJTn-hi7u-njDvcY not found or rejected by a filter.
Couldn't find device with uuid Uyiq5J-nZkw-4bsO-n2tD-pJTn-hi7u-njDvcY.
PV VG Fmt Attr PSize PFree
/dev/sda3 centos lvm2 a-- <110.59g 44.96g
[unknown] centos lvm2 a-m <465.76g <465.76g
#
# vgreduce --removemissing centos
WARNING: Device for PV Uyiq5J-nZkw-4bsO-n2tD-pJTn-hi7u-njDvcY not found or rejected by a filter.
Couldn't find device with uuid Uyiq5J-nZkw-4bsO-n2tD-pJTn-hi7u-njDvcY.
Wrote out consistent volume group centos.
#
# pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 centos lvm2 a-- <110.59g 44.96g
#
4. LV 사이즈 확장
# lvextend -L +44G /dev/centos/root
Size of logical volume centos/root changed from 50.14 GiB (12836 extents) to 90.14 GiB (23076 extents).
Logical volume centos/root successfully resized.
#
# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root centos -wi-ao---- 90.14g
swap centos -wi-a----- 15.62g
#
5. xfs 파일 시스템 확장
# xfs_growfs /dev/centos/root
meta-data=/dev/mapper/centos-root isize=512 agcount=4, agsize=3276800 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=13107200, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=6400, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 13107200 to 23629824
#
# df -h | egrep "File|centos-root"
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 91G 43G 48G 47% /
#
'Linux' 카테고리의 다른 글
NTP(Network Time Protocol) 설정 (0) | 2021.11.30 |
---|---|
LVM (Logical Volume Manager) (0) | 2021.11.10 |
댓글