Anmelden

Archiv verlassen und diese Seite im Standarddesign anzeigen : Grub 2 - Problem mit Debian Squeeze und XP



LLex
10.02.11, 13:45
Hallo zusammen,

habe ein Problem mit GRUB 2.

Ich habe hier einen ASUS eee 1000HE, auf das ich zusätzlich zum Win XP jetzt Debian Squeeze installiert habe. Linux läuft problemlos, aber wenn ich versuche, XP zu booten, wird leider nicht die normale XP-Partition gestartet, sondern die Wiederherstellungspartition für XP. Grub hat irgendwie da was verwechselt :(

Hier die Details. Das Gerät hat aktuell folgende Partitionen:


root@eee:/# fdisk -lu

Disk /dev/sda: 160.0 GB, 160041885696 bytes
214 heads, 54 sectors/track, 27049 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x9358c633

Device Boot Start End Blocks Id System
/dev/sda1 * 54 151129367 75564657 7 HPFS/NTFS
/dev/sda2 151130110 302245887 75557889 5 Extended
/dev/sda3 302247180 312497351 5125086 1c Hidden W95 FAT32 (LBA)
/dev/sda4 312497352 312578243 40446 ef EFI (FAT-12/16/32)
/dev/sda5 151130112 287848447 68359168 83 Linux
/dev/sda6 287850496 302245887 7197696 82 Linux swap / Solaris


/dev/sda1 ist die normale XP-Partition, /dev/sda3 ist das, was Grub im Auswahlmenü anbietet.

Grub ist in folgender Version installiert:


root@eee:/# dpkg --list | grep grub
ii grub-common 1.98+20100804-14 GRand Unified Bootloader, version 2 (common files)
ii grub-pc 1.98+20100804-14 GRand Unified Bootloader, version 2 (PC/BIOS version)


Hier die Konfigurationsdatei von Grub (was anderes hab jedenfalls nicht gefunden, insb. eine menu.lst Datei existiert nicht).

Warum steht da in der zweiten Zeile eigentlich "DO NOT EDIT" drin, wenn ganz am Ende steht, dass man Änderungen leicht durch Anfügen vornehmen kann? Darf man die Datei jetzt verändern oder nicht? :confused:


root@eee:/# cat /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function load_video {
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set ea849384-2823-46e0-a4e8-ca3c3d189b3e
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set ea849384-2823-46e0-a4e8-ca3c3d189b3e
set locale_dir=($root)/boot/grub/locale
set lang=de
insmod gettext
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set ea849384-2823-46e0-a4e8-ca3c3d189b3e
insmod png
if background_image /usr/share/images/desktop-base/spacefun-grub.png; then
set color_normal=light-gray/black
set color_highlight=white/black
else
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-686' --class debian --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set ea849384-2823-46e0-a4e8-ca3c3d189b3e
echo 'Loading Linux 2.6.32-5-686 ...'
linux /boot/vmlinuz-2.6.32-5-686 root=UUID=ea849384-2823-46e0-a4e8-ca3c3d189b3e ro quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-5-686
}
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-686 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set ea849384-2823-46e0-a4e8-ca3c3d189b3e
echo 'Loading Linux 2.6.32-5-686 ...'
linux /boot/vmlinuz-2.6.32-5-686 root=UUID=ea849384-2823-46e0-a4e8-ca3c3d189b3e ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-5-686
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows NT/2000/XP (on /dev/sda3)" {
insmod part_msdos
insmod fat
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set cced-990e
drivemap -s (hd0) ${root}
chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# 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.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###


Wäre schön, wenn mir jemand sagen könnte, wie der Eintrag menuentry {...} korrekt lauten müsste, damit XP von /dev/sda1 in der Auswahl erscheint und gebootet werden kann.

Danke für alle Tips,

Alex

LLex
10.02.11, 15:04
So, Problem ist gelöst. Das Script /etc/grub.d/30_os-prober hat offensichtlich nicht alles an die grub.cfg übermittelt. Ich hab

./etc/grub.d/30_os-prober

als root ausgeführt und das Ergebnis, in dem jetzt eine weitere Win-Partition gelistet war, einfach in die grub.cfg unterhalb von 40_custom eingetragen.

Beim Neustart war dann auch XP bootbar.

Gruß, Alex