VirtualBox

Ticket #14021 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

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

Reported by: SteveSi Owned by:
Priority: major 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

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

Change History

Changed 3 years ago by SteveSi

grub4dos batch file last.g4b to display last sector

Changed 3 years ago by SteveSi

tes.vhd

comment:1 Changed 3 years ago by SteveSi

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 Changed 3 years ago by SteveSi

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 Changed 3 years ago by michaln

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 Changed 3 years ago by michaln

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

Changed 3 years ago by SteveSi

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

comment:5 Changed 3 years ago by SteveSi

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 Changed 3 years ago by michaln

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 Changed 3 years ago by SteveSi

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

comment:8 Changed 3 years ago by michaln

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.

Changed 3 years ago by SteveSi

test_VHD OVA

comment:9 Changed 3 years ago by SteveSi

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 Changed 3 years ago by michaln

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 Changed 3 years ago by SteveSi

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 Changed 3 years ago by michaln

  • Summary changed from Last sectors in VHD (or real disk) attached using .vmdk not returned correctly if SATA controller to Last 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 Changed 3 years ago by frank

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

comment:14 Changed 2 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed

Fix is part of VBox 5.0.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use