HOW TO CREATE A DUAL BOOT (Windows + Rocks) NODE IN ROCKS CLUSTER LINUX ======================================================================= By Yoon Tiem Leong School of Physics Universiti Sains Malaysia (USM) 11800 USM Penang, Malaysia 17 Dec 2013 This document provides an instruction of how to make a dual boot in a Rockscluster Linux node, so that you could have both Rocks Linux OR Windows to sit on the same hardisk. Upon succesful configuration, you will be able to choose which OS your node boots into when it is booted up, as is usually seen in a 'booloader' prompt. Note that you should have access to two template files: replace-partition.xml_format_all replace-partition.xml_noformat_windows which are to be found in http://www2.fizik.usm.my/configrepo/howto/RocksClusters543/ In order to customise how the nodes is installed when they are booted up via the Rocks boot-up disk, you need to create a file named replace-partition.xml in the directory /export/rocks/install/site-profiles/5.3/nodes in which a 'bare' template file skeleton.xml exists. The instruction in replace-partition.xml will replace the default partioning installation. The file replace-partition.xml_format_all is a template used to customise the node partitioning, in which the whole disk will be first reformatted. Basically the content of replace-partition.xml_format_all is designed by modifying the template file skeleton.xml. The specific partitioning scheme of replace-partition.xml_format_all can be read from the content of this file. In order for the nodes to be partitioned according to the customisation as specified in replace-partition.xml_format_all, you have to (1) replace the replace-partition.xml file in /export/rocks/install/site-profiles/5.3/nodes (if replace-partition.xml has already existed) by replace-partition.xml_format_all, and then rename replace-partition.xml_format_all as replace-partition.xml. (2) cd /export/rocks/install, and then issue the command rocks create distro. Once rocks create distro is done, boot up the nodes using the Rocks installation disk. The nodes will be be partitioned according to the spec as specified in replace-partition.xml. If they don't, use the thrid party bootable DVD, KDE partition manager, downloadable from (you need to burn the ISO into a bootable DVD) http://sourceforge.net/projects/partitionman/files/partitionmanager-live-cd/1.0.3/KDE_Partition_Manager_1.0.3_LiveCD.i686-1.0.3.iso/download to wipe out all prexisting linux partitinios in the nodes concerned (may be you should leave the windows partion (NTFS) untouched, if it existed). The template file replace-partition.xml_noformat_windows is meant to retain the existing windows partition (as was customised according replace-partition.xml_format_all, perhaps in an earlier attempt to customise the node's installation) during the occasion where the nodes are to be reinstalled. The specificiation of replace-partition.xml_noformat_windows, used in place of replace-partition.xml_format_all, will not format the windows partition, /state/partition1 and /state/partition2. This has the benefit of avoiding the need to reintall windows or restore the content in both /state/partitions. If the nodes get successfully installed according to the customised partioning scheme, the first partition is a vfat32 partition. Now the node is ready to be installed with Windows. Place the windows installation into the cd drive. The installation may complain of not finding a partition suitable for installation. To this end, choose to format the first partiotion seen by the windows installation disk. This partition should be of the size 40 GB. Upon succesful installation of the windows, reboot the node by inserting the KDE partition manager into thd disk drive. Install KDE partitition manager into the partition /state/partition2 (6 GB) as was defined in replace-partition.xml. During the KDE installation, you will be promted to choose the default OS to boot into when a node is booted up. You will be prompted with the choised of windows, centos and KDE (and some derivaties of these). You will choose CENTOS as the default. Upon successful installation of KDE partition manager, restart again the node. The node will be rebooted into KDE for the first time. When you reboot the node again, the node should reboot into CENTOS (i.e., rocks) by default after 5 seconds the grub menu is displayed on the screen. Note also that to avoid the Rocks linux node to reinstall itself in the occurance of e.g., an electric black-out, each node should be asked to not to reintall upon booting up. If they do, you may get into a possible trouble if the node wipes out the windows and KDE. This will occur if the replace-partition.xml_noformat_windows has not replaced pre-existing replace-partition.xml (which may ask the whole disk to be formatted, as was in the case of replace-partition.xml_format_all). This can be set by making the file /boot/grub/rocks.conf in each node to have the following content: =========================== default=1 timeout=5 hiddenmenu title Rocks Reinstall root (hd0,0) kernel /boot/kickstart/default/vmlinuz-5.3-x86_64 ro root=LABEL=/ rhgb quiet ramdisk_size=150000 kssendmac ks selinux=0 initrd /boot/kickstart/default/initrd.img-5.3-x86_64 title Rocks (2.6.18-164.6.1.el5) root (hd0,0) kernel /boot/vmlinuz-2.6.18-164.6.1.el5 ro root=LABEL=/ rhgb quiet initrd /boot/initrd-2.6.18-164.6.1.el5.img ===================================== Setting the default=1 in rocks.conf will make title Rocks (2.6.18-164.6.1.el5) as the default, thus avoiding auto-reinstallation by a node. As a remark, when a node boots up, it follows the choice as specified in /boot/grub/menu.lst. menu.lst is a symbolic link of grub.conf residing in the same directory. By default, grub.conf lists title Rocks Reinstall (i.e., default=0) as it default. If you modify grub.conf so that default=1, you may think next time the node boots up the content of menu.lst is showing default=1. However, this is NOT the case. To have a permenant effect of menu.lst to show default=1 everytime you boot up a node, you must set this in rocks.conf, not in grub.conf. It seems that everytime a node reboots, the content of grub.conf is overwritten by some predefined default format which always fix default=0. Hence, after all nodes are up, you should replace default=0 in all of the /boot/grub/rocks.conf files in all nodes by default=1. This can be easily done using the rocks run host command: rocks run host 'cp /boot/grub/rocks.conf /boot/grub/rocks.conf.bk' rocks run host 'cp /share/apps/configrepo/rocks.conf /boot/grub/' This will replace the rocks.conf file by the one in which the default OS to boot into (by the compute nodes) is 'title Rocks (2.6.18-164.6.1.el5)' instead of 'title Rocks Reinstall'. This will prevent the node to auto-reinstall in case of power failure. Note that the original rocks file (in which default option is set to '0') can be found in /boot/grub of a node. Set the default to '1' instead of '0'. This is essentially what the following rocks run host commands try to do. We are using the rocks.conf file for Rocks Linux 5.3. If you are using a Rocks of different version, try to replace the /boot/grup/rocks.conf file with one modified by you yourself. In occasion where a node is to be reformatted, you must check the content of replace-partition.xml. If it's content is that of replace-partition.xml_format_all, you may run into trouble of losing the content of your Windows partition. To avoid the reinstallation to wipe out the windows partition, replace the content of replace-partition.xml by that of replace-partition.xml_noformat_windows (and remember to rocks create distro). The manner in which a node is to be reformatted is dependent on what lies in /export/rocks/install generated by the last (=latest) rocks create distro in the frontend. The content of replace-partition.xml_noformat_windows will avoid the nodes to wipe out the windows partition, partition1, partition2.