PTA - How to expand volume group /dev/mapper/rhel-root
Objective
When installing RedHat Enterprise Linux through the Anaconda installer to prepare a minimal installation, where automatic partitioning/storage configuration were chosen, the 500 GB disk will be partitioned with only ~70 GB to the root volume group and mount point (under /), and the rest will be allocated to a separate "home" volume group and mount point (under /home).
This impacts the system because the volume group "root" (dev/mapper/rhel-root) is the '/' directory, whereas the volume group "home" (/dev/mapper/rhel-home) is the '/home' directory, thus the entire filesystem except /home/ only has 70G of space available, a small fraction of the PTA disk requirement of 500G
Environment
10.0;10.1;10.2;10.3;10.4;10.5;10.6;10.7;10.8;10.9;10.10;11.1;11;11.2;11.3;11.4;11.5;11.6;11.7;14.0;14.2;14.4 Privileged Access Manager (PAM, self-hosted) PTA
Procedure
---You MUST be root to perform the below steps---
1. Check the current disk status to ensure dev/mapper/rhel-root and a separate volume group rhel-home exists:
df -h
Example:
[root@ptaserver /]# df -h Filesystem Size Used Avail Use% Mounted on
devtmpfs 4.0M 0 4.0M 0% /dev
tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs 3.2G 9.1M 3.2G 1% /run
efivarfs 256K 56K 196K 23% /sys/firmware/efi/efivars
/dev/mapper/rhel-root 70G 1.9G 69G 3% /
/dev/nvme0n1p2 960M 193M 768M 21% /boot
/dev/nvme0n1p1 599M 7.1M 592M 2% /boot/efi
/dev/mapper/rhel-home 421G 3.0G 418G 1% /home
tmpfs 1.6G 0 1.6G 0% /run/user/0
lvs
[root@ptaserver /]# lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
home rhel -wi-ao---- 420.55g
root rhel -wi-ao---- 70.00g
swap rhel -wi-ao---- <7.86g.
2. Stop PTA services (if installed)
service appmgr stop
3. Copy everything from the home directory out
cp -a /home /home2
4. Unmount the volume
umount /dev/mapper/rhel-home
5. Delete the home logical volume
lvremove /dev/mapper/rhel-home
Example:
[root@ptaserver /]# lvremove /dev/mapper/rhel-home Do you really want to remove active logical volume rhel/home? [y/n]: y Logical volume "home" successfully removed
6. Extend the root logical volume to take up the rest of the space
lvextend -l +100%FREE /dev/mapper/rhel-root (lvextend -l +100%FREE /dev/mapper/rhel-root)
Example:
[root@ptaserver /]# lvextend -l +100%FREE /dev/mapper/rhel-root Size of logical volume rhel/root changed from 70.00 GiB (17920 extents) to 481.12 GiB (125582 extents). Logical volume rhel/root successfully resized.
7. Extend the xfs partition
xfs_growfs /dev/mapper/rhel-root
Example:
[root@ptaserver /]# xfs_growfs /dev/mapper/rhel-root meta-data=/dev/mapper/rhel-root isize=512 agcount=4, agsize=3276800 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=0 spinodes=0 data = bsize=4096 blocks=183500080, 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 18350080 to 128595968
8. Check that /dev/mapper/rhel-root (/dev/mapper/rhel-root) has been increased in size and that the volume group /dev/mapper/rhel-home (/dev/mapper/rhel-home) has been removed
df -h
Example:
[root@ptaserver /]# df -h Filesystem Size Used Avail Use% Mounted on
devtmpfs 4.0M 0 4.0M 0% /dev
tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs 3.2G 9.1M 3.2G 1% /run
efivarfs 256K 56K 196K 23% /sys/firmware/efi/efivars
/dev/mapper/rhel-root 491G 4.8G 486G 1% /
/dev/nvme0n1p2 960M 193M 768M 21% /boot
/dev/nvme0n1p1 599M 7.1M 592M 2% /boot/efi
tmpfs 1.6G 0 1.6G 0% /run/user/0
lvs
[root@ptaserver /]# lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root rhel -wi-ao---- 490.55g
swap rhel -wi-ao---- <7.86g.
9. Move the home directory data back and remove the temporary home2 directory
mv /home2/* /home/
rmdir /home2
10. Remove the /dev/mapper/cl-home (lvremove /dev/mapper/centos-home) entry from /etc/fstab
vi /etc/fstab
DELETE the line:
/dev/mapper/rhel-home /home xfs defaults 0 0
11. Start PTA
service appmgr start
12. Run Diagnostics to ensure PTA is functioning again:
RUN_DIAGNOSTICS