CentOS 8’de ROOT volume’unu genişletme

CentOS dosya sistemi XFS olduğundan resize2fs komutu işe yaramıyor. Bu nedenle /home alanı shrink edildikten sonra boşa çıkan alanı ROOT’a aktarmak gerekiyor. Bunu şöyle yapıyoruz;

1- backup the contents of /home

tar -czvf /root/home.tgz -C /home

2- test the backup

tar -tvf /root/home.tgz

3- unmount home

umount /dev/mapper/centos-home

4- remove the home logical volume

lvremove /dev/mapper/centos-home

5- recreate a new 400GB logical volume for /home, format and mount it

lvcreate -L 400GB -n home centos
mkfs.xfs /dev/centos/home
mount /dev/mapper/centos-home

6- extend your /root volume with ALL of the remaining space and resize (-r) the file system while doing so

lvextend -r -l +100%FREE /dev/mapper/centos-root

7- restore your backup

tar -xzvf /root/home.tgz -C /home

8- check /etc/fstab for any mapping of /home volume. IF it is using UUID you should update the UUID portion. (Since we created a new volume, UUID has changed)

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir