Arcaeus Posted November 15, 2023 Share Posted November 15, 2023 (edited) Hello, I have PiHole running in a small Ubuntu VM on my Unraid server (6.12.4) and have run out of space on the root vdisk. As I was watching the SpaceInvaderOne video that was in the guides section of the forum, after he showed how to increase the disk size in the Unraid GUI, he talked about extending the partition (although his video showed Windows). I looked up a guide on how to do it in Linux, but it shows that I would have to unmount the disk first. Since this is the root disk that the OS and everything is running off of, I can't unmount it, and I can't change anything if the VM is shut down of course. So, how would I go about increasing the partition size? Or clone this disk to a larger one? Edited November 15, 2023 by Arcaeus Quote Link to comment
Kilrah Posted November 15, 2023 Share Posted November 15, 2023 gparted can resize a running system when it's to grow it, just not for shrinking. That said you've used lvm, that might make things more difficult. Quote Link to comment
Solution Arcaeus Posted November 15, 2023 Author Solution Share Posted November 15, 2023 (edited) Ok, figured it out. Here is what worked for me: Shutdown VM Adjust capacity in Unraid GUI VM page. Download gparted, move iso to desired location, and set gparted iso as primary boot disk. Boot into gparted iso and Extend vdisk to include new space. Apply and shutdown. Swap back to original vdisk as primary boot drive. Boot up VM SSH into VM (I use Moba) List disks and storage: df -h List file system size lsblk Since this should be lvm, run lvextend: lvextend -l +100%FREE <logical volume> Mine specifically was: lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv Resize the file system so it can use all of that space. resize2fs <file system path> Mine was resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv "df -h" now shows correct size: Message shows that disk has been resized successfully, which shows in "lsblk" again. Edited November 15, 2023 by Arcaeus Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.