Grub2: Difference between revisions

From Halfface
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
As an example how I would use Grub to solve the OP problem as follow.
==kali linux in grub2==
 
Store iso on standard partition.
==(1) I boot up a Grub CD (or a floppy) to get a Grub prompt.==
  menuentry "Kali Linux" {
 
    iso="/iso/kali-linux-1.0.8-amd64.iso"
==(2) I type==
    bootoptions="findiso=$iso boot=live noconfig=sudo username=root hostname=kali quiet splash"
Code:
    search --set -f $iso
As an example how I would use Grub to solve the OP problem as follow.
    loopback loop $iso
 
    linux (loop)/live/vmlinuz $bootoptions
(1) I boot up a Grub CD (or a floppy) to get a Grub prompt.
    initrd (loop)/live/initrd.img
 
  }
(2) I type
Code:
 
geometry (hd0)
 
to see the hard disk partitions layout. Since this is a Fedora C3 it must has a Type 83 partition for /boot, a Type 8e for LVM and a Type 7 for the XP. FC3 may have several Type 83 partitions if LVM is not used but the /boot is always at the front. Say the first type 83 partition is number 2 then I can fire up Fedora by
Code:
 
  root (hd0,2)
configfile /grub/grub.conf
 
--------------------------
If I want to be lazy I can ask Grub to find out which partition has grub.conf by command
Code:
 
find grub.conf
 
and use that partition reference for the above "root" command.
 
I can also restore the Grub without booting up Fedora by
Code:
 
root (hd0,2)
setup (hd0)
 
the above is exactly what would be achieved by Fedora's installation CD except it is done with a Linux and Grub can do it without a boot-up Linux.
 
Also if the Fedora still doesn't boot I can ask Grub to diaplay its cconfiguration file by
Code:
 
cat (hd0,2)/grub/grub.conf
 
I can then follow line by line to type the same command at the terminal boot Fedora "manually" and vary the parameters at the same time if needed.
 
A Grub floppy or CD can fire up the XP, say if it is in the 1st partition, by
Code:
 
  root (hd0,0)
chainloader +1
boot
 
Grub counts from 0 so hda3 is (hd0,2) and so on.
 
You see one humble Grub floppy (with only 2 files inside) or Grub CD (with only one file inside) can solve your booting problems for good!
 
[[Category:Grub]]
[[Category:Linux]]

Revision as of 20:34, 19 August 2014

kali linux in grub2

Store iso on standard partition.

menuentry "Kali Linux" {
   iso="/iso/kali-linux-1.0.8-amd64.iso"
   bootoptions="findiso=$iso boot=live noconfig=sudo username=root hostname=kali quiet splash"
   search --set -f $iso
   loopback loop $iso
   linux (loop)/live/vmlinuz $bootoptions
   initrd (loop)/live/initrd.img
}