Warning: The is a more technical post. You have been warned.
Ever try and dual boot Windows 7 and Linux?
Here is the back story. I bought a Compaq Netbook. It came with windows 7, which was all fine and good until you want to do anything fun (ie using BackTrack 4 to pen test your wifi). So I used Unetbootin and created a BackTrack 4 live cd, then used their install script to create partitions and install Backtrack. This all went great. I p0wned some WEP, bla bla bla. So yesterday I am at a conference and I think to my self, “I should use Win 7.” Just at MS Bing’s Directory was stepping up to deliver his Keynote, the fail began.
Windows 7 apparently freaks out when it sees Grub and offers to help.

Then it pulls a suicide bomb maneuver where it reinstalls itself, deleting everything along with your GRUB (the dual boot lintch pin). So wanting my dualbootness back I re-up GRUB buy booting with a Live CD and doing the following:
find /boot/grub/stage1
- It tells you (hdx,y)
root (hdx,y)
setup (hdx)
And WERE BACK… to Windows not working… F…
So I investigate:
The problem is partially Windows and partially Grub. Windows 7 splits its boot loading across two partitions. So when GRUB says, “Windows 7 Partition GO!”, Windows thinks it’s files are missing and reverts to fail. So persevered through A) the desire to gratuitously slander MS for not playing nice with others, B) millions of restarts and C) metric shit tons of not so helpful forums and blogs. So what is the answer?
First we need to understand what partitions I had happening:
load up Linux and “fdisk -l”
/dev/sda1 (hd0,0) This is essentially windows “c” drive
/dev/sda2 (hd0,1) Not really sure
/dev/sda3 (hd0,2) The Win “Recovery” drive (Its A Lie… the Recovery part)
/dev/sda4 (hd0,3) Again labeled “System” but not sure
/dev/sda5 (hd0,4) BackTrack 4
/dev/sda6 (hd0,5) BackTrack 4 Swap
As I said ealier Winsuck 7′s bootloader is a little spread out, so you have to do some workaround crazyness. Your normal Windows GRUB entry would look like this:
root (hd0,4)
savedefault
makeactive
chainloader +1
Note: I have a partitioned drive so everything is on hd0. hd0,x x would be the partitions.
For Windows to boot you need to map the “c:” and the “Recovery” partitions together.
map (hd0,0) (hd0,3)
map (hd0,3) (hd0,0)
rootnoverify (hd0,3)
chainloader +1
More Notes: I used “rootnoverify” but you might be able to use just “root”.
Once that was set up, the problem was solved. I now have a dual booting system using GRUB and booting to BackTrack 4 and Windows 7. Some people might tell you that you have to wipe you drive, reinstall windows then use windows to configure the partitions, obviously they are wrong. I still might shitcan Win 7 for Ubuntu, you never know.




