[Lunar-commits] r15674 - lunar-doc/trunk/lunar-manual

ca3sar ca3sar at lunar-linux.org
Sun Jul 10 12:25:03 UTC 2005


Author: ca3sar
Date: 2005-07-10 12:24:58 +0000 (Sun, 10 Jul 2005)
New Revision: 15674

Modified:
   lunar-doc/trunk/lunar-manual/1installation.tex
   lunar-doc/trunk/lunar-manual/5getting_to_work.tex
   lunar-doc/trunk/lunar-manual/Lunar_Book.tex
Log:
Adding Nestus lilo to grub howto.

Modified: lunar-doc/trunk/lunar-manual/1installation.tex
===================================================================
--- lunar-doc/trunk/lunar-manual/1installation.tex	2005-07-10 11:20:27 UTC (rev 15673)
+++ lunar-doc/trunk/lunar-manual/1installation.tex	2005-07-10 12:24:58 UTC (rev 15674)
@@ -265,6 +265,7 @@
  \end{lstlisting}
 
 Of course, these examples are pertinent to our setup that we have been using thoughout this manual. Your actual lilo.conf file may be different.\par
+If you want to switch to Grub later, see section \ref{lilo2grub}. \par
 
 \paragraph{Integrating an other OS}
 

Modified: lunar-doc/trunk/lunar-manual/5getting_to_work.tex
===================================================================
--- lunar-doc/trunk/lunar-manual/5getting_to_work.tex	2005-07-10 11:20:27 UTC (rev 15673)
+++ lunar-doc/trunk/lunar-manual/5getting_to_work.tex	2005-07-10 12:24:58 UTC (rev 15674)
@@ -229,6 +229,266 @@
 "Linux 2.6.0: What's New"
 http://www.osdl.org/newsroom/press\_releases/2003/2003\_12\_18\_beaverton\_2\_6\_new.html
 
