What steps will reproduce the problem?
1. Make VHD disk image 767 MB with Windows 7 diskpart.
VHD footer geometry is H/S = 16/63
2. Create a primary partition with Windows 7 diskpart or disk management and format NTFS.
MBR,PBR geometry is H/S = 255/63
4. Attach VHD to VirtualBox VM as second disk and another disk with grub4dos installed as first disk.
5. Boot VM.
From VirtualBox Log
00:00:00.669 Guest Log: BIOS: ata0-1: PCHS=779/16/63 LCHS=779/32/63
BIOS geometry is H/S = 32/63
6. grub> map --harddrives=2
(write 2 to address 0x475 which has wrong value 1 when in VirtualBox)
7. grub> debug 2
grub> geometry (hd1)
grub> geometry --tune --sync (hd1)
grub> geometry (hd1)
What is the expected output? GRUB4DOS geometry is the same as BIOS int13/AH=8 geometry.
What do you see instead? BIOS int13/AH=8 reports 779/32/63. GRUB4DOS geometry is still unchanged 98/255/63.
--tune fail to detect the correct geometry that BIOS use.
MBR geometry and BIOS geometry can disagree when user move disk between (virtual) machine. I want to add an option of geometry command that user can use to tell GRUB4DOS to use geometry reported by BIOS to update MBR,PBR with --sync.
- patch.diff 12.52KB
Comment #1
Posted on Dec 7, 2010 by Happy Hippothanks.already apply this patch at r68.
Comment #2
Posted on Jan 6, 2011 by Swift CatPrevious patch add geometry --bios option to allow user to force use of BIOS reported geometry.
This patch fix geometry_tune function (called by geometry --tune) that previously return wrong result when number of heads and number of sectors calculated from MBR exceed correct numbers.
- patch.diff 13.98KB
Comment #3
Posted on Jan 7, 2011 by Happy HippoOk,will patch next version.
Status: Fixed
Labels:
Type-Defect
Priority-Medium