How to extend /root partition?
during the system installation i set the /root partition to 20Gig .
now after more updates and software installation this size become very low.
i have more space in other partitions like /home and other partitions .
now the questions is :
How to extend /root partition?
and how can i change the path for the installation of any new software?
thank you!!
Responses
If its a logical volume and you have unpartitioned space available in the same or other hard drive you can extend the volume.
df -h or lvdisplay
command will help you find if its a logical volume. Below link can help to extend the volume. Make sure to take a backup before you try.
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/lv_extend.html
Hi, did you try if the latest parted will work on 7.4 ? as my customer has 7.4 and his / partition need to be extended, though it is lvm I still need to do it from rescue mode I guess if parted online resize option only starts from 7.5. Any comment will be greatly appreciated
thanks
you can already do this without parted. Edit the partition table with your favorite tool and then use partx to reread partition table to kernel. You need to be careful with not messing up the partitions though.
after the partition table is re-read you can grow lvm/filesystems.
Note: this only works if you can create free space after the partition you want to grow or if you have lvm you can create a new pv and attach that.
Thanks Klass, I thought I can not do it without going to rescue mode. But I found a an article which evident we can resize root / partition with its existing PV completely online. I beleive it is possible RHEL 7 onwards.
Hi Mushfiqur,
It is generally not recommended to work on disks, partitions or volumes from within a running system. Even if it
is possible, things may break badly - better boot from a "live medium" like GParted to perform the operations. :)
Regards,
Christian
Noted.. I havent tried Gparted before, so probably need to give it a go on my test machine. Thanks Christian!
Maybe you want expand root partition ?
No problem. Its possible you can do that. But need backup. and if you take some problem its your problem.
(You need find some article in google about how to expand partition. )
You need first its new LUN - disk. (which size ? if you have Lun less size 2Tb you need gdisk if more in size 2Tb you need gdisk )
Then
fdisk -l /dev/newdisk
fdisk -c /dev/newdisk
n
p
t - 8e
p
you can see new gpart table
w. And you can see /dev/newdisk1
pvcreate /dev/newdisk1
vgextend your vg_name /dev/newdisk1
lvextend -l +100%FREE /dev/mapper/vg_name_lv_name
if you have ext4
resize2fs -p /dev/mapper/vg_name_lv_name
or
xfs_growfs /dev/mapper/vg_name_lv_name
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
