Monday, 30 March 2009

Fix the MBR, without Windows' permission, in a linux fashioned way

Il testo completo è disponibile quì:

I tried to install Kubuntu "Jaunty Jackalope" last sunday.

Partitioning worked fine, file were copied without any issue but something went wrong at reboot: GRUB hanged up because of a unintelligible error 18.

I googled a bit and it turned out that it's due to the fact that BIOS detects disks in a different way Linux does.

So what..? *

I was going to try Kubuntu for a couple of good reasons, but my main work - nowadays - is Windows based because of the Visual Studio project related to my graduation thesis.

Therefore, I took my "Windows XP professional SP1" disc, put it into the CD-ROM drive and tried to give a simple "fixmbr" in the recovery console.

- "Error 18".

- "What? You were supposed to boot from CD. Let me check out the BIOS configuration... mmm everything is correct, CD is the first booting device. Let's put the hard disk last, to be sure. Reboot."

- "Error 18".

- "WTF!! Maybe the CD is damaged, let's try an older XP professional CD."

- "Error 18".

- "You kidding! Eat this!! (Windows XP64)"

- "Error 18".

It was going to be a personal thing.

I disconnected all IDE/SATA cables BUT the DVD drive, and rebooted again. This time it was even worse:

- "Nvidia / Intel booting system"

- "What the f*ck!!!"

I began wondering if the DVD drive was damaged or something. I tried Kubuntu and... it booted!! HELL!!!

It's definitively a mistery to me: only linux CDs can boot now on my computer.

Partly reassured by this, I reconnected hard drives and tried to reainstall GRUB. I say "tried to" and not "did" 'cause it didn't work, even with perfect parameters.

So, we reached the point.

How can one fix the master boot record, without using windows' recovery console & GRUB?

Here comes ms-sys package!

But... guess what?! It doesn't come with Kubuntu (anymore)!

And guess again?? It can't be simply apt-got. Why? Guess once again.. It's not in any Ubuntu's repository (anymore)!

And you cannot just compile it from source, because there are dependencies which are even worse than the package itself. Well, it's not a big deal, 'cause you can take the Debian Etch's .deb package and dpkg it.

Then it's a piece of cake:

ms-sys -w /dev/sda

where "sda" is obviously the hard disk we were talking about.

God bless Debian.

* and Miles Davis.