Emidio Planamente 's Homepage

Home GNU/Linux Programming Technology Sport Others Contact

Search

  Google linux


Debian

  Apt-get
  Debian Anatomy
  Debian Backports
  Debian Help
  Debian Planet
  Debian Swiss
  History of Debian
  Getdeb
  Kernel
  Kernel 2.6
  Packages
  Refcard for newbie
  Reference book
  SATA raid
  Weekly News


Official Docs

  Distrowatch
  Firewire
  Gimp
  Gimp Photo Archive
  Linuxdoc
  Linuxdoc Reference
  Linux Focus
  Linux From Scratch
  Linux Hacks
  Linux Hardware
  Linux Printing
  MySQL
  O'Reilly
  Rute
  Source Forge
  USB guide


Installation

  Instalinux
  Preseed


Laptop

  Linux on Laptops
  Linux Toshiba
  Tux Mobil


Live-CDs

  Create it Your self
  Knoppix
  Kororaa XGL 3


Pictures

  Bay13
  Gnomelook
  Kuznetsov


Security

  GNU/Linux
  PortsDB


Linux based product

  Dreambox


Free web service

  S5 presents


Against Micro$oft

  Combatti Micro$oft
  Microsuck


HTML validator CSS validator

 

GRUB micro howto


1. Introduction

2. Installation

3. Rescue

4. Tips and tricks

5. Configuration

6. Useful command


1. Introduction


1.1. TAB autocompletion


Typing:


  root (


and pressing TAB will display all possible partitions.


1.2. Accessing file


To specify the file /vmlinuz on the first partition on first hd:


  (hd0,0)/vmlinuz


2. Installation


Installing GRUB on the system is not enough.


2.1. Installing GRUB on /boot


This step is mandatory.


Type:


  grub-install


This will copy the boot images from /lib/grub/i386-pc to /boot/grub.


On Debian system this is automatically done installing the grub package.


2.2. Installing on MBR


To install GRUB on Master Boot Record, type:


  root (hd0,0)

  setup (hd0)


2.3. Installing in boot sector of a partition


To install GRUB in the boot sector of a partition without touching MBR, type:


  root (hd0,0)

  setup (hd0,0)


3. Rescue


3.1. Making a GRUB bootable CD


  mkdir -p iso/boot/grub

  cp /lib/grub/i386-pc/stage2_eltorito iso/boot/grub


eventually make a menu


  vi iso/boot/grub/menu.lst


Make ISO image:


  mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot \

          -boot-load-size 4 -boot-info-table -o grub.iso iso


Burn image grub.iso


3.2. Booting from GRUB shell


Given the following configuration:


/dev/hda1 is /boot

/dev/hda2 is /


Set root device:


  root (hd0,0)


Load kernel:


  kernel /vmlinuz-2.6.11-myhost root=/dev/hda2 vga=ext


initrd /initrd-2.6.11-myhost


Load modules:


  module


or


  modulenounzip


If the "kernel" command is called, modules has to be manually reloaded!


Start boot process:


  boot


4. Tips and tricks


4.1. Colors


The colors can be changed with the following commands:


  - foreground = RRGGBB

  - background = RRGGBB


where RR, GG and BB are hex values for red, green and blue.


4.2. Splashimage


The configuration is very easy. Just place the splashimage somewhere, for example in /boot/grub/splash and add the following line to /etc/grub/menu.lst


  splashimage=(hd0,0)/boot/grub/splash/debian-gnu.xpm.gz


Logically, replace(hd0,0) for your needs.


You can create your own splashimages. Just do the following things and follow the previous explained description:


  - open an image

  - resize it to 640x480 (with Gimp: Image -> Scale image)

  - reduce color scale to 14 (with Gimp: Image -> Mode -> Indexed)

  - save as .xpm

  - compress the image with gzip image.xpm


Alternatively, you can download some already existing splash images from here: http://ruslug.rutgers.edu/~mcgrof/grub-images/images.


For a detailed howto, take a look here: http://ruslug.rutgers.edu/~mcgrof/grub-images.


4.3. Updating harddisk configuration


The harddisk configuration is saved in


  /boot/grub/device.map


Review this file before using grub.


4.4. Trying new kernel


Take a look at http://www.gnu.org/software/grub/manual/grub.html#Making-your-system-robust.


4.5. Downloading OS images from network


Take a look at http://www.gnu.org/software/grub/manual/grub.html#Network


5. Configuration


5.1. default


Set the default item to boot.


For example:


  default 0


will boot the first item present in /boot/grub/menu.lst.


5.2. fallback


If the default boot item cannot be booted, try this one.


For example:


  default 0

  fallback 1


tries first item 0. If it fails, then tries item 1.


6. Useful command


6.1. root


Specifies the partition where the boot images are placed.


If /boot is a own partition, you have to specify this partition and not the / partition!!!


6.2. kernel


Load the kernel.


For example:


  kernel /vmlinuz-2.6.8-myhost


6.3. module


Load module file.


6.4. modulenounzip


Load module file without automatic decompression.


6.5. boot


Boot the loaded OS.


6.6. makeactive


Not really clear:


Set the active partition on the root disk to GRUB's root device. This command is limited to primary PC partitions on a hard disk.


6.7. savedefault


Not really clear.


6.8. mbchk


The program mbchk checks for the format of a Multiboot kernel. We recommend using this program before booting your own kernel by GRUB.



Emidio Planamente

Last modified on 2005-11-27