Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Joined
    Jun 2004
    Location
    Newcastle upon Tyne, UK
    Age
    70
    Posts
    585

    Booting tips based on Live CD and Grub floppy

    I have summarised the booting tips after installing over 100 systems in the PC.

    I survived by only three tools

    (1) A Linux Live CD (favourite is Slax as it has no fear of large disks and high-number partitions)

    (2) A bootable Grub floppy (empty inside and unattached to an operating system with only stage1 & stage2 in the boot sector)

    (3) A Dos 6.22 bootable floppy with fdisk.exe inside (for restore MBR for DOS and MS Windows systems.

    The tips are good enough to boot any Linux as long as technically it is bootable, even without a boot loader and/or installed in a high-number partition or in a large hard disk not originally designed for.
    ------------------------------------------------------------------

    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)
    Code:
    geometry (hd0)
    A2: Ask Grub to report any partition that has Grub inside
    Note : /boot/grub is the designated location for storing Grub’s menu.lst
    Code:
    find /boot/grub/menu.lst
    A3: Ask Grub to report a partition that has Lilo inside
    Note : /etc/lilo.conf is the designated Lilo’s configuration file
    Code:
    find /etc/lilo.conf
    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)
    Code:
    cat (hd0,7)/boot/grub/menu.lst
    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
    Code:
    cat (hd0,7)/etc/lilo.conf
    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
    Code:
    configfile (hd0,7)/boot/grub/menu.lst 
    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)".
    Code:
    root (hd0,5)
    setup (hd0)
    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.
    Code:
    fdisk /mbr
    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
    Code:
    fixmbr
    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.
    Code:
    mkdir /mnt/temp
    mount /dev/hda4 /mnt/temp
    chroot /mnt/temp
    lilo –b /dev/hda
    B4: To restore Grub from Linux partition hda4 into MBR by Grub floppy
    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).
    Code:
    root (hd0,3)
    setup (hd0)
    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.
    Code:
    mkdir /mnt/temp
    mount /dev/hda4 /mnt/temp
    chroot /mnt/temp
    grub-install /dev/hda
    Task C: To boot Dos, Windows, BSD or Solaris using a Grub floppy
    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.
    Code:
    root (hd0,0)
    chainloader +1
    makeactive
    boot
    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.
    Code:
    root (hd1,0)
    map (hd1) (hd0)
    map (hd0) (hd1)
    chainloader +1
    makeactive
    boot
    C3: To boot multiple installations of Dos and Windows by Grub floppy
    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.
    Code:
    root (hd3,1)
    hide (hd3,0)
    unhide (hd3,1)
    map (hd3) (hd0)
    map (hd0) (hd3)
    chainloader +1
    boot
    C4: OpenBSD, NetBSD, FreeBSD, Dragonfly BSD, Desktop BSD and PcBSD
    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
    Code:
    Same as Dos/Windows system, see Task C1
    C5: Solaris 10 and Express
    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
    Code:
    Same as Dos/Windows system, see Task C1

  2. #2
    Joined
    Jun 2004
    Location
    Newcastle upon Tyne, UK
    Age
    70
    Posts
    585

    Re: Booting tips based on Live CD and Grub floppy

    Task D : Make a Linux chainloadable by Ntldr, Lilo or Grub
    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.
    Code:
    root (hd0,7)
    setup (hd0,7)
    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.
    Code:
    mkdir /mnt/temp
    mount /dev/hda8 /mnt/temp
    chroot /mnt/temp
    grub-install /dev/hda8
    D3: To make a Linux "chainloadable in partition hda8 with Lilo by a Live CD
    Note : If Lilo fails you may have to boot the system up manually by Grub. See Tasks F & G
    Code:
    mkdir /mnt/temp
    mount /dev/hda8 /mnt/temp
    chroot /mnt/temp
    lilo –b /dev/hda8
    D4: To make Linux chainloadable that has a rescue section in the installation CD
    Note : Only works if the Linux installation CD has such a facility. The principle steps used are similar to Tasks D2 & D3.
    Code:
    Boot up the Linux installation CD
    follow the instructions to re-install the boot loader
    and choose the root partition as the destination
    Task E : To boot a Linux with a boot loader inside its root partition
    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
    Code:
    root (hd0,7)
    chainloader +1
    boot
    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
    Code:
    root (hd0,7)
    chainloader +1
    boot
    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
    Code:
    other=/dev/hda8
    label=Linux_in_hda8
    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)
    Code:
    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
    
    In Windows
    
    cd \
    attrib -r -s -h boot.ini
    edit 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
    Task F : To boot a Linux with no boot loader inside its root partition
    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.
    Code:
    (1) Follow Task D to install boot loader inside Linux root partition
    (2) Follow Task E to boot the Linix
    Task G : To boot a Linux that cannot be chainloaded (initially by a Grub floppy)
    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.
    Code:
    (1) To display Grub’s menu.lst on the screen by
    
    cat (hd0,7)/boot/grub/menu.lst
    
    (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
    
    boot
    G2: Any Linux that uses Grub or Lilo as the boot loader, assuming root partition being hda8.
    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.
    Code:
    Stage (1) to obtain kernel and initrd filenames
    
    mkdir /mnt/tmp
    mount /dev/hda8 /mnt/tmp
    ls /boot
    
    Stage (2) to boot the Linux directly
    
    root (hd0,7)
    kernel /boot/vmlinuz-2.6.15-8-i386 ro root=/dev/hda8
    initrd /boot/initrd-2.6.15-8-i386
    boot
    Task H : Possible tasks with a Linux Live CD on an unbootable Linux

    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
    Code:
    mkdir /mnt/hda9
    mount /dev/hda9 /mnt/hda9
    H2: To get inside the unbootable Linux in 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
    Code:
    mkdir /mnt/hda9
    mount /dev/hda9 /mnt/hda9
    chroot /mnt/hda9
    Task J : Possible alternatives to obtain a Grub prompt to help booting
    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.
    Code:
    press "c" to trigger a Grub prompt
    J2: From a Linux with a Grub menu with option to edit the menu "hidden"
    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.
    Code:
    (1) Edit the Linux's /boot/grub/menu.ls
    (2) Put a "#" in front of the "fgxmenu" statement
    (3) Follow instruction of Task J1
    For those interested - I am breaching the thread size limit here and so new additions will be added to the link at the bottom of my signature instead
    Last edited by saikee; 02-19-2006 at 05:32 AM.

  3. #3
    Joined
    Jan 2003
    Location
    Iowa
    Age
    42
    Posts
    770

    Re: Booting tips based on Live CD and Grub floppy

    wonderful.

    here comes the problem.

    system has sata raid0 on ich5r. linux sees it as two drives. bios order of drives is sata radi, then pata drive. how to make both bootable from one system? grub is on mbr of pata, windows boot loader on mbr of raid.

  4. #4
    Joined
    Jun 2004
    Location
    Newcastle upon Tyne, UK
    Age
    70
    Posts
    585

    Re: Booting tips based on Live CD and Grub floppy

    Think you have to choose a Linux that supports your RAID system.

    Must admit I broke up my RAID to avoid the problem because I was interested in installing a large number of Linux into the box and speed wasn't what I after.

    I believe Grub works on the information handed down by the BIOS and so you can test if Grub has got the RAID right or not by testing it with the "geometry" command (Task A1 of the booting tips). You should test it prior to booting into Linux.

    I got the feeling it should work out as Grub can operate unattached to an operating system and only counts the disk number in the order given by the BIOS.

    If you look at the Task C1 to C3 the only information Grub needs to boot a Windows is the partition reference. So if geometry command turns up ony one disk for the Raid you are home dry in booting up Windows. If the Linux can't recognise the RAID then it is a matter outside the control of Grub and should not be treated as a booting problem.

  5. #5
    Joined
    Jul 2001
    Location
    UK
    Age
    51
    Posts
    20,229

    Re: Booting tips based on Live CD and Grub floppy

    Great post saikee - a GRUB manual even I can understand

    Thanks,

    Ned

  6. #6
    Joined
    Jun 2004
    Location
    Newcastle upon Tyne, UK
    Age
    70
    Posts
    585

    Re: Booting tips based on Live CD and Grub floppy

    Ned,

    That is because I nicked the material from Post #23 done by you from this thread.

    I re-brand it as Task E4.

    So next round is on me.

  7. #7
    Joined
    Jan 2003
    Location
    Iowa
    Age
    42
    Posts
    770

    Re: Booting tips based on Live CD and Grub floppy

    Linux can recognize RAID with dmraid utility. Thank you for your help, i'll play around with the GRUB. Yeah that was foolish of me to believe GRUB sees drives same way as the linux kernel does.

  8. #8
    Joined
    Jul 2001
    Location
    UK
    Age
    51
    Posts
    20,229

    Re: Booting tips based on Live CD and Grub floppy

    Quote Originally Posted by saikee
    Ned,

    That is because I nicked the material from Post #23 done by you from this thread.

    I re-brand it as Task E4.

    So next round is on me.

    LOL - didn't notice that bit. I can't remember who I nicked it from originally, but that's how I first set up my dual boots (with lilo on RH 7) when learning linux before I realised GRUB is so much better

  9. #9
    Joined
    Dec 2000
    Posts
    5,051

    Re: Booting tips based on Live CD and Grub floppy

    Quick note about on-board raid controllers, there bios based software raid and aren't fully recognized by nix based systems. ( There designed to work in windows enviroments and most of the companies refuse to provide a means to hook the bios from nix.)

    Best way to handle this is to not use the raid bios to build a raid set, then use software raid setup for nix.

  10. #10
    Joined
    Jan 2003
    Location
    Iowa
    Age
    42
    Posts
    770

    Re: Booting tips based on Live CD and Grub floppy

    Quote Originally Posted by Bryan
    Quick note about on-board raid controllers, there bios based software raid and aren't fully recognized by nix based systems. ( There designed to work in windows enviroments and most of the companies refuse to provide a means to hook the bios from nix.)

    Best way to handle this is to not use the raid bios to build a raid set, then use software raid setup for nix.
    That doesn't work for ones that use windows on raid as well.

  11. #11
    Joined
    Dec 2000
    Posts
    5,051

    Re: Booting tips based on Live CD and Grub floppy

    That doesn't work for ones that use windows on raid as well.
    I'd advise using seperate raid sets between different OS anyways.

  12. #12
    Joined
    Oct 2001
    Location
    Southern Ontario
    Age
    45
    Posts
    13,194

    Re: Booting tips based on Live CD and Grub floppy

    If you really need RAID, you should invest in a proper Hardware RAID card. But be warned, they aren't cheep.

  13. #13
    Joined
    Jan 2003
    Location
    Iowa
    Age
    42
    Posts
    770

    Re: Booting tips based on Live CD and Grub floppy

    saikee, are you dude from the article ?
    http://www.theinquirer.net/?article=29647

  14. #14
    Joined
    Jun 2004
    Location
    Newcastle upon Tyne, UK
    Age
    70
    Posts
    585

    Re: Booting tips based on Live CD and Grub floppy

    Yep,

    Bad news travels fast! doesn't it?

    The booting tips on this thread are the end product of the 100+ system thread.

    Someone in the last 48 hours published the information in Digg of the 100+ systems in JustLinux and my thread was viewed by 20,000 in just two days.

    Hope I haven't brought any bad publicity to this forum.

    Good job this forum limits the size of a thread otherwise the 100+ systems thread could have been mounted here.

    You guys are still friends?

  15. #15
    Joined
    Oct 2001
    Location
    Southern Ontario
    Age
    45
    Posts
    13,194

    Re: Booting tips based on Live CD and Grub floppy

    Congrats on the artical! I just finished reading it.

    Yeah, too bad it wasn't linked here. But at least you are.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •