Jump to content

Expand size of Ubuntu VM vdisk


bondoo0

Recommended Posts

I need to expand the size of my ubuntu vdisk.  I saw a few posts about expanding the size in the GUI, and I've been able to do that, but I'm not sure how to make the space available (saw a mention of booting to GRUB).  I tried going into GRUB, going to the command line and using gparted, but it won't start in the NoVNC session (get a no display error), so I was hoping someone would be able to guide me into making more space available to my VM.  I'm running Unraid 6.2, and Ubuntu Server 16.04 LTS if that matters.

Link to comment

I actually found a way that ended up working (at least for me) without having to change the vm's settings (other than increasing the size in the unraid GUI. 

 

I installed parted to expand the usage to the new size (for some reason I had to display the partition info, then "fix" it to see the whole space available, instead of just being able to use fdisk), then used fdisk (deleted existing partition, created a new one), then since it's an LVM partition, I then used pvresize/lvextend to increase the size of the lvm partition's physical and logical volumes, and finally used resize2fs to expand the file system to the newly available space.

 

So in the end I was able to expand the size from 15G to 25G with no data loss (and without having to rebuild my plex db).

Link to comment
  • 4 years later...
On 9/26/2016 at 12:22 PM, jonathanm said:

Temporarily change your boot image for that VM to a bootable gparted iso, or any of the live linux cd's that include gparted.

 

How does one go about doing this?  I changed my Vms "os install iso" to the gprated iso but it just boots into ubuntu

Link to comment
1 minute ago, 007craft said:

 

How does one go about doing this?  I changed my Vms "os install iso" to the gprated iso but it just boots into ubuntu

You may need to manually change the XML, the boot order may not work properly from the GUI.

 

I recommend not doing that though, it's easier to define a new VM with Gparted and temporarily assign the vdisk to the new VM. Even better, set up a whole VM with all your normal disk manipulation and recovery tools, then assign whichever vdisk you need to operate on as a second vdisk to that VM.

 

Think of it like setting up a whole other computer to repair or operate on a physical disk vs. booting a live cd in the target machine.

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...