+\section{Grub}\label{lilo2grub}
+%from nestu lilo to grub howto in svn ...
+
+\subsection{Preamble}
+
+\paragraph{Why to change}
+
+In the beginning, I wrote this so users could get a grip on lunar's 2.6.X 
+based iso, so if they were lilo lovers, they didn't feel so lost in the 
+new grub world :) Now it has evolved a little, so that doesn't mean that 
+you cannot read it even if you are not going to use the 2.6.X iso. 
+Please do if you fancy :) It is just that since lilo isn't in the mood 
+of compiling against 2.6 headers I decided to write a lilo howto on what 
+a lilo user should know if (s)he feels like giving grub a quick spin. 
+
+
+\paragraph{What is this about ?}
+
+If you don't know what grub is at this point, and furthermore, you do 
+not even know what lilo is, you're in deep deep deep trouble.  But 
+your guess is good enough if you think that grub is a bootloader just 
+like lilo. You got it, right? Cool :) You didn't? GAME OVER. INSERT COIN TO 
+PLAY AGAIN ]:-) Well, to be fair, "GNU GRUB, the GRand Unified 
+Bootloader, a flexible and powerful boot loader program for PCs." is 
+what its website's manual says of it. \footnote{More info at grub's website, in its doc: 
+http://www.gnu.org/software/grub/manual/grub.html }
+
+
+\paragraph{Where is it installed ?}
+
+You can you use grub anywhere: it can boot your linux, *BSD or Evil 
+Empire's box. It can be installed in your MBR or in a partition, just 
+like lilo. \par
+
+Just as a side note, be warned that here only Linux will be discussed.
+Pleae refer to grub's docs on how to boot other OS.
+
+
+\paragraph{When to change}
+
+You should read this \textbf{before} you install the 2.6 based iso if you are 
+a lilo user, or \textbf{before} you take the step of switching from lilo to 
+grub. Maybe you have just dropped by, and now you like what you are 
+reading and you decide to make the move (well, that be \textbf{before} anyway 
+:)
+
+
+\subsection{How to switch to grub}
+
+\subsubsection{The Theory}
+
+The first great difference we'll find between grub and lilo is that grub 
+doesn't have to be rerun each time you change its conf file. 
+Furthermore, you can get an interactive grub prompt, where you can play 
+with boot options upon will. But more on that later.\par
+
+Let's start from a simple lilo configuration, and move on from there:
+
+\begin{lstlisting}
+lba32
+boot=/dev/discs/disc0
+map=/boot/map
+prompt
+timeout=100
+default=linux
+
+image=/boot/vmlinuz 
+label=linux
+root=/dev/discs/disc0/part1
+vga=extended
+append="noacpi"
+                read-only
+\end{lstlisting}
+
+So basically, from our example file we gather: 
+\begin{lstlisting}
+ boot = /dev/discs/disc0
+\end{lstlisting}	
+lilo is installed in hda's mbr (first hd).
+\begin{lstlisting}
+ map  = /boot/map		
+\end{lstlisting}
+The disk map file. 
+\begin{lstlisting}
+prompt			
+\end{lstlisting}
+Prompt the user interactivety
+\begin{lstlisting}
+delay = 100			
+\end{lstlisting}
+wait in 10th of a second
+\begin{lstlisting}
+timeout = 100			
+\end{lstlisting}
+waits an amount of time before booting the  default kernel image.
+\begin{lstlisting}
+default = linux
+\end{lstlisting}		the default kernel image to boot is the  one labeled 'linux'		
+\begin{lstlisting}
+image = /boot/vmlinuz
+\end{lstlisting}		placement of our kernel image
+\begin{lstlisting}
+label = linux
+\end{lstlisting}			the kernel's image reference label to be seen in lilo's menu.
+\begin{lstlisting}
+root = /dev/discs/disc0/part1
+\end{lstlisting}	the root partition is in the second partition the first hd.
+\begin{lstlisting}
+append = "noacpi"
+\end{lstlisting}		additional parameters to be passed on boot 
+\begin{lstlisting}
+read-only			
+\end{lstlisting}
+root is mounted in read-only mode. \par
+
+Grub's harddisk and partition naming schemes are different from lilo's: instead of naming a harddisk as a device, it does so as a harddisk per se, and its position in the harddisk list. So, in our example, the booting device was \lstinline{/dev/discs/disc0} in lilo's configuration would be \lstinline"(hd0)" for grub, since it is the first harddisk (\lstinline'0' since it is the first, \lstinline'1' for the second and so on...). Something important to mention here is that cd devices are not listed. Say for example we have a second device, a cdrom at \lstinline{/dev/discs/disc1} and a third device, another harddisk, at \lstinline{/dev/discs/disc2}. Although the harddisk is placed third from lilo's point of view, from grub's point of view it is the second harddisk. Therefore, to reference that second harddisk in grub you should write \lstinline(hd1), and not \lstinline(hd2) as that would mean it would be the third harddisk. \par
+
+Another important thing to take in consideration is how it scans for IDE and SCSI devices: first come all IDE devices and then all SCSI. Therefore, if we had two devices, one IDE \lstinline{hda} and another SCSI \lstinline{sda}, they would become hd0 and hd1, respectively. In the case of only SCSI devices, taking as example two devices, sda and sdb, grub would see them as hd0 and hd1. \par
+
+Grub's partition count also starts a 0, instead of 1 like lilo's does. This means the first partition of the first harddisk that for lilo would be \lstinline{/dev/hda1}, would in fact be \lstinline{(hd0,0)} for grub, e.g., grub uses the \lstinline{(hd$harddisk,$partition)} naming convention.\par
+
+To make things even more clear, let's have a look at a transition table for harddisk devices:
+
+\begin{lstlisting}
+/dev/discs/disc0 /dev/hda (hd0)
+/dev/discs/disc1 /dev/hdb (hd1)
+/dev/discs/disc2 /dev/hdc (hd2)
+/dev/discs/disc3 /dev/hdd (hd3)
+\end{lstlisting}
+
+And equivalently for partitions:
+
+\begin{lstlisting}
+/dev/discs/disc0/part0 /dev/hda1 (hd0,0)
+/dev/discs/disc0/part1 /dev/hda2 (hd0,1)
+/dev/discs/disc0/part2 /dev/hda3 (hd0,2)
+/dev/discs/disc0/part3 /dev/hda4 (hd0,3)
+/dev/discs/disc0/part4 /dev/hda5 (hd0,4)
+
+/dev/discs/disc1/part0 /dev/hdb1 (hd1,0)
+/dev/discs/disc1/part1 /dev/hdb2 (hd1,1)
+/dev/discs/disc1/part2 /dev/hdb3 (hd1,2)
+/dev/discs/disc1/part3 /dev/hdb4 (hd1,3)
+/dev/discs/disc1/part4 /dev/hdb5 (hd1,4)
+\end{lstlisting}
+
+I think you get the idea, huh?...\\	
+
+Having said that, let's see how our lilo.conf would be as a grub configuration file (named \lstinline{menu.lst}):
+\begin{lstlisting}
+timeout 10
+default 0
+
+title linux
+root (hd0,1)
+kernel /boot/kernel noacpi read-only root=/dev/hda1
+\end{lstlisting}
+
+This is quite straighforward, but let's see things step by step:
+
+\begin{lstlisting}
+timeout 
+\end{lstlisting}	Wait for 10 seconds before booting with the default 
+                kernel entry. Named timeout in lilo.
+\begin{lstlisting}
+default 
+\end{lstlisting}	The default kernel to boot is the first entry, 0. 
+                Equivalent to the "default" tag in lilo.
+\begin{lstlisting}
+title 
+\end{lstlisting}	label that will be seen on menu. Same as \lstinline"label" tag for lilo.
+\begin{lstlisting}
+root
+\end{lstlisting}		partition where /boot resides
+
+\begin{lstlisting}
+kernel 
+\end{lstlisting}	full path to kernel image starting at the boot's root  previously set. Kernel params come along the same line. Therefore equivalent to \lstinline"image" and \lstinline"append" tags in lilo's config. Noticed the root option there? That's where your / is. Do not confuse with grub's root command. As it is a kernel param, and not a grub specific question, the device naming is done as in /dev  nodes and not with grub's naming convention. \par
+
+
+Quite obviously you will note the missing lilo's \lstinline"boot" tag equivalent (well, geez, I hope so!). The reason why that the boot tag has nothing alike in grub is quite simple: every time you change \lstinline{lilo.conf} and you rerun \lstinline{lilo} to update, lilo has to know where to install itself; this doesn't happen with grub since grub only is installed once. That's right, only once. You can change the \lstinline{menu.lst} file, save it, and reboot, and you will have an updated menu. No more rewritting mbr on every kernel change! ;) \par
+
+
+\subsubsection{The praxis}
+
+First of all, if you have decided to do the switch, you will have to 
+install grub on your box:
+
+\begin{lstlisting}
+root at myshinybox $ lin grub
+\end{lstlisting}
+
+will download and install grub in the default location, that is \lstinline{/boot/grub/}. grub and lilo can coexist, so there's no need to remove lilo, if you want to keep it handy, just in case... ]:-) \par
+
+Second step to get this going is to remove lilo as your bootloader: \\
+
+\begin{lstlisting}
+root at myshinybox $ lilo -U
+\end{lstlisting}
+
+will do the trick. Obviously, don't attempt to reboot your box after this point, untill finished all the steps to grub's install. \par
+
+Now we are done with lilo, let's start with grub: we need to edit the menu.lst file, by default placed under /boot/grub/ dir, (and that is the placement on the 2.6 iso too, by the way). But before editing the \lstinline{menu.lst} file, we have to install grub, and point it towards were our config file is placed. To do so, we have to enter grub's interactive mode, that you can call from commandline prompt:
+
+\begin{lstlisting}
+root at myshinybox $ grub	
+\end{lstlisting}
+
+What we will see is:
+
+\begin{lstlisting}
+grub > 
+\end{lstlisting}
+
+We can set a root from here, like we did in the menu.lst before. There is a difference between lilo's and grub's root, though: root means root partition for lilo (e.g. '/' ), yet for grub it means the partition where you can find /boot, that can be on its own partition or hanging from the root partition. This can be accomplished from grub's prompt 
+with one simple command:
+
+\begin{lstlisting}
+grub > root (hd0,1)
+\end{lstlisting}
+
+In this example, we set boot/ to be in hda2 from lilo's point of view, that is in the second partition of the first harddisk. grub is surprisingly wise if you just type root and then the tab key; you will see a list of posible candidates to be your grub's root: 
+
+\begin{lstlisting}
+grub > root<tab>
+\end{lstlisting}
+
+Notice that like lilo, it is not the same to have a bootloader installed on your box, than having the bootloader installed to boot your box (currently I have both lilo and grub packages installed on my boxes, and I have lilo to boot this box and grub to boot the other).  Typically bootloaders are installed in the first harddisk's master boot record 
+(mbr). To install grub as our bootloader of choice, we use the setup command:
+
+\begin{lstlisting}
+grub > setup (hd0)
+\end{lstlisting}
+
+If instead of the first's hd mbr, we decide to install in a partition, we continue the same nomenclature as in menu.lst. Say for example we install grub in the first partition of the first harddisk, then we would have to issue a similar command as before, with a small change:
+
+\begin{lstlisting}
+grub > setup (hd0,0)
+\end{lstlisting}
+
+To make these changes permanent, you should quit the interactive prompt with the appropiate quitting command. I bet you can't guess it! No, you missed! It is \lstinline'quit'! Ha ha! :
+
+\begin{lstlisting}
+grub > quit
+\end{lstlisting}
+
+And you should now be back to your lunar terminal prompt. And now one simple file editing in our favorite editor: using our previous example, this is what we would have to put in our /boot/grub/menu.lst:
+
+\begin{lstlisting}
+timeout 10
+default 0
+
+title linux
+root (hd0,1)
+kernel /boot/kernel noacpi read-only root=/dev/hda1
+\end{lstlisting}
+  
+Save the file, and quit the editor. Now you can safely reboot, since there's new bootloader in the neighbourhood... \par
+
+
 \section{64-Bit Linux}
 
 \section{(A)DSL}

Modified: lunar-doc/trunk/lunar-manual/Lunar_Book.tex
===================================================================
--- lunar-doc/trunk/lunar-manual/Lunar_Book.tex	2005-07-10 11:20:27 UTC (rev 15673)
+++ lunar-doc/trunk/lunar-manual/Lunar_Book.tex	2005-07-10 12:24:58 UTC (rev 15674)
@@ -43,7 +43,7 @@
 
 The manual is meant to  cause a learning effect on the reader. So we wont describe every detail, your intended to think for yourself. Lunar is an excellent distro to learn Linux. In the troubleshooting chapter you will find help for self-help.\par
 
-Many chapters are worked in How-To`s  from the library, so nestu, sofar, tchan here is the answer why you appear as author of this book foremost. Im replaying most steps on a qemu installation and update certain passages, as done with the install docu, that \_really\_ wasn't up to date ... \par
+Many chapters are worked in How-To`s  from the library, so nestu, sofar, etc.  here is the answer why you appear as author of this book foremost. Im replaying most steps on a qemu installation and update certain passages, as done with the install docu, that \textbf{really} wasn't up to date ... \par
 
  thx to our devs, esp. sofar for giving the community a nice, fast, clean and lean distribution. \par
 



More information about the Lunar-commits mailing list