Přeskočit na obsah

GRUB

Z Wikiverzity

grub je zavaděč linuxu a dalších operačních systémů. Pro novou verzi existuje stránka GRUB2.

info

[editovat]
  • Package: grub
  • Manual: info grub

Commands:

  • /bin/mbchk Multiboot check: ... moc to nechápu
  • /bin/mkbimage Make a Bootable IMAGE using GRUB as a bootloader
  • /sbin/grub
  • /sbin/grub-install
  • /sbin/grub-md5-crypt
  • /sbin/grub-terminfo
  • /sbin/update-grub program to generate GRUB's menu.lst file
  • /sbin/grub-floppy
  • /sbin/grub-reboot

DIARY:

  • 2005-02-05.Sat ... základní postup
  • 2005-02-06.Sun ... windoze
  • 2005-03-05.Sat ... @ALU
  • 2005-03-06.Sun ... @ALU
  • 2005-03-08.Tue ... z disketty, např. pro diskless

Basic terms:

  • (hd0,0) hda1

Instalace

[editovat]

Nativní instalace

[editovat]
  • Kopíruju grub na floppy:
cd /lib/grub/i386-pc
dd if=stage1 of=/dev/fd0 bs=512 count=1
dd if=stage2 of=/dev/fd0 bs=512 seek=1
  • Rebootuju
grub>

root (hd0,3)                    reknu mu, kde ma root directory
                                pred zavorkou musi byt mezera
    Filesystem type is ext2fs, partition type 0x836

                                kdyz to nevim, najdu si ji:
find /boot/grub/stage1
    (hd0,3)

setup (hd0)                     instaluje GRUB do MBR
setup (hd0,0)                   instaluje do 1. partition

Pomoci skriptu grub-install

[editovat]
grub-install /dev/hda           instaluje GRUB do MBR
grub-install /dev/hda1          instaluje GRUB do 1.partition?
  • Na diskettu:
# superformat --superverify /dev/fd0

# mke2fs /dev/fd0
# mount -t ext2 /dev/fd0 /mnt
# grub-install --root-directory=/mnt fd0
    Probing devices to guess BIOS drives. This may take a long time.
    cdrom: open failed.
    SCSI subsystem initialized
    Installation finished. No error reported.
    This is the contents of the device map /mnt/boot/grub/device.map.
    Check if this is correct or not. If any of the lines is incorrect,
    fix it and re-run the script `grub-install'.
    (fd0)   /dev/fd0
    (hd0)   /dev/hda

# cd /mnt/boot/grub
# ls -l
    celkem 160
    -rw-r--r--  1 root root     30 2005-02-05 13:58 device.map
    -rw-r--r--  1 root root   7776 2005-02-05 13:58 e2fs_stage1_5
    -rw-r--r--  1 root root   7504 2005-02-05 13:58 fat_stage1_5
    -rw-r--r--  1 root root   8320 2005-02-05 13:58 jfs_stage1_5
    -rw-r--r--  1 root root   7008 2005-02-05 13:58 minix_stage1_5
    -rw-r--r--  1 root root   9216 2005-02-05 13:58 reiserfs_stage1_5
    -rw-r--r--  1 root root    512 2005-02-05 13:58 stage1
    -rw-r--r--  1 root root 108168 2005-02-05 14:00 stage2
    -rw-r--r--  1 root root   9288 2005-02-05 13:58 xfs_stage1_5

# umount /mnt

Musim tam jeste dokopirovat menu.lst ? Můžu si ho udělat:


Jak bootuju z grub>

[editovat]
kernel /vmlinuz root=/dev/hda1
initrd /initrd.img
boot

Anebo:

kernel /boot/vmlinuz-2.6.3-1-386 root=/dev/hda1
initrd /boot/initrd.img-2.6.3-1-386
boot

Kdyz mam na prvni partition DOS a na druhe Windows a chci bootovat DOS:

grub> unhide (hd0,0)
grub> hide (hd0,1)
grub> rootnoverify (hd0,0)
grub> chainloader +1
grub> makeactive
grub> boot

Kdyz chci bootovat Windoze z druhe partition:

grub> unhide (hd0,1)
grub> hide (hd0,0)
grub> rootnoverify (hd0,1)
grub> chainloader +1
grub> makeactive
grub> boot