Saikee Blog

I created this page for documenting all the good booting techniques I come across. Hope it will useful to others. Booting Systems include : Dos, Windows, Linux, BSD, Solaris

Name:
Location: Newcastle upon Tyne, Northumberland, United Kingdom

Just a dumb dude

Thursday, January 05, 2006

Booting tips at a glance

Task A : Tasks one can perform with a bootable Grub floppy

No

Task

Instructions

Note

A1

To find out the partitioning scheme of the first bootable disk

geometry (hd0)

For 2nd, 3rd and 4 disk use disk designations (hd1), (hd2) and (hd3) respectively

A2

Ask Grub to report a partition that has Grub inside

find /boot/grub/menu.lst

/boot/grub is the designated location for storing Grub’s menu.lst

A3

Ask Grub to report a partition that has Lilo inside

find /etc/lilo.conf

/etc/lilo.conf is the designated Lilo’s configuration file

A4

Ask Grub to display its configuration file on the screen, after finding it is in hda8 (for example)

root (hd0,7)

cat /boot/grub/menu.lst

The two lines may be condensed into one as

cat (hd0,7)/boot/grub/menu.lst

A5

Ask Grub to display Lilo’s configuration file on the screen, after finding it is in hda8 (for example)

root (hd0,7)

cat /etc/lilo.conf

The two lines may be condensed into one as

cat (hd0,7)/etc/lilo.conf

A6

Ask Grub to boot a Linux in hda8 which is know to have a workable menu.lst

root (hd0,7)

configfile /boot/grub/menu.lst

The two lines may be condensed into one by omitting the first line and add (hd0,7) in front of /boot/grub/menu.lst

A7

Ask Grub to use Grub data in partition (hda,6) to setup the boot loader in MBR

root (hd0,5)

setup (hd0)

Change (hd0) to (fd0) if the boot loader has to go to a bootable floppy.

Change (hd0) to (hd0,5) if the boot loader has to be replicated inside root partition (hd0,5)

Note : The above Grub floppy is unattached to an operating system and can be created by following Chapter 3.1 of the Grub Manual. 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.......

Task B : To restore the MBR

No

System

Tool required

Instructions

Note

B1

Dos or Windows

A bootable Dos floppy with fdisk.exe inside

fdisk /mbr

The floppy and CD methods are interchangeable (Own experience after repeatedly using floppy for Win2k/XP but CD on Dos)

A Win2k or XP installation CD

fixmbr

B2

Linux with Lilo

Live CD

mkdir /mnt/tmp

mount /dev/hda4 /mnt/tmp

chroot /mnt/tmp

lilo –b /dev/hda4

As an example hda4 being the Linux’s root partition

B3

Linux with Grub

Grub floppy

root (hd0,3)

setup (hd0)

As an example hda4 being the Linux’s root partition

Live CD

mkdir /mnt/tmp

mount /dev/hda4 /mnt/tmp

chroot /mnt/tmp

grub-install /dev/hda4


Task C: To boot a Dos, Windows, BSD and Solaris using a Grub floppy

No

System

Condition

Instructions

Note

C1

Single installation of Dos, Win3x, Win9x, Win2k or XP

System in the first bootable drive

root (hd0,0)

chainloader +1

makeactive

boot

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

C2

System installed in 1st bootable drive but later moved to 2nd bootable drive

root (hd1,0)

map (hd1) (hd0)

map (hd0) (hd1)

chainloader +1

makeactive

boot

C3

Multiple installations of Dos and Windows

System installed in 1st bootable drive but later moved to 4th disk and there is a MS system in the first drive

root (hd3,0)

hide (hd0,1)

unhide (hd3,0)

map (hd3) (hd0)

map (hd0) (hd3)

chainloader +1

boot

Assumed the MS system in the 1st bootable disk is hda2 or (hd0,1) to Grub. The unhide statement is to put in if the partition is liable to be hidden when booting other systems.

