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

This is for discussing general topics about how to use VirtualBox.

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

Postby Marinbox » 11. Dec 2018, 21:53


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   Expand viewCollapse view
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].
Marinbox
 
Posts: 15
Joined: 11. Dec 2018, 20:52

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

Postby socratis » 11. Dec 2018, 22:46

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...
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
socratis
Site Moderator
 
Posts: 23768
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

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

Postby Marinbox » 12. Dec 2018, 02:10

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.
Marinbox
 
Posts: 15
Joined: 11. Dec 2018, 20:52

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

Postby socratis » 12. Dec 2018, 02:39

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).
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
socratis
Site Moderator
 
Posts: 23768
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

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

Postby Marinbox » 12. Dec 2018, 03:28

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.
Marinbox
 
Posts: 15
Joined: 11. Dec 2018, 20:52

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

Postby socratis » 12. Dec 2018, 03:32

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...
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
socratis
Site Moderator
 
Posts: 23768
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

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

Postby Marinbox » 12. Dec 2018, 03:45

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.
Marinbox
 
Posts: 15
Joined: 11. Dec 2018, 20:52

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

Postby Whiskeyjack » 13. Dec 2018, 13:27

The problem with the manual entered size (thru the line edit) has been corrected. The fix will be in available in the next release.
Whiskeyjack
Oracle Corporation
 
Posts: 28
Joined: 28. Aug 2017, 13:14

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

Postby socratis » 13. Dec 2018, 17:19

Thanks Whiskeyjack. Marking as [Fixed].
That was really fast!!! ;)
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
socratis
Site Moderator
 
Posts: 23768
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

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

Postby Marinbox » 13. Dec 2018, 19:52

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.
Marinbox
 
Posts: 15
Joined: 11. Dec 2018, 20:52


Return to Using VirtualBox

Who is online

Users browsing this forum: Majestic-12 [Bot] and 14 guests