Reboot the system in Rescue Mode by booting Installation Media
Select Rescue a Oracle Linux system.
Select option 3 - Skip to shell.
Preparing a backup by xfs_dump
~]# lvs --segments -o +devices LV VG Attr #Str Type SSize Devices data_lv data_vg -wi------- 1 linear 10.00g /dev/sdb1(0) log_lv log_vg -wi------- 1 linear 4.99g /dev/sdc1(0) home rhel -wi-a----- 1 linear 26.99g /dev/sda2(512) root rhel -wi-a----- 1 linear 50.00g /dev/sda2(7422) root rhel -wi-a----- 1 linear <5.00g /dev/sdd1(0) swap rhel -wi-a----- 1 linear 2.00g /dev/sda2(0)
~]# vgchange -a y rhel 3 logical volume(s) in volume group "rhel" now active
~]# mkdir /mnt/root ~]# mkdir /mnt/home ~]# mount /dev/rhel/root /mnt/root/ ~]# mount /dev/rhel/home /mnt/home/
~]# xfsdump -f /mnt/home/root.dmp /mnt/root xfsdump: using file dump (drive_simple) strategy xfsdump: version 3.1.7 (dump format 3.0) - type ^C for status and control
Reduce and format root logical volume, restore the root content.
~]# umount /mnt/root
~]# lvreduce -L -5G /dev/rhel/root WARNING: Reducing active and open logical volume to 50.00 GiB. THIS MAY DESTROY YOUR DATA (filesystem etc.) Do you really want to reduce rhel/root? [y/n]: y Size of logical volume rhel/root changed from 55.00 GiB (14080 extents) to 50.00 GiB (12800 extents). Logical volume rhel/root successfully resized.
~]# vgreduce rhel /dev/sdd1 Removed "/dev/sdd1" from volume group "rhel"
~]# pvremove /dev/sdd1 Labels on physical volume "/dev/sdd1" successfully wiped.