Grub

From I.N.F.N. Wiki
Jump to: navigation, search

mkdir disk

mount /dev/sda1 disk # sda1 deve contenere la partizione root e la partizione boot

  1. mount /dev/sda2 disk/boot # solo se la partizione di boot è separata

mount --bind /dev/ disk/dev/

mount -t proc none disk/proc

chroot disk /bin/bash

grub-install /dev/sda # se il disco su cui installare è sda


Altro esempio GRUB

Le cose fatte sono state le seguenti:
1) Boot con tomsrtbt linux.
2) Mount della root di linux (hda3 nel caso) sotto /mnt/hda3/
3) chroot /mnt/hda3
4) /sbin/grub

> Probing devices to guess BIOS drives. This may take a long time.
> GRUB version 0.92 (640K lower / 3072K upper memory)
> Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions.
> Anywhere else TAB lists the possible [completions of a device/filename. ]

> grub> root (hd0,2)
> Filesystem type is ext2fs, partition type 0x83
> grub> setup (hd0)
> Checking if "/boot/grub/stage1" exists... yes
> Checking if "/boot/grub/stage2" exists... yes
> Checking if "/boot/grub/e2fs_stage1_5" exists... yes
> Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 22 sectors are embedded.
> succeeded
> Running "install /boot/grub/stage1 (hd0) (hd0)1+22 p (hd0,2)/boot/grub/stage2
> /boot/grub/grub.conf"........

> grub> quit

5) exit
6) umount /dev/hda3
7) reboot