r3 - 18 Aug 2005 - 17:28:05 - IuriDinizYou are here: TWiki >  Personal Web  > GrubBootLoader

GRUB

Instalar GRUB em uma imagem .img

No bash:

#!/bin/sh
# criar uma imagem vazia
dd if=/dev/zero of=imagem144.img bs=512 count=2880

# formatar imagem
mkfs.ext2 imagem144.img

# montar imagem
mkdir MNT
sudo mount imagem144.img MNT/ -o loop

#criar diretórios necessários
mkdir MNT/boot
mkdir MNT/boot/grub/

#copiar o grub
cp /boot/grub/stage[12] MNT/boot/grub/

#criar ou copiar um menu
cp /usr/share/doc/grub/examples/menu.lst MNT/boot/grub

#finjir que o (fd0) eh a imagem
echo "(fd0) ./imagem144.img" > device.map

# gravar alterações no disco
sync
sync

# desmontar imagem 
umount MNT

# Executar o grub
grub --device-map=device.map

No GRUB:

root (fd0)
install (fd0)/boot/grub/stage1 (fd0) (fd0)/boot/grub/stage2 (fd0)/boot/grub/menu.lst
quit

Testar:

#!/bin/sh
qemu -fda imagem144.img -boot a
  • Qemu:
    Qemu

-- IuriDiniz - 03 Jul 2005

Problemas

Problema: Grub não da boot no segundo HD com windows

Solução: Finja que ele é o primeiro

rootnoverify (hd1,0)
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1
boot

(hd1,0) -> Primeira partição do segundo HD

Referências: manual do GRUB

Instalar Grub

sudo grub --no-floppy

root (hd0,0)
install (hd0,0)/boot/grub/stage1 (hd0) (hd0,0)/boot/grub/stage2 
quit

Os comandos acima não funcionaram no xfs comigo. eu usei:

root (hd0,0)
setup (hd0)
quit

-- IuriDiniz - 03 Jul 2005

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r3 < r2 < r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback