Master Boot Record (MBR) fix for laptop ubuntu broke!
Kubuntu installer killed my dell laptop the other day. As Dell still don't include any diagnostic tools in the firmware I was stuck. The C drive on this laptop had been setup by Dell with MS-Windows XP, but I couldn't even use the MS recovery console as it only allows access to the C Drive after entering the administrator password.. and as you all know, Dell don't setup an administrator account/password any more. Dell diagnostic tools are installed on the hard-drive.. which could not be booted..! Clever eh Dell?
As I had the Kubuntu live install CD I booted up that again. For some reason they have not included typical recovery commands on the CD though. I could have used the LILO command to write a working MBR back to the drive with this command:
/sbin/lilo -M - write a Master Boot Record on a device
I found a better fix from some kind sole on ##windows IRC channel. Install the "mbr" package, and then run the command:
install-mbr /dev/sda
Which will write a default MBR similar to the one LILO produces I expect, which will boot the first active partition. Of cause this only works if you can setup a network connection, and get access to the ubuntu repositories to issue apt-get install mbr. Why not include these as standard ubuntu guys? Especially when the installer is breaking Dell laptops like mine!
Backup your boot sector
You can back up your bootsector, and then restore it should you need to.
To backup the whole MBR and partition table run:
dd if=/dev/sda of=backup_mbr.dat bs=512 count=1Of that 512 bytes, only the first 448 bytes is the boot code, the remaining 64 bytes is the partition table of the drive.
To just restore the MBR boot bytes run:
dd if=backup_mbr.dat of=/dev/sda bs=1 count=448My MBR backup could be useful to someone.
Be very careful running these commands, as you could make your boot problems worse!
Also there is a great package called Smart Boot Manager on sourceforge, it's got it's own little boot menu (screengrab) and gives a choice of which partition to boot from. Developer is looking for a new maintainer, so get in touch with him if you're interested!
Labels: GNU-Linux
2 Comments:
I think it's almost a shame that you blame Ubuntu and Dell for this problem. The Ubuntu installation was probobly not mainly built to be compiled on an external harddrive. But ey it should work, but it doesn't sometimes. But the main think is when you start blaming dell, wtf do they have to do with it. The laptop came with windows installed, and you were not supposed to install linux on it. That's not their fault that you werent careful and knowing enough to start installing other stuff. And even if this hadn't "broken" you're precious laptop. You would still not be able to boot windows without configuring grub by yourself. So stop blaming other people when you use stuff the way they aren't supposed to be used!
Thanks for the comment. I would have still been able to boot Windows had GRUB worked sensibly like LILO does for the first stage of boot, instead of just dying when the 1st stage fails to load the 2nd!
Ubuntu is available on removable media like USB drives, so it definitely is expected to work on such systems, it's just the installer that has a bug. I wonder if it will be fixed any time soon though?
Post a Comment
<< Home