May 14th, 2007
I noticed today that my example subdomain, where my online code examples are (currently only my YUI example) served from was down. Probably since my server upgrade. Oh well, for anyone who cares, it’s back online now.
May 13th, 2007
If you have ever mistakenly installed grub (or any other boot manager) onto the MBR of the wrong drive (usually during setting up additional multi-boot OSs), you’ll know it can be a pain to get rid of. Most sources out there are for when you accidentally override the windows boot manager with an common *nix one (grub or lilo). This involves using the windows "repair" console on the CD.
When you are running a pure linux system, this isn’t a useful option. This is the solution I found to wipe and re-install grub:
This will probably need to be done from a live CD, as if your MBR is broken, you probably can’t boot your installed system.
-
Wipe the MBR
The first 446 bytes of the drive make up the Master Boot Record, the next 66 (totalling 512) is partition information, you probably don’t want to wipe that unless you intend of re-partitioning (and/or formatting) your disk anyway.
Use `dd` to "zero" those 446 bytes:
dd if=/dev/zero of=/dev/hd? ds=446 count=1
-
Chroot into your installed system
Set up and `chroot` into your main OS
mkdir -p /mnt/root
mount /dev/hd? /mnt/root
mount -t proc none /mnt/root/proc
mount -o bind /dev /mnt/root/dev
chroot /mnt/root /bin/bash
-
Reinstall grub in the correct MBR
Start the `grub` console
grub
then, at the grub prompt:
find /grub/stage1
root (hd?,?)
setup (hd?)
If you "boot" is not on a seperate partition, you the first line might need to be
find /boot/grub/stage1
Assuming your configuration is correct (i.e doesn’t need to be changed since before it broke) you should now be able to boot into your installed system again.