C4

OpenBSD, NetBSD, FreeBSD, Dragonfly BSD, Desktop BSD and PcBSD

Same as Dos/Windows systems

Same as Dos/Windows systems

Need to deny BSD access to MBR during installation to force it to place its boot loader in root partition

C5

Solaris 10 and Express

Same as Dos/Windows systems

Same as Dos/Windows systems

Need to deny Solaris access to MBR during installation to force it to place its boot loader in root partition


Task D : Make Linux chainloadable by other boot loaders (Ntldr, Lilo or Grub)

No

System

Tool

Instructions

Note

D1

Any Linux with Grub as boot loader and the root in partition hda8 (hda8 is just an example)

Grub floppy

root (hd0,7)

setup (hd0,7)

In D2 if Grub is available in the Live CD then Method C1 can be used by invoking a Grub shell. To invoke a Grub shell just type “grub” at terminal.

D2

Live CD

mkdir /mnt/tmp

mount /dev/hda8 /mnt/tmp

chroot /mnt/tmp

grub-install /dev/hda8

D3

Any Linux with Lilo as boot loader and the root in partition hda8 (hda8 is just an example)

Live CD

mkdir /mnt/tmp

mount /dev/hda4 /mnt/tmp

chroot /mnt/tmp

lilo –b /dev/hda8


D4

Any Linux that has a rescue section in the installation CD

Linux’s own installation CD

Boot up Linux installation CD and follow the rescue section to re-install the boot loader

Only work if the Linux installation CD has such a facility.

Note: In chainloading a boot loader boots another boot loader. It is the other boot loader that boots its own master. The technique is universal and used by all boot loader that can multi boot. In a nutshell the first sector (512 bytes) of the first boot loader is "cut and pasted" with the second boot loader at the second sector position..

Task E : To boot a Linux already has a boot loader inside its root partition

No

System

Tool

Instructions

Note

E1

Any Linux say with root partition hda8.

(no difference if the boot loader is Grub or Lilo)

Grub floppy

root (hd0,7)

chainloader +1

boot

See Task D on how to make a Linux chainloadable


Task F : To boot a Linux that doesn’t have a boot loader inside its root partition

No

System

Tool

Instructions

Note

F1

Any Linux say with root partition hda8.

(no difference if the boot loader is Grub or Lilo)

Grub floppy or Live CD

(1) Follow Task D to arrange Linux boot loader installed inside its root partition.

(2) Follow Task E to boot the Linix

To make the Linux chainloadable is easier for booting purpose


Task G : To boot a Linux that cannot be chainloaded

No

System

Tool

Instructions

Note

G1

Linux uses Grub and still has a menu.lst but cannot be chainloaded, assuming root partition being hda8.

Grub floppy

(1) Display Grub’s menu.lst on the screen by

cat (hd0,7)/boot/grub/menu.lst

(2) Type its content at the terminal starting with the first occurrence of a “root” statement and finish with “initrd” statement

(3) Boot the system up with this additional line

boot

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.

Live CD

mkdir /mnt/tmp

mount /dev/hda8 /mnt/tmp

ls /boot

To use the Live CD to find out the full name of vmlinuz and initrd, say they are

vmlinuz-2.6.12-9-i386

initrd-2.6.12-9-i386

Grub floppy

root (hd0,7)

kernel /boot/vmlinuz-2.6.12-9-i386 ro root=/dev/hda8

initrd /boot/initrd-2.6.12-9-i386

boot

The Linux is booted manually

Notes

(1) Some Linux cannot be chainloaded if installed at high-number partition or beyond 137Gb barrier in a hard disk.

(2) If the Linux is stubborn and refuses to boot altering “ro” to “rw” in Task G2 may be able to kick start it.

(3) If G2 the manual booting is done without passing other kernel parameters but they can be incorporated. From experience my Linux will boot without them.

-----------------end-----------------------













0 Comments:

Post a Comment

<< Home