VirtualBox

Opened 9 years ago

Closed 9 years ago

#14021 closed defect (fixed)

Last sectors not read correctly if SATA/SCSI controller used => Fixed in SVN

Reported by: SteveSi Owned by:
Component: other Version: VirtualBox 4.3.26
Keywords: Cc:
Guest type: other Host type: Windows

Description

  1. Download test.vhd and attach to Windows as unformatted hard disk
  2. Make a grub4dos USB FLash drive (e.g. using RMPrepUSB to format it and install grub4dos)
  3. Install DavidB's Virtual Machine VMUB utility
  4. Create VBOX VM with SATA controller and no attached disks
  5. Add VM to DavidB's VMUB so that disk 0 = USB drive and disk 1 = Virtual disk
  6. Add Last.g4b file to USB drive
  7. Boot to USB drive using VMUB - should get grub4dos console (\grldr should be present)

hd0 will be USB drive, hd1 will be vhd disk

  1. run /Last.g4b batch file

if get 30h 30h 30h etc, then it was successful and no problem as last sector has 30's

I get all 00's = WRONG SECTOR

See http://reboot.pro/topic/18736-virtual-machine-usb-boot/page-7#entry191819 for more details and test.vhd download

If attach .vhd device to an IDE controller in the VM then this works OK and get 30's returned.

Attachments (4)

Last.g4b (732 bytes ) - added by SteveSi 9 years ago.
grub4dos batch file last.g4b to display last sector
Test 2 GB vhd.7z (278.7 KB ) - added by SteveSi 9 years ago.
tes.vhd
VBox.zip (19.1 KB ) - added by SteveSi 9 years ago.
Vbox log for SAS with 2GB Test.VHD attached as disk 1
Test_VHD.ova (438.0 KB ) - added by SteveSi 9 years ago.
test_VHD OVA

Download all attachments as: .zip

Change History (18)

by SteveSi, 9 years ago

Attachment: Last.g4b added

grub4dos batch file last.g4b to display last sector

by SteveSi, 9 years ago

Attachment: Test 2 GB vhd.7z added

tes.vhd

comment:1 by SteveSi, 9 years ago

Please note: This is nothing to do with VMUB or USB booting. The diagnostic steps are just a way to show that accessing sectors via grub4dos + VBox BIOS is buggy if a disk is attached to a SATA controller in the VM.

comment:2 by SteveSi, 9 years ago

SCSI and SAS controllers also show same issue as SATA

Additional bug Also SAS BIOS returns last sector as LBA=3FFFFE

i.e. BIOS call int 13h AH=48h Total Sectors = 0x3FFFFF (should be 0x400000)

IDE, SATA and SCSI return last sector as LBA=3FFFFF (Total sectors = 0x400000 = correct)

comment:3 by michaln, 9 years ago

The problem with SAS/SCSI disks reporting their capacity as one sector smaller was fixed in svn. However, I'm afraid I don't have the time to put together the test VM according to the recipe. Could you please export the complete test VM as OVA and attach it here, since you have it already? I'm assuming that it's not that big; if it's too big to attach, we'll figure out some alternative channel.

comment:4 by michaln, 9 years ago

Also, could you please post VBox.log from the VM exhibiting the failure?

by SteveSi, 9 years ago

Attachment: VBox.zip added

Vbox log for SAS with 2GB Test.VHD attached as disk 1

comment:5 by SteveSi, 9 years ago

Log for SAS Last Sector read added I ran Easy2Boot first, then dropped to grub4dos console to run Last.g4b

Disk 0 = USB drive Disk 1 = Test 2GB VHD Disk 2 = odd 10MB vdi (not relevant)

comment:6 by michaln, 9 years ago

Thanks for the log file... although unfortunately there was no additional clue in it :( Now could you please provide an OVA which has everything on it to reproduce the problem? I don't really have more time to spend on this.

comment:7 by SteveSi, 9 years ago

Sorry, what is an OVA and how do I make one? Is there a URL that would describe this?

comment:8 by michaln, 9 years ago

Ah, sorry :) You just need to "Export Appliance" from VirtualBox. As long as everything is on non-removable media, that's all I need. I think that is the case here.

by SteveSi, 9 years ago

Attachment: Test_VHD.ova added

test_VHD OVA

comment:9 by SteveSi, 9 years ago

Test OVA added This is simplified to just one VHD. If you change the controller to an IDE controller it works If you use SATA, SCSI or SAS it does not. SAS also returns wrong disk size. HTH Steve

comment:10 by michaln, 9 years ago

Thanks, I can reproduce the problem now. The initial report was slightly misleading/incomplete... the problem isn't reading the last sector, the problem is attempting to read 127 sectors starting about 2 sectors before the end of the disk.

comment:11 by SteveSi, 9 years ago

grub4dos may read 127 sectors at a time internally even though only 1 sector was requested (though I thought it only did that for NTFS volumes)??? It works OK using an IDE controller.

comment:12 by michaln, 9 years ago

Summary: Last sectors in VHD (or real disk) attached using .vmdk not returned correctly if SATA controllerLast sectors not read correctly if SATA/SCSI controller used => Fixed in SVN

The bugs are fixed in svn and the changes will most likely show up in the next 4.3 maintenance update. The fixes will also be included in the next 5.0 beta (which will highly likely be released sooner).

The behavior will be still slightly different with ATA vs. the others; ATA transfers as many sectors as it can, while SATA/SCSI fail outright and don't transfer anything. GRUB seems to be able to handle either case.

And yes, GRUB definitely tries to read 127 sectors, not just for NTFS. Why it does that I don't know, but it shouldn't matter.

comment:13 by Frank Mehnert, 9 years ago

Fix is NOT part of VBox 4.3.28 but part of VBox 5.0 Beta 3.

comment:14 by Frank Mehnert, 9 years ago

Resolution: fixed
Status: newclosed

Fix is part of VBox 5.0.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use