Installing Windows and then Linux operating systems on each node ensures that the GRUB is installed as the bootloader. Before continuing, verify that GRUB is able to manually boot both operating systems. Leave the Linux partition as the default. The partition table should appear as follows when finished:
If your partition scheme is different, you can look up the partitions using a partition editor, or by reading GRUB's menu.lst file (usually located at /boot/grub/menu.lst).
![]() |
For sites planning to redeploy frequently, consider installing GRUB to the Linux partition instead of the master boot record (MBR) because Windows overwrites the MBR (every subsequent deployment), which could cause you to lose access to an MBR-based GRUB configuration. |
PXE booting is the recommended dual-boot method, but the following offers instructions for automating dual-boot OS switching using GRUB.
Instructions for automating dual-boot operating system switching assume that you are installing a Linux system that uses the GRand Unified Bootloader (GRUB). Note that you should set up dual-booting only on compute nodes. To automate dual-boot operating system switching, during the Linux installation, manually partition the drive. To do so:
Note which partition number the FAT32 partition is. If it is the third primary partition, it will usually be sda3, or if it is an extended partition, it will be greater than 4. You can look this up using the gparted partitioning utility.
![]() |
After following these steps, there should be two grub.conf files, one at /boot/grub and one at /boot/otheros. The grub.conf file at /boot/otheros should not be a symlink to the grub.conf file at /boot/grub. |
Post Linux Installation Steps for Dual-Boot Setup
> cp /boot/grub/* /boot/otheros
> cd /boot/grub > rm menu.lst > ln -s grub.conf menu.lst
title BOOT REDIRECT: PLEASE WAIT root (hd0,2) configfile /menu.lst boot
Please note that the preceding text should be the first "title" entry in the list of boot options in /boot/grub/grub.conf. Also, make this title the default boot option (i.e. default 0); this will allow you to boot your system to a known partition if anything goes wrong during the boot redirect setup.
Also note that in the preceding sample code, the numeral 2 in the line root (hd0,2) represents the FAT32 partition; you should replace the 2 in that line with your FAT32 partition number.
#Contents of the switchos.pl file (used by Moab to change the OS) #!/usr/bin/perl use strict; use warnings; my $default; my $file; my ($os) = @ARGV; $os = "" unless defined $os; $file = 'menu.lst'; if ( $os eq 'linux' ) { $default = 0; } elsif ( $os eq 'windows' ) { $default = 2; } else { die "Usage: switch.pl <windows|linux>"; } my $menu = <<__END__; # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, e.g.. # root (hd0,5) # kernel /vmlinuz-version ro root=/dev/sda8 # initrd /initrd-version.img #boot=/dev/sda default=$default timeout=5 splashimage=(hd0,5)/grub/splash.xpm.gz hiddenmenu title Red Hat Enterprise Linux AS (2.6.9-42.ELsmp) root (hd0,5) kernel /vmlinuz-2.6.9-42.ELsmp ro root=/dev/sda8 rhgb quiet initrd /initrd-2.6.9-42.ELsmp.img title Red Hat Enterprise Linux AS-up (2.6.9-42.EL) root (hd0,5) kernel /vmlinuz-2.6.9-42.EL ro root=LABEL=/dev/sda8 rhgb quiet initrd /initrd-2.6.9-42.EL.img title Windows HPC 2008 rootnoverify (hd0,0) chainloader +1 __END__ open FILE, ">$file"; print FILE $menu; close FILE;
w: cd \ perl switchos.pl linux
> ./switchos.pl windows > reboot
> perl switchos.pl linux > shutdown /r /t 00 /f
Copyright © 2011 Adaptive Computing Enterprises, Inc.®