need to expand Vdisk for ubuntu server VM - help pls


Ystebad

Recommended Posts

I'm not great in either linux or unraid, so there's that....

 

Made a linux VM and it has a 25G primary partition/disk.

 

Downloading chia blockchain and it's all full and giving errors.

 

I expanded the vdisk in the unraid GUI to 100G.

 

within ubuntu VM I ran parted and tried resizepart (ran as sudo) but it says "Error: The location 50000 is outside of the device" 

 

Can you not expand partition of the VM as it's running from within linux?  That seems silly.  Not sure what I'm doing wrong.

 

Here's what I see in parted (after increasing size to 100GB in unraid):

(parted) print
Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 26.0GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number  Start  End     Size    File system  Flags
 1      0.00B  26.0GB  26.0GB  ext4
 

 

Link to comment
On 10/11/2021 at 2:12 PM, Ystebad said:

I'm not great in either linux or unraid, so there's that....

 

Made a linux VM and it has a 25G primary partition/disk.

 

Downloading chia blockchain and it's all full and giving errors.

 

I expanded the vdisk in the unraid GUI to 100G.

 

within ubuntu VM I ran parted and tried resizepart (ran as sudo) but it says "Error: The location 50000 is outside of the device" 

 

Can you not expand partition of the VM as it's running from within linux?  That seems silly.  Not sure what I'm doing wrong.

 

Here's what I see in parted (after increasing size to 100GB in unraid):

(parted) print
Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 26.0GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number  Start  End     Size    File system  Flags
 1      0.00B  26.0GB  26.0GB  ext4
 

 

Download gparted live iso and add that iso to the vm you are using, boot from it (either change the boot order in the vm settings or in the vm bios).

You will boot into the gparted live iso and you could resize the partitions you want.

I just used the gparted live iso to:

- convert mbr to gpt

- create a bios_grub partition to boot legacy bios + gpt

- create an efi partition to migrate from legacy bios to uefi

- move efi partition from "right" to "left"

- resize (increase) the ext4 partition from 50 GB to 150 GB

 

gparted is very easy to use, it has a nice gui.

 

I don't know if there is any difference, but I prefer to use qemu-img to increase the disk size:

qemu-img resize path/to/raw/img/vdisk.img +100G

 

Will increase the size of a raw img by +100GB

 

Make a backup first!playing with partitions can destroy all your data.

Edited by ghost82
  • Thanks 1
Link to comment
1 hour ago, ghost82 said:

Download gparted live iso and add that iso to the vm you are using, boot from it (either change the boot order in the vm settings or in the vm bios).

You will boot into the gparted live iso and you could resize the partitions you want.

I just used the gparted live iso to:

- convert mbr to gpt

- create a bios_grub partition to boot legacy bios + gpt

- create an efi partition to migrate from legacy bios to uefi

- move efi partition from "right" to "left"

- resize (increase) the ext4 partition from 50 GB to 150 GB

 

gparted is very easy to use, it has a nice gui.

 

I don't know if there is any difference, but I prefer to use qemu-img to increase the disk size:

qemu-img resize path/to/raw/img/vdisk.img +100G

 

Will increase the size of a raw img by +100GB

 

Make a backup first!playing with partitions can destroy all your data.

Instead of mucking about with trying to force a VM to boot to a iso image, I find it easier to set up a stripped down VM with gparted and all the other fun tools, and temporarily add the target vdisk as a second disk to the utilities VM. That way there is no need to modify anything with the original VM, just remember to remove the vdisk from the utility VM before starting it up again.

Link to comment
6 minutes ago, JonathanM said:

Instead of mucking about with trying to force a VM to boot to a iso image, I find it easier to set up a stripped down VM with gparted and all the other fun tools, and temporarily add the target vdisk as a second disk to the utilities VM. That way there is no need to modify anything with the original VM, just remember to remove the vdisk from the utility VM before starting it up again.

That is a great idea - not exactly sure how to add the original vm disk to the "stripped" vm though.  

Link to comment
  • 1 year later...
On 10/15/2021 at 12:10 AM, JonathanM said:

Instead of mucking about with trying to force a VM to boot to a iso image, I find it easier to set up a stripped down VM with gparted and all the other fun tools, and temporarily add the target vdisk as a second disk to the utilities VM. That way there is no need to modify anything with the original VM, just remember to remove the vdisk from the utility VM before starting it up again.

Great advice. My debian vm storage was full and can't display desktop gui after login.
As I already have a debian testing VM in place, I just installed gparted, stop the problematic vm, run gparted to extend the debian partition (I need to delete the existing swap partition first before extending because it was placed between the main partition and the additional storage) and create a new swap partition at the end of the enlarged storage; then everything is now working smoothly as usual. First reboot on the larger storage took longer time because it seems to check or initial something extra on the expanded disk.

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.