[Boot] Aggiungere voci a GRUB 2
Inviato: sabato 8 gennaio 2011, 17:45
Con la funzione ricerca ho trovato varie discussioni su argomenti simili (tipo chi voleva aggiungere Haiku ecc.), ma queste non avevano risposte, pertanto ne ho aperta una nuova.
Ho letto la guida di Streetcross e quella "base" in inglese; mi pare che differiscano un po', ad esempio quella inglese non menziona nessun 30_os-multiboot.
Problema:
-aggiungere voce Windows a GRUB2
-capire come aggiungere voci generiche a GRUB2 e come modificarne l'ordine
PC:
disco 1: Windows 7, Windows XP
disco 2: Ubuntu 10.04
Ho avviato lo script 30_os-prober
poi ho dato update-grub
Ma all'avvio c'è solo Ubuntu 10.04.
Poi da Gestione Disco vedo che Ubuntu è su sdb5, ossia hd1,5 in linguaggio grub.
Però quando avvio Ubuntu da GRUB2 vedo "loading (hd0,4)", il che significa che non sta considerando il disco di Windows (sda) e non riesco a spiegarmi quel "4": anche se fosse l'unico disco attaccato, la 5° partizione è la 5, non la 4.
Perchè come scritto sulla guida inglese:
[quote=""GRUB 2 Basic Guide"]Note the new partition naming convention. Devices start counting from "0" as done previously. sda is designated as "hd0", sdb is "hd1", etc. However the first partition is now designated as sda1. Counting partitions does not start with "0". sda5 is "5".[/quote]
Ho provato ad aggiungere in 40_custom le voci viste lanciando os-prober:
Ma continua a non funzionare.
A questo punto ho esaurito le idee.
EDIT: quel che non capisco è perchè, aldilà di possibili errori, NON appaia nessuna voce aggiuntiva nel menù!!!
Con GRUB 1 se anche sbagliavo la sintassi, mi appariva la voce, ovviamente non partiva o dava errori, ma la voce si vedeva
Ho letto la guida di Streetcross e quella "base" in inglese; mi pare che differiscano un po', ad esempio quella inglese non menziona nessun 30_os-multiboot.
Problema:
-aggiungere voce Windows a GRUB2
-capire come aggiungere voci generiche a GRUB2 e come modificarne l'ordine
PC:
disco 1: Windows 7, Windows XP
disco 2: Ubuntu 10.04
Ho avviato lo script 30_os-prober
Codice: Seleziona tutto
$ sudo sh 30_os-prober
Found Windows 7 (loader) on /dev/sda1
menuentry "Windows 7 (loader) (on /dev/sda1)" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 0b748fc80b532f5a
chainloader +1
}
Found Windows 7 (loader) on /dev/sda2
menuentry "Windows 7 (loader) (on /dev/sda2)" {
insmod ntfs
set root='(hd0,2)'
search --no-floppy --fs-uuid --set 5ef2dbfdf2dbd77d
chainloader +1
}Codice: Seleziona tutto
$ sudo update-grub
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.32-27-generic
Found kernel: /boot/vmlinuz-2.6.32-26-generic
Found GRUB 2: /boot/grub/core.img
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... donePoi da Gestione Disco vedo che Ubuntu è su sdb5, ossia hd1,5 in linguaggio grub.
Però quando avvio Ubuntu da GRUB2 vedo "loading (hd0,4)", il che significa che non sta considerando il disco di Windows (sda) e non riesco a spiegarmi quel "4": anche se fosse l'unico disco attaccato, la 5° partizione è la 5, non la 4.
Perchè come scritto sulla guida inglese:
[quote=""GRUB 2 Basic Guide"]Note the new partition naming convention. Devices start counting from "0" as done previously. sda is designated as "hd0", sdb is "hd1", etc. However the first partition is now designated as sda1. Counting partitions does not start with "0". sda5 is "5".[/quote]
Ho provato ad aggiungere in 40_custom le voci viste lanciando os-prober:
Codice: Seleziona tutto
$ cat 40_custom
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
#! /bin/sh -e
menuentry "7" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 0b748fc80b532f5a
chainloader +1
}
menuentry "XP" {
insmod ntfs
set root='(hd0,2)'
search --no-floppy --fs-uuid --set 5ef2dbfdf2dbd77d
chainloader +1
}A questo punto ho esaurito le idee.
EDIT: quel che non capisco è perchè, aldilà di possibili errori, NON appaia nessuna voce aggiuntiva nel menù!!!
Con GRUB 1 se anche sbagliavo la sintassi, mi appariva la voce, ovviamente non partiva o dava errori, ma la voce si vedeva