swamiforlife Posted January 29, 2020 Share Posted January 29, 2020 Is there an option in Unraid that lets me create a vdisk for a vm that is dynamically expanding? There is a feature like this in Hyper-V. The problem is that disks in Unraid VM's take all the space allocated to them. It would be far more efficient if they can grow dynamically. Quote Link to comment
itimpi Posted January 29, 2020 Share Posted January 29, 2020 6 minutes ago, swamiforlife said: The problem is that disks in Unraid VM's take all the space allocated to them. It would be far more efficient if they can grow dynamically. This is not true! Under Unraid vdisks are allocated as Linux 'sparse' files which means that the physical space occupied is only allocated as writes to them happen and the file is allowed to grow up to its logical size as needed. In fact one of the commoner mistakes is over-committing the physical space and getting the VM to start misbehaving when there is no free space on a drive to grow the vdisk. Quote Link to comment
swamiforlife Posted January 29, 2020 Author Share Posted January 29, 2020 Ok, just so i understand this correctly. For example if i am creating a windows 10 VM and i set the vdisk size to 120GB. Once that VM is created and then i use a tool like Krusader to backup the disk file. I have to copy a 120GB file even though its only using around 30GB. So there must be something that i am doing wrong. Quote Link to comment
itimpi Posted January 29, 2020 Share Posted January 29, 2020 53 minutes ago, swamiforlife said: Ok, just so i understand this correctly. For example if i am creating a windows 10 VM and i set the vdisk size to 120GB. Once that VM is created and then i use a tool like Krusader to backup the disk file. I have to copy a 120GB file even though its only using around 30GB. So there must be something that i am doing wrong. You need to use tools that have the option to copy sparse files keeping them sparse. Standard Linux command line tools like cp and rsync can do this with the appropriate command line options - no idea about whether this is an option in Krusader. Quote Link to comment
JorgeB Posted January 29, 2020 Share Posted January 29, 2020 You can use: cp --sparse=always /path/to/source /path/to/dest Quote Link to comment
swamiforlife Posted January 29, 2020 Author Share Posted January 29, 2020 Ok sorry i wasnt able to explain what i am looking for. When a VM is created and i specify the size of the vdisk to something like 120gb. When unraid creates the disk it should only take up the space used. So if my vm disk is in my cache disk, my cache shows 120gb used. So is there a way that in which i can specify a maximum size for the vdisk like 120gb but it would use only what it really is using? Quote Link to comment
JorgeB Posted January 29, 2020 Share Posted January 29, 2020 1 minute ago, swamiforlife said: When unraid creates the disk it should only take up the space used. That's what happens by default, vdisks are created sparse. Quote Link to comment
glockmane Posted March 22, 2023 Share Posted March 22, 2023 On 1/29/2020 at 5:02 PM, JorgeB said: You can use: cp --sparse=always /path/to/source /path/to/dest Does this mean if I copy without the "sparse" argument it allocates the whole space on the new location without possibility to make it sparse again? Quote Link to comment
JorgeB Posted March 22, 2023 Share Posted March 22, 2023 1 minute ago, glockmane said: without possibility to make it sparse again? If you then re-copy with --sparse-always it will me made sparse again. Quote Link to comment
glockmane Posted March 22, 2023 Share Posted March 22, 2023 28 minutes ago, JorgeB said: If you then re-copy with --sparse-always it will me made sparse again. Ah okay and can I also check if it is sparse or not? Quote Link to comment
JorgeB Posted March 23, 2023 Share Posted March 23, 2023 Should be able with du, don't remember the command, but should not be hard to find with Google. 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.