[Fixed] Error creating virtual disk (non-aligned size)? (#18177)

This is for discussing general topics about how to use VirtualBox.
Post Reply
Marinbox
Posts: 15
Joined: 11. Dec 2018, 20:52

[Fixed] Error creating virtual disk (non-aligned size)? (#18177)

Post by Marinbox »


ModEdit; related ticket: #18177: GUI: Create new disk should round to sector size (divisible by 512)
I try to create a new virtual disk in Linux and after selecting the size 127.87 MB it informs me of the following error:

Code: Select all

VD: The given disk size 134077632 is not aligned on a sector boundary (512 bytes) (VERR_VD_INVALID_SIZE)
As I can understand the size I selected is not correctly aligned for sectors with a size of 512 bytes. I am right?

What is the formula to calculate an aligned size for sectors of 512 bytes?

Do all partitions (including those of physical disks) have to be aligned by calculating the sector size of 512 bytes? Why?
Last edited by socratis on 13. Dec 2018, 17:19, edited 1 time in total.
Reason: Marked as [Fixed].
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Error creating virtual disk (non-aligned size)?

Post by socratis »

Marinbox wrote:after selecting the size 127.87 MB
How did you select it? From the GUI?
Marinbox wrote:What is the formula to calculate an aligned size for sectors of 512 bytes?
It's evenly divisible with 512. Yours isn't: 134077632 / 512 = 261870.375, not an integer, not evenly divisible.

In your case you could have gone with 134077440 bytes (261870 sectors * 512) or 134077952 bytes (261871 sectors * 512).
Marinbox wrote:Do all partitions (including those of physical disks) have to be aligned by calculating the sector size of 512 bytes? Why?
Not necessarily. There are even sectors of 4 KB that are met on normal, home systems. See Disk sector in Wikipedia for more info...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Marinbox
Posts: 15
Joined: 11. Dec 2018, 20:52

Re: Error creating virtual disk (non-aligned size)?

Post by Marinbox »

socratis wrote:How did you select it? From the GUI?

Yes, from the GUI.

Thanks, now I understand better how the alignment is calculated.

Although from the GUI does not allow inserting the size in bytes (I have not tried from the command line) and inserting for example 134.06 MB is not accepted either.

Using 0 as decimals, I accept it well: 134.00 MB.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Error creating virtual disk (non-aligned size)?

Post by socratis »

Hmm, that's not... optimal. The GUI should round up the selection to the closest 512 byte size, not leave it with something decimal that's going to fail. I'm opening a ticket about this.

UPDATE:
Ticket opened: #18177: GUI: Create new disk should round to sector size (divisible by 512).
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Marinbox
Posts: 15
Joined: 11. Dec 2018, 20:52

Re: Error creating virtual disk (non-aligned size)?

Post by Marinbox »

socratis wrote:Hmm, that's not... optimal. The GUI should round up the selection to the closest 512 byte size, not leave it with something decimal that's going to fail. I'm opening a ticket about this.
Thank you very much for your concern. After you said the ticket, I checked if it had the latest version installed and had the 5.1.XX (I think it's the official repository of Ubuntu 16.04), I realized it was outdated and I decided to update to see if the error was in the latest version.

When testing the creation of new units using the latest version downloaded from the official page, the units are created without problems from the GUI. Therefore it works perfectly.

Thanks for everything!

P.D: For the next one before asking, I check if I have the latest version installed.
Last edited by Marinbox on 12. Dec 2018, 03:46, edited 1 time in total.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Error creating virtual disk (non-aligned size)? (#18177)

Post by socratis »

Marinbox wrote:the units are created without problems from the GUI. Therefore it works perfectly.
I would never create a ticket blindly, without actually testing it. And I did test it with today's 6.0.0 RC1 r127414, which showed that the "problem" is still alive and kicking. Just put the value that I tested it with on the ticket, 27.87 GB. See if it works...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Marinbox
Posts: 15
Joined: 11. Dec 2018, 20:52

Re: Error creating virtual disk (non-aligned size)? (#18177)

Post by Marinbox »

I just tried it and you are right. When entering a value manually and incorrectly, it continues with the same problem. However, in this version, selecting the size from the slider works perfectly.

Thanks for opening the ticket.
Last edited by socratis on 12. Dec 2018, 03:47, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
Whiskeyjack
Oracle Corporation
Posts: 122
Joined: 28. Aug 2017, 13:14

Re: Error creating virtual disk (non-aligned size)? (#18177)

Post by Whiskeyjack »

The problem with the manual entered size (thru the line edit) has been corrected. The fix will be in available in the next release.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Error creating virtual disk (non-aligned size)? (#18177)

Post by socratis »

Thanks Whiskeyjack. Marking as [Fixed].
That was really fast!!! ;)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Marinbox
Posts: 15
Joined: 11. Dec 2018, 20:52

Re: [Fixed] Error creating virtual disk (non-aligned size)? (#18177)

Post by Marinbox »

Whiskeyjack: In the name of all those who use VirtualBox, I want to thank you for the speed with which this problem has been solved.

Thanks for thinking about the user.
Post Reply