![]() Let’s make the filesystem report the actual size, including extended.įor ext4 filesystem sudo resize2fs /dev/name-of-volume-group/root Your root filesystem will still show the old size. $ sudo lvextend -r -L +20G /dev/name-of-volume-group/root Step 4: Update changes on the filesystem (If you didn’t use -r option in step 3) # Add 20 gigabytes to the current logical volume size Without the + sign the value is taken as an absolute one. If you prefer setting the size to be extended manually, use command option: -L, -size LogicalVolumeSize Logical volume rhel/root successfully resized. Size of logical volume rhel/root changed from <26.93 GiB (6893 extents) to <36.93 GiB (9453 extents). $ sudo lvextend -r -l +100%FREE /dev/mapper/rhel-root Here’s an example of my setup file system extension: $ df -hT | grep mapper -r – Resize underlying filesystem together with the logical volume.-l – extend or set the logical volume size in units of logical extents.With the + sign the value is added to the actual size of the logical volume. This extends the logical volume to use all available capacity in the volume group. ![]() Then resize logical volume used by the root file system using the extended volume group: sudo lvextend -r -l +100%FREE /dev/name-of-volume-group/root $ sudo pvresize /dev/vda2ġ physical volume(s) resized or updated / 0 physical volume(s) not resizedĬheck the size of the volume group configured. └─rhel-swap 253:1 0 2.1G 0 lvm Step 3: Resize root logical volume to occupy all space Replace 2 and /dev/vda with your correct values. In this example we’re extending partition 2 in disk /dev/vda. Now use growpart to extend your partition. ![]() 'on' : fail if sanity checks indicate no support 'force' : try despite sanity checks (fail on failure) This requires kernel support and 'partx -update' u | -update R update the the kernel partition table info after growing N | -dry-run only report what would be done, show new 'sfdisk -d' Less than 'F' bytes, do not resize (default: 1048576) fudge F if part could be resized, but change would be Rewrite partition table so that partition takes up all the space it can Help page can be viewed by passing -h argument $ growpart -h sudo apt install cloud-guest-utilsįor CentOS server, run sudo yum -y install cloud-utils-growpart On Ubuntu / Debian system, run the commands below to install growpart tool. This command is provided by cloud utils package. Install cloud utils package on the systemįor those new to growpart, it is a Linux command line tool used to extend a partition in a partition table to fill available space. The command below will expand the last partition ( Partition 2), as shown by 252:2,on the disk ( /dev/vda) to the maximum size the disk provides. Once the OS block device is resized, ssh to your Linux machine and extend LVM to use newly added disk capacity. If you’re on a different Virtualization platform, refer to its documentation for how to extend OS disk. I use KVM virtualization technology, so this guide works for me: How to extend/increase KVM Virtual Machine (VM) disk size $ lsblk I’ll grow it to 40GB by extending the virtual disk (VM disk device). dev/vda2 rhel lvm2 a- <29.00g 0 Step 2: Extend your OS root diskĪs shown in step 1, my root filesystem is on a 30GB disk. $ lsblkĪs noted, we have a root filesystem on /dev/vda2 physical volume.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |