Tuesday, November 18, 2008

Fedora 8 dual boot configuration with Windows XP and Acronis OS Selector

I've just been battling through getting an old desktop PC to dual boot Windows XP and Fedora 8. It finally works so I figured I'd write up the details here in case it can be of any use to anyone.

These are the results of trawling a number of fora and blogs to attempt to resolve the issues. This was mostly at Linux Forums TheGrub manual at http://www.gnu.org/software/grub/manual/html_node/ was also very useful.

Note - I'm only going to discuss the specifics of my installation and won't be going off onto tangents that may be required for differing configurations. This is for a couple of reasons; firstly to keep the entry as succinct as possible; secondly to avoid confusion for anyone trying to follow from start to finish. I expect that most people will be aware that they will need to change device names etc to match their specific circumstances.

The existing configuration
  • 3 physical drives
  • Windows XP installed on the first primary partition of the first hard drive
  • Acronis OS Selector installed on the MBR of the first hard drive. By default it invokes NTLDR from the first primary partition on the same drive, booting Windows XP by default.

Desired configuration
  • Use the free space in the third hard drive to install Fedora 8. Leave the existing OS selector in place so do not put grub in the MBR of the first drive.
  • I planned to use a separate /boot partition for the kernel and grub and a Logical Volume (LVM) for the root (/) filesystem.

The process....
  1. Boot the PC from the Fedora 8 DVD
  2. Configure the partitions as follows on the empty hard drive. This was done using the partition editor included in the Anaconda installer

    0-200MB - /boot ext3 filesystem
    201-2000MB - SWAP
    2001-20000MB - / ext3 filesystem
    (LVM device is /dev/VolGroup00/LogVol00)

  3. Install Fedora 8 with the desired packages. My install was approx 1200 packages and took 1.5 hours to complete.
  4. Now, due to the existing boot loader installed on the Windows drive, I chose not to install Grub during the initial installation. I now believe this was a mistake as it was a pain to figure out exactly what needed copying across to the boot partition in order to support Grub properly.

    I would advise installing Grub as part of the initial install, but making sure to choose to install it to the Linux /boot partition rather than the MBR of the first drive in the system
  5. Due to the issue in 4 above, I was unable to boot Linux by default....so....
  6. Reboot the machine with the installation/rescue CD in the drive.
  7. Select the option to rescue an existing installation. (I attempted to 'upgrade' an existing installation to copy the boot loader configuration but that failed).
  8. Follow the prompts to set up keyboard, nework and language settings.
  9. When the system is booted, it will detect the Linux installation and mount it under /mnt/sysimage. We need to access it as the root image soexecute the following command
    chroot /mnt/sysimage
  10. We now need to copy the Grub image files across to the boot partition
    mkdir /boot/grub
    cp /usr/share/grub/i386-redhat/*stage* /boot/grub

    This copies the boot loader files (stage1, stage2 and the various stage1.5 files) to the boot partition.
  11. Access the grub command line interface by executing the following command
    grub
  12. We need to determine the root location from where Grub will boot Linux. So (from within the Grub command line) we execute
    grub> find /grub/stage1
    NOTE - We do not specify /boot/grub/stage1 as we have a dedicated boot partition, so relative to the partition, the grub directory is in the root of the partition.

    Also note that the 'grub> ' is the Grub command line prompt not part of the command to be entered

    This will tell us the name (in Grub parlance) of the partition. In my case this was (hd2,0) which as expected is the first partition (0) of the third hard drive (hd2).
  13. Now we have confirmed this, we need to install the Grub bootloader into the partition. From the Grub command line exexcute
    grub> setup (hd2,0)
    This will install Grub into the boot sector of the partition
  14. We now need to create the Grub configuration file which is used by Grub to boot the various operating systems. Using a text editor create a file named grub.conf in /boot/grub/. Below is the content of my file
    default=0
    timeout=10
    splashimage=(hd2,0)/grub/splash.xpm.gz

    title Fedora Core 8 - (2.6.23.1-42.fc8)
    root (hd2,0)
    kernel /vmlinuz-2.6.23.1-42.fc8 ro root=/dev/VolGroup00/LogVol00 rhgb
    initrd /initrd-2.6.23.1-42.fc8.img

    NOTE - The vmlinuz and initrd entries are not prefixed by /boot. This is due to the fact that we have a dedicated /boot partition and these are relative to the root directory of that partition.

    Also note the device name for the root partition becuase we are using a logical volume for the root partition
  15. This should be all the configuration that is required to boot Linux from within Grub. However, it wasn't possible for me to successfully test this in isolation. If I attempted to run grub from within the rescue environment and boot Fedora from the new config file I received errors regarding inconsistent filesystem types (Grub error 16). I believe this may be due to the resuce environment not loading all necessary drivers (perhaps for logical volumes) but I haven't confirmed this.

    So, in order to test I had to configure Acronis OS Selector to chain into Grub.
  16. Reboot, without the Fedora installation DVD in the drive. Acronis OS Selector should boot as normal as it still exists in the MBR of the first drive.
  17. From Tools --> OS Selector add a new operating system by locating the partition containing Grub. Acronis OS Selector should detect the Linux boot loader if pointed at the correct partition.
  18. Choose to boot the Linux OS. Acronis will chain into Grub. You should be presented with the Grub menu with the boot options specified earlier (Fedora 8 only in this case).
  19. Choose to boot Fedora 8. It should boot successfully. The rhgb option we specified to the kernel parameters will use the graphical boot process for Fedora.

I hope that makes sense. I will add screenshots and tidy up the formatting shortly and answer any questions that people may have.

Monday, January 7, 2008

No sooner do you learn one new trick...

...then someone comes along and trumps it.

Chet Haase has blogged on the new animation features in the SceneGraph project being created at https://scenegraph.dev.java.net/. A new and improved version of the Timing Framework...and just as I thought I'd mastered the previous incarnation.

Well, they say you can't stop progress...

Here's the link to Chet's blog entry