EasyBCD, Grub2, ext4 and apt-get safe overwrite

#1
I dual boot my computer into Windows 7 and Ubuntu 10.04 using EasyBCD 2.0 and Grub2. Since I'm affected by the infamous try hd(0,0) ext2 bug (it may have something to do with ext4 extents feature), I can't boot Grub2 directly with NeoGrub. So as a workaround I use the legacy option which simply chainloads a copy of my Linux partition Grub2 PBR. I.e. I installed Grub2 into Linux partition boot record and then use Grub (legacy) instead of Grub2 option. It worked great. One day I installed an update to Grub2 via apt-get and a few days later (not right away) it stopped working, simply hanging when I chose Ubuntu from Windows Boot Manager. I recreated my BCD entry (it started working again) and compared the new PBR snapshot with the old one using hex editor. Of course the hardcoded /boot/grub/core.img offset changed. But why did it still work for a couple of days and suddenly stopped? Strange, but I think I guess what's happening behind the scenes. Apt (for safety reasons) uses a overwrite scheme that creates a new temporary file, then deletes the old file and changes the new file's name to the old one. Apt updated Linux PBR to reflect the changes but the snapshot was not updated unitl I did so manually. The old file contents were intact for some time, so BCD was happy. When suddenly some process requested that free space, the stange problem apeeared.

Hope this hepls someone.
 

mqudsi

Mostly Harmless
Staff member
#2
Hi jonie, welcome to NeoSmart Technologies.

Thanks for sharing that info with us. I've been working on finding a solution to the "try (hdx,y)" problem for a while now, but haven't had any luck.