SpaceInvaderOne Posted May 13, 2017 Share Posted May 13, 2017 Hi, Guys. This is a short Video about how to resize a Vdisk in unRAID. I am sure most people know how to expand a Vdisk but this guide will also show you how to shrink a vdisk should you need to. I hope you find it interesting How to Resize Vdisks. Expand or shrink a Vdisk in unRAID 2 2 Quote Link to comment
SpaceInvaderOne Posted May 14, 2017 Author Share Posted May 14, 2017 18 hours ago, 1812 said: solid. thanks 1812 Quote Link to comment
1812 Posted May 14, 2017 Share Posted May 14, 2017 3 hours ago, gridrunner said: thanks 1812 no, THANK YOU. I feel that for about 1/4-1/3 of my posts on here, I end up sending people a link to one of your vids. So much easier than explaining it myself (or when I don't know how to do it myself!) Quote Link to comment
witalit Posted May 1, 2018 Share Posted May 1, 2018 Great video as always, I would like to resize a Linux VM. Seems this might be a lot harder ? Quote Link to comment
steve1977 Posted February 16, 2019 Share Posted February 16, 2019 Thanks @SpaceInvaderOne for the guide. I just tried to shrink my Windows VM from 120G to 60G. Something is not working. I followed all steps and reduced the VM disk size. It shows correctly in Unraid in both "capacity" and "allocation" with the new 60G. Also, good news is that I can start the VM. So far so good. If I access "computer management", it still shows the higher amount of 120G (55G as my disk and 65G as unassigned). Any thoughts? Quote Link to comment
JonathanM Posted February 16, 2019 Share Posted February 16, 2019 3 hours ago, steve1977 said: If I access "computer management", it still shows the higher amount of 120G (55G as my disk and 65G as unassigned). Any thoughts? Sometimes windows gets stuck thinking nothing has changed. Try making a small change in disk management to force windows to reread the partition table. Something like add a 1GB extended partition or something. 1 Quote Link to comment
steve1977 Posted February 16, 2019 Share Posted February 16, 2019 Thanks, this solved it. Quote Link to comment
WexfordStyle Posted October 26, 2019 Share Posted October 26, 2019 (edited) Unfortunately, this video doesn't consider the case where windows has placed some random partition to the right side of your main partition. From what I can tell, when this happens you cant extend (its greyed out) the volume to your newly added space. At the time of writing, I haven't figured out how to get around this... Edited October 26, 2019 by WexfordStyle Quote Link to comment
JonathanM Posted October 26, 2019 Share Posted October 26, 2019 58 minutes ago, WexfordStyle said: Unfortunately, this video doesn't consider the case where windows has placed some random partition to the right side of your main partition. From what I can tell, when this happens you cant extend (its greyed out) the volume to your newly added space. At the time of writing, I haven't figured out how to get around this... Download a live iso of gparted. Set that iso as boot for the VM. Run gparted, move and expand partitions around as needed, reboot, done. Quote Link to comment
WexfordStyle Posted October 26, 2019 Share Posted October 26, 2019 1 hour ago, jonathanm said: Download a live iso of gparted. Set that iso as boot for the VM. Run gparted, move and expand partitions around as needed, reboot, done. Thanks for the reply @jonathanm. I did try gparted but I was to lazy to try and get it to work. I ended up downloading some shady piece of software which allowed me to get rid of the random windows partition in the way (risky probably?). Anyway it ended up working. On a less positive note, China is probably using my VM in a botnet right now. 🤦♂️ Quote Link to comment
iHoller Posted November 7, 2019 Share Posted November 7, 2019 One of my HDD is a 5TB drive, and I had a 4tb vDisk on it. The drive only had 45GB left, so after Shrinking the vDisk to 2TB, the drive still only has 45gb free space, what have I done wrong? Quote Link to comment
tll002 Posted January 10, 2020 Share Posted January 10, 2020 (edited) How would I shrink the vdisk of a linux (ubuntu) VM? Edited January 10, 2020 by tll002 Quote Link to comment
JonathanM Posted January 12, 2020 Share Posted January 12, 2020 On 1/10/2020 at 6:06 PM, tll002 said: How would I shrink the vdisk of a linux (ubuntu) VM? Depends on a bunch of variables. In a nutshell, you have to get the data inside the vdisk to give up the extra space it has allocated, then shrink the container vdisk. The vdisks are by default sparse, which introduces yet another variable. It's not a simple thing with a short answer, it's probably easier to make a backup of just the data inside the vdisk and create a new vdisk of the size you want and restore your data there. Quote Link to comment
Dalen Posted January 26, 2020 Share Posted January 26, 2020 Hi all, How do we modify the size with unraid 6.8.1? I cannot find the option anywhere. Many thanks. Quote Link to comment
thedudezor Posted March 21, 2020 Share Posted March 21, 2020 Hello everyone. Just started running unraid and have everything mostly setup now. I've made a few errors along the way, but one of them I'd like to see if I can get some help finding a solution to so I don't end up having to reinstall my main OS VM (Linux Mint) again now that I have everything mostly the way I want it. I first started off saving VM's to the cache drive not thinking this was a issue (learned that one fast when mover ran...), so I then migrated that disk over and used the unassigned plugin to keep my fastest drive (1TB nvme) off the array to be ONLY used for VM's... Well when I set that up, I wrongly partitioned the entire 1TB for the Linux VM, not thinking ahead. I would like to now re-partition that drive, but you can not do this while the VM is running. I have gparted live ISO file in my ISO's share and assign it as the OS install image, but I can not seem to figure out how to boot from that image. It just keeps booting into Mint. I've tried pressing DELETE, F1 and F2 (most seem to agree it should be F1 based on what I am reading) during the slash screen. What am I doing wrong here? I'm running Unraid Version 6.9.0-beta1 2020-03-06 VM Bios selected is i440fx-4.2 Quote Link to comment
aspiziri Posted March 31, 2020 Share Posted March 31, 2020 On 1/26/2020 at 12:15 PM, Dalen said: Hi all, How do we modify the size with unraid 6.8.1? I cannot find the option anywhere. Many thanks. I've got the same issue on 6.8.3. Did we lose the ability to change vdisk size with the 6.8 upgrade? Quote Link to comment
aspiziri Posted March 31, 2020 Share Posted March 31, 2020 Update on my issue: It does appear the setting is no longer available on the edit VM page but it can be changed. You need to do it from the VM list. Click on the name of the VM in the list and it will expand to show more details. From this additional details is where you can edit the vdisk size. 1 Quote Link to comment
Lunch Posted April 17, 2021 Share Posted April 17, 2021 Hi all I'm on 6.9.1 and I've been able to follow(to reduce windows VM size) up until the SSH section where when I enter the qemu as per video it detects 'raw' and will not let me proceed(in spaceinvaders video there is a shorter similar earning but then says image resized....I don't have that and am pulling my hair out trying to workout what I need to do exactly to fix this...I can't for the life of me google the correct searches to elevate the coding to approve this. Thank you to anyone who can solve this for me! Quote Link to comment
Reggie997 Posted May 2, 2021 Share Posted May 2, 2021 (edited) Can someone confirm that this still works for shrinking a VM disk?? I've tried qemu-img resize Server_2016.img 30G to which I get WARNING: Image format was not specified for 'Server_2016.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. qemu-img: Use the --shrink option to perform a shrink operation. qemu-img: warning: Shrinking an image will delete all data beyond the shrunken image's end. Before performing such an operation, make sure there is no important data there. Would someone be able to help, cause I have no idea what I'm doing when It comes to Linux commands xD???? I'm using Unraid version 6.9.2 Edited May 2, 2021 by Reggie997 Quote Link to comment
Lunch Posted May 2, 2021 Share Posted May 2, 2021 I got lost on this last month too for the same error. Trawled online for guides and couldn't find any relevant information so I'd love to know too!! Quote Link to comment
Reggie997 Posted May 2, 2021 Share Posted May 2, 2021 15 hours ago, Reggie997 said: Can someone confirm that this still works for shrinking a VM disk?? I've tried qemu-img resize Server_2016.img 30G to which I get WARNING: Image format was not specified for 'Server_2016.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. qemu-img: Use the --shrink option to perform a shrink operation. qemu-img: warning: Shrinking an image will delete all data beyond the shrunken image's end. Before performing such an operation, make sure there is no important data there. Would someone be able to help, cause I have no idea what I'm doing when It comes to Linux commands xD???? I'm using Unraid version 6.9.2 15 hours ago, Lunch said: I got lost on this last month too for the same error. Trawled online for guides and couldn't find any relevant information so I'd love to know too!! Ok so i figured it out thanks to this post on the forum: What I needed to do was add --shrink in between "qemu-img resize" and the .img you whish to change. So I needed to do "qemu-img resize --shrink Server_2016.img 30G" of course the .img name will be different from what I have as that is the name my VM. 3 Quote Link to comment
Knight2339 Posted January 24, 2022 Share Posted January 24, 2022 (edited) I am really struggling with reducing my vdisk size from 500gb too 240gb.. I have already done the volume shrink inside of the vm and shut it down. whenever i try too connect with the ssh part (putty, nothing mentioned in the video about which terminal spaceinvader is using) too resize the vdisc i get too the password entering part and the terminal stops accepting any other keyboard inputs other than enter so i cannot enter my password....... is this doable from unraids own terminal? if so how/what commands do i need please? Edited January 24, 2022 by Knight2339 Quote Link to comment
nextadmin Posted August 11, 2023 Share Posted August 11, 2023 Hello, nice explantation for qemu resizing, but bad syntax. qemu-img resize vdisk1.img 500G like in the video will not work, triggering a warning like: 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. better use qemu-img resize -f raw vdisk1.img 500G Quote Link to comment
LeeNeighoff Posted February 26 Share Posted February 26 (edited) I'm having some trouble shrinking my Ubuntu Server 22.04 vdisk from 200 GiB to 40 GiB. I booted into a live distro, used GParted to shrink the primary partition to 30 GiB (to expand up to 40 later), and confirmed there are no partitions after it. Booted back into Ubuntu and it worked perfectly. Shut it back down and made a backup. Resized the .img file with qemu-img to 40G, and now suddenly it will no longer boot. It gives up waiting for the root filesystem to become available. Since I had a backup, I tried multiple different variations of the command, to no avail: qemu-resize --shrink vdisk1.img 40G qemu-resize --shrink vdisk1.img 199G qemu-resize --shrink -f raw vdisk1.img 40G qemu-resize --shrink -f raw vdisk1.img 199G Am I missing a critical step for Ubuntu/Linux that isn't required for shrinking a Windows vdisk? Thanks in advance. Edited February 26 by LeeNeighoff 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.