m78:extend-your-lvm
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| m78:extend-your-lvm [2026/01/06 20:05] – media78adm | m78:extend-your-lvm [2026/01/06 20:27] (current) – media78adm | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| Once that is done, you may need to get Linux to rescan the disk for the new free space. Check for free space by running cfdisk and see if there is free space listed, use “q” to exit once you’re done.\\ | Once that is done, you may need to get Linux to rescan the disk for the new free space. Check for free space by running cfdisk and see if there is free space listed, use “q” to exit once you’re done.\\ | ||
| - | {{|Linux increase disk size space cfdisk}} | + | {{ : |
| If you don’t see free space listed, then initiate a rescan of / | If you don’t see free space listed, then initiate a rescan of / | ||
| - | {{|Linux free partition space scan}} | + | {{ : |
| Select your /dev/sda3 partition from the list and then select “Resize” from the bottom menu. Hit ENTER and it will prompt you to confirm the new size. Hit ENTER again and you will now see the /dev/sda3 partition with a new larger size.\\ | Select your /dev/sda3 partition from the list and then select “Resize” from the bottom menu. Hit ENTER and it will prompt you to confirm the new size. Hit ENTER again and you will now see the /dev/sda3 partition with a new larger size.\\ | ||
| Line 17: | Line 17: | ||
| Now that the LVM partition backing the /dev/sda3 Physical Volume (PV) has been extended, we need to extend the PV itself. Run pvresize /dev/sda3 to do this and then use pvdisplay to check the new size.\\ | Now that the LVM partition backing the /dev/sda3 Physical Volume (PV) has been extended, we need to extend the PV itself. Run pvresize /dev/sda3 to do this and then use pvdisplay to check the new size.\\ | ||
| - | {{|Ubuntu extend physical volume pvresize}} | + | {{ : |
| As you can see above, my PV has been increased from 98.5GB to 198.5GB. Now let’s check the Volume Group (VG) free space with vgdisplay.\\ | As you can see above, my PV has been increased from 98.5GB to 198.5GB. Now let’s check the Volume Group (VG) free space with vgdisplay.\\ | ||
| - | {{|Ubuntu LVM: check vg space vgdisplay}} | + | {{ : |
| We can see above that the VG has 100GB of free space. Now let’s check the size of our upstream Logical Volume (LV) using lvdisplay, extend the LV to use up all the VG’s free space with lvextend -l +100%FREE / | We can see above that the VG has 100GB of free space. Now let’s check the size of our upstream Logical Volume (LV) using lvdisplay, extend the LV to use up all the VG’s free space with lvextend -l +100%FREE / | ||
| - | {{|Ubuntu LVM: check LV size lvdisplay}} | + | {{ : |
| At this point, the block volume underpinning our root filesystem has been extended, but the filesystem itself has not been resized to fit that new volume. To do this, run df -h to check the current size of the file system, then run resize2fs / | At this point, the block volume underpinning our root filesystem has been extended, but the filesystem itself has not been resized to fit that new volume. To do this, run df -h to check the current size of the file system, then run resize2fs / | ||
| - | {{|Ubuntu LVM: extend filesystem resize2fs|| | + | {{ : |
| And there you go. You’ve now taken an expanded physical (or virtual) disk and moved that free space all the way up through the LVM abstraction layers to be used by your (critically full) root file system. Time to check it off the to-do list and move on to the next IT emergency.\\ | And there you go. You’ve now taken an expanded physical (or virtual) disk and moved that free space all the way up through the LVM abstraction layers to be used by your (critically full) root file system. Time to check it off the to-do list and move on to the next IT emergency.\\ | ||
m78/extend-your-lvm.1767729957.txt.gz · Last modified: by media78adm
