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 14 Dec 2015 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. We will use Rocks 6.1.1 as a demo case. The instructions desribed here should be applicable to other version of Rocks of equal or higher versions. 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. Stage 1: Installing and customizing the format of the nodes' hard disk ====================================================================== To begin with, you should have online 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/RocksClusters_6.1.1/ Assuming your frontend has been up and running, and you are now ready to 'insert-ethers' your nodes for the FIRST TIME. In order to customise how the nodes are formatted when they are booted up via the Rocks boot-up disk, you need to create a file named replace-partition.xml in the directory (in the frontend) /export/rocks/install/site-profiles/6.1.1/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. 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. Basically, the first partition will be formated as a 40GB vfat32 partition and a /state/partition2 with 6GB space for installing a third OS, i.e., KDE partition manager. In order for the nodes to be partitioned according to the customisation as specified in replace-partition.xml_format_all, do the following: ############### cd /export/rocks/install/site-profiles/6.1.1/nodes wget http://www2.fizik.usm.my/configrepo/howto/RocksClusters_6.1.1/replace-partition.xml_noformat_windows wget http://www2.fizik.usm.my/configrepo/howto/RocksClusters_6.1.1/replace-partition.xml_format_all mv replace-partition.xml replace-partition.xml.orig cp /share/apps/configrepo/replace-partition.xml_noformat_windows . cp /share/apps/configrepo/replace-partition.xml_format_all . cp replace-partition.xml_format_all replace-partition.xml cd /export/rocks/install 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 (via insert-ethers compute in frontend), the node is readily a usual-looking Rocks node and can be used as it is. End of the Stage 1 for the nodes. Stage 2: Installing Windows and setting up a dual-boot option grub using KDE partition manager ============================================================================================== The node at the end of Stage 1 described above is not yet a fully functioning dual-boot, stand-alone PC. We need to install a Windows OS along the Rocks OS in the node. To do so, follow the procedure describe below: 1. Place the windows installation DVD into the cd drive of a node. 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 (as was specified by replace-partition.xml in Stage 1). 2. 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) (this partition was specified by replace-partition.xml in Stage 1). 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). Set CENTOS as the default. Upon successful installation of KDE partition manager, reboot the node. The node will be rebooted into KDE for the first time. Reboot the node again. The node should now reboot by default into CENTOS (i.e., Rocks) after the grub menu is displayed on the screen for about 5 seconds. Choose to boot into Windows during this 5 second interval is you so wish. 3. In the occasion where a node is to be manually reinstalled (via rebooting the Rocks installation DVD in the node) or automatically reinstalled, you must check the content of replace-partition.xml in the frontend. The manner in which a node is to be reinstalled is dependent on what the contents of the folders in /export/rocks/install, which are generated by the last (=latest) rocks create distro in the frontend, which in turns realises the instruction of /export/rocks/install/site-profiles/6.1.1/nodes/replace-partition.xml. If the content of replace-partition.xml is that of replace-partition.xml_format_all, you may run into trouble of losing all the content of that node's hardisk upon reintallation. If the content of replace-partition.xml is that of replace-partition.xml_noformat_windows, then reintallation of a node will not wipe out the windows partition, /state/partition1, /state/partition2 that have existed in it. To avoid the accident in which a new installation on a node, which may be forced in the unknown future, wipes out the windows partition, KDE partition and /state/partition1 already existed in the hard disk of the node, the following step must be carried out: Once all the nodes are completed with dual-boot configuration, Windows and KDE installations, you must replace the content of replace-partition.xml by that of replace-partition.xml_noformat_windows in the frontned, and then do the rocks create distro act. ############### cd /export/rocks/install/site-profiles/6.1.1/nodes mv replace-partition.xml replace-partition.xml.orig cp replace-partition.xml_noformat_windows replace-partition.xml cd /export/rocks/install rocks create distro ############### Next time when the nodes are reinstalled, all existing Windows, /state/partition1, /state/partition2 partitions will remain intact. ### The following is an optional procedue #### 4. 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 rootnoverify (hd0,0) chainloader +1 title Rocks Reinstall root (hd0,1) kernel /boot/kickstart/default/vmlinuz-6.1.1-x86_64 ro root=UUID=691440b1-25b7-4c84-a318-6b0a76e97d9a rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet ramdisk_size=150000 kssendmac ks ksdevice=44:87:fc:ae:0f:96 selinux=0 initrd /boot/kickstart/default/initrd.img-6.1.1-x86_64 title Rocks (2.6.32-431.11.2.el6.x86_64) root (hd0,1) kernel /boot/vmlinuz-2.6.32-431.11.2.el6.x86_64 ro root=UUID=691440b1-25b7-4c84-a318-6b0a76e97d9a rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet initrd /boot/initramfs-2.6.32-431.11.2.el6.x86_64.img title Other rootnoverify (hd0,0) chainloader +1 ===================================== Setting the default=1 in rocks.conf will make title Rocks (2.6.32-431.11.2.el6.x86_64) 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: cd /share/apps/configrepo wget http://www2.fizik.usm.my/configrepo/howto/RocksClusters_6.1.1/rocks.conf rocks run host 'mv /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.32-431.11.2.el6.x86_64)' 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. However, it is also to be noted here that Step 4 as described here may not be absolutely necessary. Skipping it may not really lead to serious problem even in the event of power failure. Our experience has it that carrying out Step 4 may not 100% guarantee that the nodes can resume its function correctly even if it we set it to not automatically reinstall.