Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Resize (grow) a .img file

Featured Replies

Hi,

I have managed to grow a .qcow2 file succesfully, but cannot make it with the default .img file that is created when using the built-in functionality in Unraid to create vm´s.

I used to type this command...and this is what I get:

root@Tower:/mnt/vm# qemu-img resize vdisk1.img +60G
WARNING: Image format was not specified for 'vdisk1.img' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
Image resized.

I am running v6.0.1.

Hope someone can help.

Hi,

I have managed to grow a .qcow2 file succesfully, but cannot make it with the default .img file that is created when using the built-in functionality in Unraid to create vm´s.

I used to type this command...and this is what I get:

root@Tower:/mnt/vm# qemu-img resize vdisk1.img +60G
WARNING: Image format was not specified for 'vdisk1.img' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
Image resized.

I am running v6.0.1.

Hope someone can help.

Since the error message implies you need to specify you need to give the format for raw images in the parameters have you tried the command

 qemu-img resize -fmt raw vdisk1.img +60G

  • Author

Hi, thx for trying. This is waht I get:

root@Tower:/mnt/vm# qemu-img resize -fmt raw vdisk1.img +60G
qemu-img: Expecting one image file name
Try 'qemu-img --help' for more information

Any other idea?

Hi, thx for trying. This is waht I get:

root@Tower:/mnt/vm# qemu-img resize -fmt raw vdisk1.img +60G
qemu-img: Expecting one image file name
Try 'qemu-img --help' for more information

Any other idea?

Looking at the help from qemu-img it does not seem to have any option on the resize mode to specify a format.  All I can think is that you convert the raw format to some other one that can be resized, resize that, and then convert back. 

 

It may be possible to resize a raw image using the Linux 'truncate' command to extend the file, but I am not sure.

  • Author

Jonp, I love kvm vodoo magic. I am not an expert in linux, but I love this!

I have been posting before that I could not grow (resize) my .img created by unraid (using the tool to create vm´s in VM menu).

Just a couple of minutes ago, I checked again my .img using "qemu-img info" and I could not believe it:

root@Tower:/mnt/vm# qemu-img info vdisk1.img
image: vdisk1.img
file format: raw
virtual size: 100G (107374182400 bytes)
disk size: 17G

My original .img of 40G did actually grow to 100G!

How did this happen?

Based on previous fighting with kvm for months (while creating my vm´s) I always backup my command line inputs in putty, so this is what I found out.

I did again grow my .img +20G ... so here again vodoo magic was happening:

root@Tower:/mnt/vm# qemu-img info vdisk1.img
image: vdisk1.img
file format: raw
virtual size: 100G (107374182400 bytes)
disk size: 17G
root@Tower:/mnt/vm# qemu-img resize vdisk1.img +20G
WARNING: Image format was not specified for 'vdisk1.img' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
Image resized.
root@Tower:/mnt/vm# qemu-img info vdisk1.img
image: vdisk1.img
file format: raw
virtual size: 120G (128849018880 bytes)
disk size: 17G

Thx all for support.

I wish I was rich and could play more with kvm  8)

Hope this help others.

Rgds.

 

 

  • 2 years later...

I'm not sure if anyone is still reading this, but just by increasing the size of the vm, that data doesn't get allocated, if I'm right. Anyone know how to allocate data on ubuntu server? (Only using command line)

  • 2 months later...
On 11/21/2017 at 8:25 PM, busa1 said:

I'm not sure if anyone is still reading this, but just by increasing the size of the vm, that data doesn't get allocated, if I'm right. Anyone know how to allocate data on ubuntu server? (Only using command line)

You should be able to use gparted to do that.  Always best to have a backup first.

I am facing the same issue at the moment... I increased the Filesystem with Unraid Webinterface but it is not allocated. I tried running gparted on my UbuntuServer VM without success. Any suggestions how I can extend the filesystem?

sss.png

Edited by dweb

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.