46 lines
16 KiB
HTML
46 lines
16 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
<html><head><title>index</title></head>
|
|
<body>
|
|
<blockquote>
|
|
<span style="font-weight: bold; font-family: Times New Roman;"></span>
|
|
<h1 style="">3.5 Configuring a Tri-boot with GRUB</h1>
|
|
<b><span style="font-size: 18pt; font-family: "Times New Roman";"></span></b><span style="text-decoration: underline;"></span>For
|
|
GRUB experts, kindly proceed and make the modifications as required in
|
|
the menu.lst file in CentOS. For GRUB newbies, there is a wealth of
|
|
information available at: <a href="http://www.gnu.org/software/grub/grub.html" target="_blank">http://www.gnu.org/software/grub/grub.html</a> most of which is self-explanatory and easy to understand. If there is something that you do not understand, shoot me a mail.<br><br>GNU GRUB stands for the <span style="font-weight: bold;">GRand Unified Bootloader</span>, which is a very powerful boot loader
|
|
program for <span class="sc"></span>PCs. Detailed manual for GRUB (version 0.97) can be accessed by:<br><ul><li><span style="font-style: italic; font-weight: bold;">Online</span>: <a href="http://www.gnu.org/software/grub/manual/" target="_blank">http://www.gnu.org/software/grub/manual/</a> wherein different formats are available for easy perusal.</li><li><span style="font-weight: bold; font-style: italic;">CentOS</span>: Open a terminal, type in: <span style="font-weight: bold;"><span style="color: rgb(204, 0, 0);">info grub</span> </span>which opens up the Detailed manual for GRUB (version 0.97) on your screen.</li></ul>In <a href="http://www.gnu.org/software/grub/manual/html_node/General-boot-methods.html#General-boot-methods" target="_blank">Section 4.1</a>
|
|
of the manual for GRUB (version 0.97), lies the secret of how to
|
|
boot OSes successfully. As mentioned therein, GRUB has two
|
|
distinct boot methods - either booting the OS directly or when GRUB is
|
|
unable to provide native support to the OS in question, it fires
|
|
the boot loader of the OS via a <span style="font-style: italic;">chain-loading mechanism</span>; thereby
|
|
enabling the OS to boot successfully. For CentOS 5.2, GRUB loads the OS
|
|
directly, whereas for WinXP it needs to fire up the boot loader for
|
|
Windows via <span style="font-style: italic;">chain-loading mechanism</span>.
|
|
One point which readers ought to keep in mind is that chain-loading
|
|
mechanism normally operates on the assumption that the boot loader is
|
|
embedded in the <dfn>boot sector</dfn> of the
|
|
<span style="font-style: italic;">active partition</span> on which the OS is installed.<br><br><h2>= = STEPS TO FOLLOW = =</h2><span style="font-weight: bold;"><br>Step1:</span> Login to CentOS 5.2, open a terminal, gain superuser rights (referred to as <span style="font-weight: bold;">root</span>) by using the <span style="font-weight: bold; color: rgb(204, 0, 0);">su</span><span style="font-weight: bold;"> </span>command and providing the password that you had provided whilst installation.<br><br><div style="margin-left: 40px;">[ghosh@pluton ~]$ <span style="font-weight: bold; color: rgb(204, 0, 0);">su</span><br></div><br><span style="font-weight: bold;">Step2:</span> Once you have <span style="font-weight: bold;">root</span> access, type the following commands at the terminal:<br></blockquote><div style="margin-left: 80px;">[root@pluton ghosh]# <span style="font-weight: bold; color: rgb(204, 0, 0);">cd /<br></span>[root@pluton /]# <span style="font-weight: bold; color: rgb(204, 0, 0);">cd /boot/grub</span><br>[root@pluton grub]# <span style="font-weight: bold; color: rgb(204, 0, 0);"></span><span style="font-weight: bold; color: rgb(204, 0, 0);">ls -al </span><br>[root@pluton grub]# <span style="font-weight: bold; color: rgb(204, 0, 0);">cp grub.conf grub.conf.bak</span><br></div><blockquote>This
|
|
creates a backup file for the grub.conf file which is the configuration
|
|
file for GNU GRUB boot loader. In the listing of all files on the
|
|
screen, you can also see menu.lst -> ./grub.conf which means
|
|
menu.lst is a soft or symbolic link to the GRUB configuration file
|
|
grub.conf.<br><br><span style="font-weight: bold;">Step3:</span> [root@pluton grub]# <span style="font-weight: bold; color: rgb(204, 0, 0);">vi grub.conf<br></span><span style="color: black;"><br><span style="color: black; font-weight: bold;">S</span><span style="font-weight: bold;">tep4:</span> My grub.conf is displayed on the screen:<br></span></blockquote><div style="margin-left: 80px;"><small style="font-weight: bold;"><font style="font-family: Arial; color: rgb(153, 0, 0);"># grub.conf generated by anaconda</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);">#</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"># Note that you do not have to rerun grub after making changes to this file</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"># NOTICE: You do not have a /boot partition. This means that</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"># all kernel and initrd paths are relative to /, e.g.</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"># root (hd0,2)</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"># kernel /boot/vmlinuz-version ro root=/dev/sda3</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"># initrd /boot/initrd-version.img</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"># boot=/dev/hda</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);">default=1</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);">timeout=60</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"> splashimage=(hd0,2)/boot/grub/splash.xpm.gz</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);">hiddenmenu</font><br><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);">title CentOS (2.6.18-92.el5)</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"> root (hd0,2)</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"> kernel /boot/bzImage.</font><font style="font-family: Arial; color: rgb(153, 0, 0);">2.6.18-92.el5 ro root=LABEL=/ rhgb quiet crashkernel=512M@16M</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"> initrd /boot/initrd-</font><font style="font-family: Arial; color: rgb(153, 0, 0);">.</font><font style="font-family: Arial; color: rgb(153, 0, 0);">2.6.18-92.el5</font><font style="font-family: Arial; color: rgb(153, 0, 0);">.img</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><span style="font-family: Arial; color: rgb(153, 0, 0);"></span><br style="font-family: Arial; color: rgb(153, 0, 0);"><span style="font-family: Arial; color: rgb(153, 0, 0);">title Windows</span><br style="font-family: Arial; color: rgb(153, 0, 0);"><span style="font-family: Arial; color: rgb(153, 0, 0);"> rootnoverify (hd0,0)</span><br style="font-family: Arial; color: rgb(153, 0, 0);"><span style="font-family: Arial; color: rgb(153, 0, 0);"> chainloader +1</span></small><br></div><blockquote><br><span style="color: black;"><span style="color: black; font-weight: bold;">S</span><span style="font-weight: bold;">tep5:</span> Edit the file contents and add the lines which are marked in blue.<br><br></span><div style="margin-left: 40px;"><small style="font-weight: bold;"><font style="font-family: Arial; color: rgb(153, 0, 0);"># grub.conf generated by anaconda</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);">#</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"># Note that you do not have to rerun grub after making changes to this file</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"># NOTICE: You do not have a /boot partition. This means that</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"># all kernel and initrd paths are relative to /, e.g.</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"># root (hd0,2)</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"># kernel /boot/vmlinuz-version ro root=/dev/sda3</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"># initrd /boot/initrd-version.img</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"># boot=/dev/hda</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);">default=1</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);">timeout=60</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"> splashimage=(hd0,2)/boot/grub/splash.xpm.gz</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);">hiddenmenu</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><span style="font-family: Arial;"><br></span><span style="font-family: Arial; color: rgb(153, 0, 0);">title Windows</span><br style="font-family: Arial; color: rgb(153, 0, 0);"><span style="font-family: Arial; color: rgb(153, 0, 0);"> rootnoverify (hd0,0)</span><br style="font-family: Arial; color: rgb(153, 0, 0);"><span style="font-family: Arial; color: rgb(153, 0, 0);"> chainloader +1</span><br><br><span style="font-family: Arial; color: rgb(51, 51, 255);">title OpenSolaris</span><br style="font-family: Arial; color: rgb(51, 51, 255);"><span style="font-family: Arial; color: rgb(51, 51, 255);"> rootnoverify (hd0,1)</span><br style="color: rgb(51, 51, 255);"><span style="font-family: Arial; color: rgb(51, 51, 255);"> savedefault</span><br style="font-family: Arial; color: rgb(51, 51, 255);"><span style="font-family: Arial; color: rgb(51, 51, 255);"> makeactive<br> chainloader +1</span><br><span style="font-family: Arial; color: rgb(153, 0, 0);"></span><font style="font-family: Arial; color: rgb(153, 0, 0);"><br>title CentOS (2.6.18-92.el5)</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"> root (hd0,2)</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"> kernel /boot/bzImage.</font><font style="font-family: Arial; color: rgb(153, 0, 0);">2.6.18-92.el5 ro root=LABEL=/ rhgb quiet crashkernel=512M@16M</font><br style="font-family: Arial; color: rgb(153, 0, 0);"><font style="font-family: Arial; color: rgb(153, 0, 0);"> initrd /boot/initrd-</font><font style="font-family: Arial; color: rgb(153, 0, 0);">.</font><font style="font-family: Arial; color: rgb(153, 0, 0);">2.6.18-92.el5</font><font style="font-family: Arial; color: rgb(153, 0, 0);">.img</font></small><span style="font-family: Arial; color: rgb(153, 0, 0);"><br></span></div><br><span style="color: black;"><span style="color: black; font-weight: bold;">S</span><span style="font-weight: bold;">tep6:</span>
|
|
I have rearranged the code in accordance to the geometrical layout of
|
|
the partitions in the hard disk. WinXP first, followed by OpenSolaris
|
|
slice and finally, the CentOS partition. Save and exit vi editor. </span><br><br><span style="font-weight: bold;">Step7:</span> [root@pluton grub]# <span style="font-weight: bold; color: rgb(204, 0, 0);">/sbin/reboot</span><br><br>This restarts the PC. When the system finally comes up, press any key to see the GNU GRUB version 0.97 screen, which displays:<br><br><div style="margin-left: 80px;"><span style="font-weight: bold;">W</span><span style="font-weight: bold;">indows</span><span style="font-weight: bold;"></span><br><span style="font-weight: bold;">OpenSolaris</span><br><span style="font-weight: bold;">CentOS (2.6.18-92.e15)</span><span style="font-weight: bold;"></span><br></div><br><ul><li>Selecting <span style="font-weight: bold;">Windows</span> and pressing <small><span style="font-style: italic;"><ENTER> </span></small>boots your system into WinXP.</li><li>Selecting <span style="font-weight: bold;">OpenSolaris </span>and pressing <small><span style="font-style: italic;"><ENTER> </span></small>loads the OpenSolaris GRUB boot loader via <span style="font-style: italic;">chain-loading mechanism</span>. It has our earlier OpenSolaris entries plus the WinXP boot entry. Check whether all working correctly or not.</li><li>Selecting <span style="font-weight: bold;">CentOS (2.6.18-92.e15) </span>and pressing <small><span style="font-style: italic;"><ENTER></span></small> boots CentOS 5.2.</li></ul><br>Thus, as <span style="font-style: italic;">promised,</span> we have:<br><br>a)
|
|
Successfully partitioned a new single hard disk drive into primary and
|
|
extended partitions with WinXP FAT32, OpenSolaris ZFS and Linux ext3
|
|
filesystems on them.<br>b) Successfully installed Microsoft WinXP on the first primary partition of the hard disk.<br>c) Successfully installed OpenSolaris 2008.11 on the second primary partition of the hard disk.<br>d) Successfully installed CentOS 5.2 on the third primary partition of the hard disk <span style="font-style: italic;">(with Linux swap on a logical disk drive of the extended partition)</span>.<br>e)
|
|
Successfully edited the GRUB configuration file /boot/grub/grub.conf
|
|
and configured a tri-boot system with WinXP, OpenSolaris and CentOS<span style="font-style: italic;"></span> OSes.<br><br><span style="text-decoration: underline;"><br>
|
|
</span><span style="font-family: Times New Roman;"><span style="font-family: Times New Roman;"><span style="font-family: Times New Roman;"><span style="text-decoration: underline; font-family: Times New Roman;"><span style="font-weight: bold;"></span></span><span style="font-weight: bold;"></span>
|
|
<hr style="font-family: Times New Roman;">
|
|
<div style="text-align: center;"><a style="font-weight: bold;" href="chap4.html">Previous</a>
|
|
|
|
|
<a style="font-weight: bold;" href="index.html">Home</a>
|
|
|
|
|
<a href="conclusion.html"><span style="font-weight: bold;">Next</span></a>
|
|
</div>
|
|
</span></span></span></blockquote>
|
|
</body></html> |