How to resize / or root mountpoint without downtime.


OS Version:- Oracle Linux 8.5 


Step1: Determine the group of LVS and mark the current size(logical Volume Group)

[root@ishanu2 dev]# lvs

  LV   VG Attr       LSize   Pool Origin Data%   Meta%  Move Log Cpy%Sync Convert

  root ol -wi-ao---- <65.03g


Step2: look for active PVS (Physical volume group)


[root@ishanu2 dev]# pvs

  PV         VG Fmt  Attr PSize   PFree

  /dev/sda2  ol lvm2 a--  <39.00g    0 ### here it is "ol"



Step3: Format and create partion of the newly added disk.

ls -lrt /dev/sd*

fdisk /dev/sdb

choose option P, press enter, enter, p (to print config) and w (to write changes)

****Note: We are here assigning all the space to 1 partition one may choose as needed.*****


Step 4: Change group of volume group of newly partitioned disk as same as root captured in the Step1.

vgextend /dev/ol /dev/sdb1


step 5: extend the root partition.

lvextend -L +30 /dev/ol/root


Step 6: Update kernel about the new addition by xfs_growfs command.

xfs_growfs /dev/ol/root

Note: here we are considering by default that you are using xfs filesystem, else one may replace the command with logicalgrowfs.

Credits to the video from the youtube channel TechieAnsh.


Comments