« Take That! WinXPpro Installer | Main | 64bit Dual-head 3D »
March 9, 2005
Rescue Mode, grub-install & udev
Fedora Core 3 is the first release from Red Hat that uses udev for managing the /dev filesystem. This new system offers some great advantages. I will be posting a new GuruGuide soon, introducing the basics of udev configuration.
However, this post is not about udev, per se.
I recently installed WindowsXP Professional on my notebook as part of a dual-boot configuration. There were issues getting Windows to install originally so I ended up installing Linux first, which is not how I usually do things. In this case, I was heading out of town the next day and needed Linux with me on that notebook.
After finally working out the issues with Windows, the only thing I needed to do to complete my dual-boot configuration was to get GRUB reinstalled to the Master Boot Record (MBR) on the hard drive. This way, GRUB comes along first and I can select Linux or Windows from it's menu.
One way to install GRUB to the MBR when the MBR has been clobbered (like happens when installing Windows, though Windows does not use the MBR in order to boot) is to boot using a Linux CD that provides a so-called "rescue" environment (sometimes referred to as a "LiveCD"). From there, you simply mount your hard drives partitions, chroot into the path where you mounted the hard drive and run the grub-install program.
So, I placed the Fedora Core 3 CD1 into the DVD drive on the notebook and booted up. At the CD's "boot:" prompt, I typed:
boot: linux rescue
Once the rescue environment was up and running, I typed:
# chroot /mnt/sysimage
# grub-install /dev/hda
Nothing happened; it just sat there, never reporting any errors. As it was about midnight last night when this happened, I went to bed and took another crack when I arrived at the office the next morning. The same thing, again.
I tried using a RHEL4 CD1 rescue environment, as well as RHEL3 & FC1 (all of which I had handy). Same problem. Then it dawned on me: udev. Device nodes for the hard drive do not exist in the chroot'ed environment. From the chroot'ed environment, I next ran:
# mknod /dev/hda b 3 0
# grub-install /dev/hda
This produced an error message telling me that grub-install could not find /dev/hda1, which it needed in order to finish setting things up. I created the appropriate device node and tried once more:
# mknod /dev/hda1 b 3 1
# grub-install /dev/hda
It worked! It is probably a good idea to delete the device nodes just created, before rebooting:
# rm /dev/hda*
After rebooting, GRUB did it's job and I can now boot to either Linux or Windows whenever I want.
Posted by lamontp at March 9, 2005 8:06 PM