The original of this thread is being maintained at this location. Sorry for any inconvenience. Please click the maintained version for the lastest development
To make the subject less boring I tell you my nightmare instead.
It concerns a JL moderator walking angrily towards me, point the two most lethal booting weapons to my head, on his right hand a Linux Live CD and on the left a Grub floppy, shouting
“You have been with JustLinux Forum for 1.5 year, What have you learned?”
I murmured "Just booting tips"
Below is the confession he made me to sign.
Task A : Tasks one can perform with a bootable Grub floppy
Note : A Grub floppy can be used to boot up any operating system in a PC. It all depends how it is used. The above Grub floppy is unattached to an operating system and can be created by following Chapter 3.1 of the Grub Manual or Chapter 4 of "Linux in a Nutshell" Siever, Figgins and Webbers". For users having no access to an installed Linux the required stage1 and stage2 files can be obtained from a Linux Live CD that has Grub inside. Suitable Live CDs are Mepis, Ubuntu, Puppy, Damn Small Linux, Linux Rescue CD, Kanotix, Knoppix.......
A1: To find out partitioning scheme of 1st bootable disk
Note : For 2nd, 3rd and 4 disk use disk designations (hd1), (hd2) and (hd3) respectively (Grub counts from 0)
A2: Ask Grub to report any partition that has Grub inside
Note : /boot/grub is the designated location for storing Grub’s menu.lst
A3: Ask Grub to report a partition that has Lilo inside
Note : /etc/lilo.conf is the designated Lilo’s configuration file
A4: To display Grub's configuration in partition hda8
Note : One can follow the displayed instructions on the screen, line by line, to boot up the Linux manually (partition hda8 is just an example)
A5: To display Lilo’s configuration in partition hda8
Note : One can follow the Lilo instructions and pick out the relevant information for Grub to boot up the Linux manually
A6: To boot a Linux in hda8 with a workable Grub menu.lst
Note : The Linux will boot if its /boot/grub/menu.lst is in working order
A7: Use Grub data in partition (hda,6) to setup Grub boot loader in MBR
Note : For the last line "setup (fd0)" will make Grub go to a bootable floppy (fd0) and "setup (hd0,5)" will make Grub go inside the root partition (hd0,5). For Grub going to MBR of 1st boot Sata disk use "setup (sda)".
Task B : To restore the MBR of Dos, Windows, Lilo or Grub
Note : The MBR is the first 512 bytes of the first bootable disk. It is read by the BIOS when the machine is powered up. A boot loader installed there controls which system is to be booted next. A boot loader is rarely deleted. It is often overwritten by another boot loader with special commands which are described below. (A boot loader is not part of the filing system and so cannot be get rid of by the format command)
B1: To restore Dos/Windows MBR with a bootable floppy
Note : MS systems have a common MBR and XP/Win2k MBR can also be restored by a Dos floppy. A bootable Dos floppy needs "fdisk.exe" inside.
B2: To restore Dos/Windows MBR with an installation CD
Note : MS systems have a common MBR. A Dos-based system's MBR can also be restored by a NT version Windows installation CD. Any Win2k or XP installation CD will do the job
B3: To restore Lilo from Linux partition hda4 into MBR by Live CD
Note : As an example hda4 being the Linux’s root partition. This method requires a Live CD. Normally any Live CD will do.
B4: To restore Grub from Linux partition hda4 into MBR by Grub floppy
mount /dev/hda4 /mnt/temp
lilo –b /dev/hda4
Note : The Grub floppy boots to a Grub prompt. Can be done equally with a Live CD with a Grub inside, by ivoking a Grub shell (just type "grub" at root terminal).
B5: To restore Grub from Linux partition hda4 into MBR by Live CD
Note : This method requires a Live CD. If this method fails just type "grub" to invoke a Grub shell and use Task B4 method which is more robust. Grub can boot operating systems in a Grub prompt.
Task C: To boot Dos, Windows, BSD or Solaris using a Grub floppy
mount /dev/hda4 /mnt/temp
Note : This is using a Grub floppy to boot a non-Linux system. See later Tasks D to H for booting Linux
C1: To boot any Dos or Windows from 1st bootable disk by Grub floppy
Note : For system in 2nd, 3rd or 4th primary partition use (hd0,1), (hd0,2) and (hd0,3) in the root statement. Makeactive statement is only needed if there is another system using the bootable flag in the same drive. MS System is in the first partition of the bootable drive.
C2: To boot any Dos or Windows from 2nd bootable disk by Grub floppy
Note : System installed in 1st bootable drive but later moved to 2nd drive. The two map statements let the MS system reclaim the 1st bootable disk status.
C3: To boot multiple installations of Dos and Windows by Grub floppy
map (hd1) (hd0)
map (hd0) (hd1)
Note : System was originally installed in 1st bootable drive 2nd partition and has another MS system in front. Later the disk was moved to 4th disk position.
C4: OpenBSD, NetBSD, FreeBSD, Dragonfly BSD, Desktop BSD and PcBSD
map (hd3) (hd0)
map (hd0) (hd3)
Note : Need to deny the BSD installer access to the MBR during installation to force it to place its boot loader in the root partition
C5: Solaris 10 and Express
Same as Dos/Windows system, see Task C1
Note : Need to deny the Solaris installer access to the MBR during installation to force it to place its boot loader in the root partition
Task D : Make a Linux chainloadable by Ntldr, Lilo or Grub
Same as Dos/Windows system, see Task C1
Note : A Linux is chainloadable if it has a boot loader inside its root partition. This allows another system's boot loader, for example Ntldr from XP or Win2k, Lilo or Grub from another Linux, to boot it. In chainloading a boot loader A boots a second boot loader B. It is up to the second boot loader B to boots its own master.
D1: To make a Linux "chainloadable in partition hda8 with Grub by a Grub floppy
Note : Can be done with a Live CD if it has Grub inside.
D2: To make a Linux "chainloadable in partition hda8 with Grub by a Live CD
Note : If grub-install fails then invoke a Grub shell and try Task D1 as it is more robust.
D3: To make a Linux "chainloadable in partition hda8 with Lilo by a Live CD
mount /dev/hda8 /mnt/temp
Note : If Lilo fails you may have to boot the system up manually by Grub. See Tasks F & G
D4: To make Linux chainloadable that has a rescue section in the installation CD
mount /dev/hda8 /mnt/temp
lilo –b /dev/hda8
Note : Only works if the Linux installation CD has such a facility. The principle steps used are similar to Tasks D2 & D3.
Task E : To boot a Linux with a boot loader inside its root partition
Boot up the Linux installation CD
follow the instructions to re-install the boot loader
and choose the root partition as the destination
Note : A Linux is very easy to boot if it has a boot loader inside its root partition. Both Grub and Lilo can boot such a Linux with 2 generic lines.
E1: Using a Grub floppy to boot a chainlaodable Linux with Grub or Lilo in partition hda8.
Note : See Task D on how to make a Linux chainloadable. This method works for both Lilo and Grub. The tool used is the Grub floppy
E2: To add another Linux in hda8 to a working Grub configuration file
Note : The working Grub is the one the PC boot to and its configuration file is /boot/grub/menu.lst. Grub has no difficulty in accepting over 100 systems in /boot/grub/menu.lst
E3: To add another Linux in hda8 to a working Lilo configuration file
Note : The working Lilo is the one the PC boot to and its configuration file is /etc/lilo.conf. Depending on the version of the Lilo a maximum of 27 images can be booted by a /etc/lilo.conf
E4: To use Windows Ntldr to boot a chainlaodable Linux in partition hda8.
Note : The file boot_hda8.lnx is the first 512 bytes of Linux boot loader in partition hda8. It has to be copied into the partition where XP/Win2k is booted. (commands are showed in red)
Task F : To boot a Linux with no boot loader inside its root partition
In Linux :- Copy the first 512 bytes into a file
dd if=/dev/hda8 of=boot_hda8.lnx bs=512 count=1
then copy the file boot_hda8.lnx into "C" drive of Windows
attrib -r -s -h boot.ini
then add "C:\boot_hda8.lnx "My New Linux in hda8" to boot.ini
save the file boot.ini
attrib +r +s +h boot.ini
Note : The easy way is to install the boot loader of the Linux in its root partition. Many Linux users put a Linux boot loader into the MBR but do not realise it can be put inside the root partition also. If Task F fails to work try Task G.
F1: Any Linux say with root partition hda8.
Note : To make the Linux chainloadable is easier for booting purpose. Method works on any Linux with either Grub or Lilo as the boot loader.
Task G : To boot a Linux that cannot be chainloaded, initally by a Grub floppy
(1) Follow Task D to install boot loader inside Linux root partition
(2) Follow Task E to boot the Linix
Note : When a Linux cannot be chainloaded then its boot loader cannot boot itself at the installed position. Likely cause is beyond 137Gb barrier in the hard disk or in a high-partition number the Linux doesn't support. The Linux in this case has to be booted directly by naming its kernel and initrd filenames. Initially the Linux is booted by a Grub floppy manually. Once in working order just put the manual instructions into a /boot/grub.menu.lst.
G1: Linux uses Grub still has a menu.lst but cannot be chainloaded, root partition being hda8.
Note : If root partition is unknown use Task A2 to find it out. The initrd statement is optional and may not be used by a Linux like those from the Slax or Slackware families.
G2: Any Linux that uses Grub or Lilo as the boot loader, assuming root partition being hda8.
(1) To display Grub’s menu.lst on the screen by
(2) Type its content at the terminalline by line
starting with the “root” statement
and finish with “initrd” statement if used
(3) Boot the system up with this additional line
Note : The Linux is assumed to have no configuration file of /boot/grub/menu.lst or /etc/lilo.conf. To use the Live CD to find out the full name of vmlinuz and initrd in /boot directory of the Linux for Stage (1), say they are vmlinuz-2.6.15-8-i386 and initrd-2.6.15-8-i386 then use them in Stage (2). If the Linux refuses to boot then review the error message to introduce addition parameters to pass on during boot time. From experience most Linux will answer the call. If the Linux is stubborn and refuses to boot altering “ro” to “rw” in Task G2 may be able to kick start it.
Task H : Possible tasks with a Linux Live CD on an unbootable Linux
Stage (1) to obtain kernel and initrd filenames
mount /dev/hda8 /mnt/tmp
Stage (2) to boot the Linux directly
kernel /boot/vmlinuz-2.6.15-8-i386 ro root=/dev/hda8
Note : Using a Live CD to rescue an unbootable Linux is a new and reliable method. Together with a Grub floppy there should be no Linux unbootable.
H1: To acess the files of the unbootable Linux, say in partition hda9
Note : Need to log in as root user, use "su" or add "sudo" in front of the privileged commands
H2: To get inside the unbootable Linux in hda9
mount /dev/hda9 /mnt/hda9
Note : It is possible some Live CDs may disallow “chroot” unless log in as root. After the "chroot" statement the user will ne inside the unbootable Linux
Task J : Possible alternatives to obtain a Grub prompt to help booting
mount /dev/hda9 /mnt/hda9
Note : The Grub floppy produces a Grub prompt with which a user can boot any PC system. The Grub prompt is always available from the following alternatives
J1: From a Linux with a plain Grub menu with option to edit the menu at the bottom
Note : Majority of distros has a plain menu with a splash screen at the background. The bottom of the menu border shows a few lines of instructions The last few words of the last line is "c" for a command-line.
J2: From a Linux with a Grub menu with option to edit the menu "hidden"
press "c" to trigger a Grub prompt
Note : Putting a "#" in front of the "fgxmenu" statement will disable that statement, allowing the plain menu to be shown again. Distros uses the gfxmenu statement include Suse and Kanotix.
(1) Edit the Linux's /boot/grub/menu.ls
(2) Put a "#" in front of the "fgxmenu" statement
(3) Follow instruction of Task J1