Punto informatico Network
Login Esegui login | Non sei registrato? Iscriviti ora (è gratuito!)
Username: Password:
  • Annuncio Pubblicitario

[Kubuntu] Impostare GRUB (con Windows) - GUIDA Step by Step

Per chi muove i primi passi nel mondo del pinguino

[Kubuntu] Impostare GRUB (con Windows) - GUIDA Step by Step

Messaggioda M@ttia » gio ago 10, 2006 12:00 pm

Ok, visto che ho già letto più di un messaggio che chiedeva 'Step by Step' come fare ad impostare il boot manager GRUB per impostare Windows come predefinito, accorciarne in timeout predefinito, ecc. posto qui un messaggio con la procedura Step by Step per modificare il file di Configurazione di Grub con i Parametri (fatto su Kubuntu, idem su Ubuntu ma credo valga anche su altre Distro).

La mia procedura si limita ad usare la Shell solo per avere i privilegi di amministratore, ma poi usa l'interfaccia grafica, quindi va bene anche per i meno esperti [^].


  1. Andiamo in /boot/grub e copiamoci il file menu.lst (il file su cui faremo tutto!) sul Desktop.
    Facciamoci anche un Backup per qualsiasi evenienza...
  2. Apriamo il File sul Desktop con un Qualsiasi editor di Testo e prepariamoci ad Editarlo (ricordiamoci che tutte le righe che iniziano con il simbolo # verranno IGNORATE da Grub, quindi è come se non esistessero, ma sono solo commenti per la comodità dell'utente "umano" che legge...). Ciò che risulta fuori dal box 'code' seguente è ciò che ho cambiato o comunque ciò che dovete assicurarvi sia così nel vostro File o val la pena di personalizzare [^]:

    Codice: Seleziona tutto
    # menu.lst - See: grub(8), info grub, update-grub(8)
    #            grub-install(8), grub-floppy(8),
    #            grub-md5-crypt, /usr/share/doc/grub
    #            and /usr/share/doc/grub-doc/.


    default saved # Importante il 'saved' se dopo volete ci sia un OS (Windows, ecc...) come Predefinito

    Codice: Seleziona tutto
    # Set the default entry to the entry number NUM. Numbering starts from 0, and
    # the entry number 0 is the default if the command is not used...
    #
    # You can specify 'saved' instead of a number. In this case, the default entry
    # is the entry saved with the command 'savedefault'.
    # WARNING: If you are using dmraid do not change this entry to 'saved' or your
    # array will desync and will not let you boot your system.
    #default   0

    ## timeout sec
    # Set a timeout, in SEC seconds, before automatically booting the default entry
    # (normally the first entry defined).

    timeout 5 # N° di sec. che attende per la scelta prima di avviare l'OS predefinito!

    # Qui sotto 2 Impostazioni: se volete nascondere i Menu di default o cambiare la combinazione di Colori (non indispensabili ma comunque personalizzabili...)

    Codice: Seleziona tutto
    ## hiddenmenu
    # Hides the menu by default (press ESC to see the menu)
    #hiddenmenu

    # Pretty colours
    #color light-gray/blue black/light-gray

    ## password ['--md5'] passwd
    # If used in the first section of a menu file, disable all interactive editing
    # control (menu entry editor and command-line)  and entries protected by the
    # command 'lock'
    # e.g. password topsecret
    #      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
    # password topsecret

    #
    # examples
    #
    # title      Windows 95/98/NT/2000
    # root      (hd0,0)
    # makeactive
    # chainloader   +1
    #
    # title      Linux
    # root      (hd0,1)
    # kernel   /vmlinuz root=/dev/hda2 ro
    #

    #
    # Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

    ### BEGIN AUTOMAGIC KERNELS LIST
    ## lines between the AUTOMAGIC KERNELS LIST markers will be modified
    ## by the debian update-grub script except for the default options below

    ## DO NOT UNCOMMENT THEM, Just edit them to your needs

    ## ## Start Default Options ##
    ## default kernel options
    ## default kernel options for automagic boot options
    ## If you want special options for specific kernels use kopt_x_y_z
    ## where x.y.z is kernel version. Minor versions can be omitted.
    ## e.g. kopt=root=/dev/hda1 ro
    ##      kopt_2_6_8=root=/dev/hdc1 ro
    ##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
    # kopt=root=/dev/sda3 ro

    ## default grub root device
    ## e.g. groot=(hd0,0)
    # groot=(hd0,2)

    ## should update-grub create alternative automagic boot options
    ## e.g. alternative=true
    ##      alternative=false
    # alternative=true

    ## should update-grub lock alternative automagic boot options
    ## e.g. lockalternative=true
    ##      lockalternative=false
    # lockalternative=false

    ## additional options to use with the default boot option, but not with the
    ## alternatives
    ## e.g. defoptions=vga=791 resume=/dev/hda5
    # defoptions=quiet splash

    ## altoption boot targets option
    ## multiple altoptions lines are allowed
    ## e.g. altoptions=(extra menu suffix) extra boot options
    ##      altoptions=(recovery mode) single
    # altoptions=(recovery mode) single

    ## controls how many kernels should be put into the menu.lst
    ## only counts the first occurence of a kernel, not the
    ## alternative kernel options
    ## e.g. howmany=all
    ##      howmany=7
    # howmany=all

    ## should update-grub create memtest86 boot option
    ## e.g. memtest86=true
    ##      memtest86=false
    # memtest86=true

    ## should update-grub adjust the value of the default booted system
    ## can be true or false
    # updatedefaultentry=false

    ## ## End Default Options ##


    # Ora Impostiamo Windows Come primo della Lista e di Default, poi Linux. Io ne ho lasciato solo una "versione" e non tutte quelle che ci sono normalmente.
    # Ovviamente come parametri qui ci sono i miei, mentre voi limitatevi a lasciare i vostri che già ci sono (è soltanto una modifica, non stiamo creando nulla...).
    # Per non cancellare righe, aggiungete soltanto un # all'inizio della Riga...


    title Windows XP Professional
    root (hd0,0)
    makeactive
    savedefault
    # Verificare che ci sia: lo fa essere quello di Default (se lo si vuole)!
    chainloader +1

    title Kubuntu
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.15-26-386 root=/dev/sda3 ro quiet splash
    initrd /boot/initrd.img-2.6.15-26-386
    boot


    Codice: Seleziona tutto
    #title      Ubuntu, kernel 2.6.15-26-386 (recovery mode)
    #root      (hd0,2)
    #kernel      /boot/vmlinuz-2.6.15-26-386 root=/dev/sda3 ro single
    #initrd      /boot/initrd.img-2.6.15-26-386
    #boot

    #title      Ubuntu, memtest86+
    #root      (hd0,2)
    #kernel      /boot/memtest86+.bin
    #boot

  3. Fatto questo non ci resta che salvare la copia nuova modificata di menu.lst in /boot/grub, ma purtroppo non possiamo farlo dall'interfaccia grafica, poiché per quella cartella servono i privilegi di amministratore.

    Per effettuare l'operazione Apriamo il Terminal (la shell) e digitiamo:

    Shell ha scritto:mattia@PCMattia:~$ sudo -s
    Password: (nota: inserite la password ma non appare nulla, premete enter)

    root@PCMattia:~#



    Ora siete loggati come Super User (==> Privilegi Alti)
    Spostatevi nella cartella Desktop e copiamo finalmente questo nostro File in /boot/grub :

    Shell ha scritto:root@PCMattia:~# cd Desktop

    root@PCMattia:~/Desktop# cp menu.lst /boot/grub/



Esultando dalla Vittoria non ci resta che rebootare per trovarci finalmente il nostro Bootmanager come lo desideravamo!

Buon booting a tutti! [^]
</IE><FIREFOX>
Avatar utente
M@ttia
Moderatore
Moderatore
 
Messaggi: 8363
Iscritto il: lun giu 09, 2003 2:18 pm
Località: Ticino - Estero

Messaggioda NinoRapis » lun mag 14, 2007 4:52 am

ciao, ragazzi
ho appena finito di installare ubuntu 7.4, e sembra che sia andato tutto bene.
vorrei anche io di default fare partire Windows XP, ho capito che bisogna cambiare il numero di default ma non so con quale.(penso che sia 3, ma non sono sicuro)
vi posto il contenuto del mio file menu.lst :
Codice: Seleziona tutto
# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default      0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout      10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title      Windows 95/98/NT/2000
# root      (hd0,0)
# makeactive
# chainloader   +1
#
# title      Linux
# root      (hd0,1)
# kernel   /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=7359cd4d-73f9-4788-80f8-add46a3178df ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,2)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash locale=it_IT

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## ## End Default Options ##

title      Ubuntu, kernel 2.6.20-15-generic
root      (hd0,2)
kernel      /boot/vmlinuz-2.6.20-15-generic root=UUID=7359cd4d-73f9-4788-80f8-add46a3178df ro quiet splash locale=it_IT
initrd      /boot/initrd.img-2.6.20-15-generic
quiet
savedefault

title      Ubuntu, kernel 2.6.20-15-generic (recovery mode)
root      (hd0,2)
kernel      /boot/vmlinuz-2.6.20-15-generic root=UUID=7359cd4d-73f9-4788-80f8-add46a3178df ro single
initrd      /boot/initrd.img-2.6.20-15-generic

title      Ubuntu, memtest86+
root      (hd0,2)
kernel      /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title      Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title      Microsoft Windows XP Home Edition
root      (hd0,0)
savedefault
makeactive
chainloader   +1



ps: vorrei ridurre anche il tempo per l'auto avvio...per quello basta solo modificare il valore 10 del TIMEOUT ?
Avatar utente
NinoRapis
Senior Member
Senior Member
 
Messaggi: 177
Iscritto il: ven dic 09, 2005 3:14 pm

Messaggioda Pacopas » lun mag 14, 2007 1:09 pm

NinoRapis ha scritto:vorrei anche io di default fare partire Windows XP, ho capito che bisogna cambiare il numero di default ma non so con quale.(penso che sia 3, ma non sono sicuro)


cambia lo 0 che ti ho evidenziato in rosso con un 4

# array will desync and will not let you boot your system.
default 0


questo perché la numerazione parte da 0 e l'ingresso di windows è la 4 infatti sono (spero di non dire corbellerie)
Codice: Seleziona tutto
title      Ubuntu, kernel 2.6.20-15-generic

title      Ubuntu, kernel 2.6.20-15-generic (recovery mode)

title      Ubuntu, memtest86+

title      Other operating systems:

title      Microsoft Windows XP Home Edition



NinoRapis ha scritto: vorrei ridurre anche il tempo per l'auto avvio...per quello basta solo modificare il valore 10 del TIMEOUT ?


si in questo punto

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10
alla fine... ogni uomo considera i limiti della propria visione personale come i limiti del mondo...
Avatar utente
Pacopas
Membro Ufficiale (Gold)
Membro Ufficiale (Gold)
 
Messaggi: 6708
Iscritto il: mer ott 05, 2005 12:44 am


Re: [Kubuntu] Impostare GRUB (con Windows) - GUIDA Step by S

Messaggioda myrtle » lun feb 25, 2008 1:31 pm

M@ttia ha scritto:Esultando dalla Vittoria non ci resta che rebootare per trovarci finalmente il nostro Bootmanager come lo desideravamo!

Buon booting a tutti! [^]


Salve
io ho modificato il file come è scritto sopra, però deve essere andato storto qualcosa, visto che linux non si avvia + ma mi da errore, mi fa tornare alla schermata del grub e posso avviare solo windows. cosa posso fare? grazie!
Avatar utente
myrtle
Neo Iscritto
Neo Iscritto
 
Messaggi: 5
Iscritto il: lun feb 25, 2008 1:22 pm

Messaggioda Aesir » lun feb 25, 2008 7:20 pm

Ma tu hai sostituito tutto il contenuto del file originario?
WINDOS -- Windos Is Not a Decent Operating System
Avatar utente
Aesir
Bronze Member
Bronze Member
 
Messaggi: 607
Iscritto il: mer dic 05, 2007 6:06 pm
Località: Prov. di Milano

Messaggioda myrtle » lun feb 25, 2008 7:29 pm

Aesir ha scritto:Ma tu hai sostituito tutto il contenuto del file originario?

no, ho modificato il timeout, messo default saved, poi ho messo windows al primo posto, e ho commentato linux recovery mode e memtest.
comunque ora non parte più, cosa posso fare? anche perché qualsiasi possibile correzione posso farla solo da linux
Avatar utente
myrtle
Neo Iscritto
Neo Iscritto
 
Messaggi: 5
Iscritto il: lun feb 25, 2008 1:22 pm

Messaggioda Aesir » lun feb 25, 2008 7:47 pm

qual' è l'errore che grub restituisce?

ad ogni modo puoi controllare che non ti sia scappato qualche errore di battitura semplicemente digitando "e" nel menu di boot con la voce di linux evidenziata, così ti apre una finestra per modificare temporaneamente (solo per l'avvio corrente) il paragrafo del menu.lst riguardante linux.
WINDOS -- Windos Is Not a Decent Operating System
Avatar utente
Aesir
Bronze Member
Bronze Member
 
Messaggi: 607
Iscritto il: mer dic 05, 2007 6:06 pm
Località: Prov. di Milano

Messaggioda myrtle » lun feb 25, 2008 10:52 pm

Aesir ha scritto:qual' è l'errore che grub restituisce?

ad ogni modo puoi controllare che non ti sia scappato qualche errore di battitura semplicemente digitando "e" nel menu di boot con la voce di linux evidenziata, così ti apre una finestra per modificare temporaneamente (solo per l'avvio corrente) il paragrafo del menu.lst riguardante linux.

Codice: Seleziona tutto
errore 11
unrecognized device string

ho provato a digitare e e mi viene fuori questo

root(hd0,6)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=c47d76e6-341c-4807
initrd /boot/initrd.img-2.6.22-14-generic
quiet
root
Avatar utente
myrtle
Neo Iscritto
Neo Iscritto
 
Messaggi: 5
Iscritto il: lun feb 25, 2008 1:22 pm

Messaggioda NinoRapis » mar feb 26, 2008 1:04 am

ho fatto una ricerca veloce con google

guardaci un po [;)]
Avatar utente
NinoRapis
Senior Member
Senior Member
 
Messaggi: 177
Iscritto il: ven dic 09, 2005 3:14 pm

Messaggioda myrtle » mar feb 26, 2008 1:09 am

NinoRapis ha scritto:ho fatto una ricerca veloce con google

guardaci un po [;)]
e mi dovrebbe aiutare?
Avatar utente
myrtle
Neo Iscritto
Neo Iscritto
 
Messaggi: 5
Iscritto il: lun feb 25, 2008 1:22 pm

Messaggioda Aesir » mar feb 26, 2008 2:11 pm

Codice: Seleziona tutto
root(hd0,6)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=c47d76e6-341c-4807
initrd /boot/initrd.img-2.6.22-14-generic
quiet
root


Nel codice si ripete due volte root che è quello che genera l'errore (il secondo root senza argomenti "sovrascrive" il primo.

Quindi per partire devi cancellare dalla finestra edit quel ultima stringa e poi premere "b" per fare il boot.

Se così riesci a partire modifica il file menu.lst da root e rimuovila permanentemente.

Ciao!
WINDOS -- Windos Is Not a Decent Operating System
Avatar utente
Aesir
Bronze Member
Bronze Member
 
Messaggi: 607
Iscritto il: mer dic 05, 2007 6:06 pm
Località: Prov. di Milano

Messaggioda myrtle » mar feb 26, 2008 3:30 pm

Aesir ha scritto:Nel codice si ripete due volte root che è quello che genera l'errore (il secondo root senza argomenti "sovrascrive" il primo.

Quindi per partire devi cancellare dalla finestra edit quel ultima stringa e poi premere "b" per fare il boot.

Se così riesci a partire modifica il file menu.lst da root e rimuovila permanentemente.

Ciao!

ho risolto così, grazie mille!
Avatar utente
myrtle
Neo Iscritto
Neo Iscritto
 
Messaggi: 5
Iscritto il: lun feb 25, 2008 1:22 pm


Torna a NewBie

Chi c’è in linea

Visitano il forum: Nessuno e 3 ospiti

Powered by phpBB © 2002, 2005, 2007, 2008 phpBB Group
Traduzione Italiana phpBB.it

megalab.it: testata telematica quotidiana registrata al Tribunale di Cosenza n. 22/09 del 13.08.2009, editore Master New Media S.r.l.; © Copyright 2008 Master New Media S.r.l. a socio unico - P.I. 02947530784. GRUPPO EDIZIONI MASTER Spa Tutti i diritti sono riservati. Per la pubblicità: Master Advertising