Opened 10 years ago
Closed 10 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
- Download test.vhd and attach to Windows as unformatted hard disk
- Make a grub4dos USB FLash drive (e.g. using RMPrepUSB to format it and install grub4dos)
- Install DavidB's Virtual Machine VMUB utility
- Create VBOX VM with SATA controller and no attached disks
- Add VM to DavidB's VMUB so that disk 0 = USB drive and disk 1 = Virtual disk
- Add Last.g4b file to USB drive
- Boot to USB drive using VMUB - should get grub4dos console (\grldr should be present)
hd0 will be USB drive, hd1 will be vhd disk
- 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)
Change History (18)
by , 10 years ago
comment:1 by , 10 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 , 10 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 , 10 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 , 10 years ago
Also, could you please post VBox.log from the VM exhibiting the failure?
comment:5 by , 10 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 , 10 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 , 10 years ago
Sorry, what is an OVA and how do I make one? Is there a URL that would describe this?
comment:8 by , 10 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.
comment:9 by , 10 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 , 10 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 , 10 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 , 10 years ago
Summary: | Last sectors in VHD (or real disk) attached using .vmdk not returned correctly if SATA controller → 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.
grub4dos batch file last.g4b to display last sector