• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

[gelöst] Grub: Frage zu map und hide

Hein06

Member
Hallo

Ich habe 2 Festplatten mit 3 Betriebssystemen: Festplatte 1 mit Vista und Suse 11.1, Festplatte 2 mit WinXp. Yast hat das auch richtig erkannt und das Booten funktioniert. Hier meine aktuelle menu.list :
# Modified by YaST2. Last modification on Do Dez 25 23:14:02 UTC 2008
default 0
timeout 8
gfxmenu (hd0,5)/boot/message

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.1 - 2.6.27.7-9
root (hd0,5)
kernel /boot/vmlinuz-2.6.27.7-9-default root=/dev/disk/by-id/ata-SAMSUNG_HD501LJ_S0MUJ1KLB12899-part6 resume=/dev/disk/by-id/ata-SAMSUNG_HD501LJ_S0MUJ1KLB12899-part5 splash=silent showopts vga=0x31a
initrd /boot/initrd-2.6.27.7-9-default

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.1 - 2.6.27.7-9
root (hd0,5)
kernel /boot/vmlinuz-2.6.27.7-9-default root=/dev/disk/by-id/ata-SAMSUNG_HD501LJ_S0MUJ1KLB12899-part6 showopts ide=nodma apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x31a
initrd /boot/initrd-2.6.27.7-9-default

###Don't change this comment - YaST2 identifier: Original name: windows 1###
title Vista
map (hd0) (hd0)
map (hd0) (hd0)
rootnoverify (hd0,0)
makeactive
chainloader +1

###Don't change this comment - YaST2 identifier: Original name: windows 2###
title WinXP
map (hd1) (hd0)
map (hd0) (hd1)
rootnoverify (hd1,0)
makeactive
chainloader +1

Nun möchte ich aber , daß sich die beiden Windows Systeme nicht gegeseitig sehen. Ich habe im Wiki gelesen , daß es dafür die Befehle hide und unhide gibt. Mir ist aber nicht klar, wird zuerst gemappt und dann versteckt ? Und, wenn ja , was wird versteckt , das gemappte oder das Original ?

Schöne Weihnachten

Heinz
 

pingu!

Member
Hallo Heinz,
Das maping und hide beim Grub sind unterschiedliche Parameter.
Das mapping ist bei OS notwending, bei denen die Harddisk auf der das OS installiert ist (meistens Windows) auf der primären Platte installiert sein muss, damit es booten kann.
damit wird Windows vorgekaukelt, dass es auf der primären disk ist.

map:
Map the drive from_drive to the drive to_drive. This is necessary when you chain-load some operating systems, such as DOS, if such an OS resides at a non-first drive.
This performs a virtual swap between your first and second hard drive.

z.b bei Deiner XP config:

title WinXP
map (hd1) (hd0)
map (hd0) (hd1)

rootnoverify (hd1,0)
makeactive
chainloader +1

Das hide und unhide wird gebraucht, (wie Du schon erwähnt hast) um Partitionen sichtbar oder nicht sichtbar zu machen.

hide:
Hide the partition partition by setting the hidden bit in its partition type code. This is useful only when booting DOS or Windows and multiple primary FAT partitions exist in one disk

unhide:
Unhide the partition partition by clearing the hidden bit in its partition type code. This is useful only when booting DOS or Windows and multiple primary partitions exist in one disk.

Wenn Du nun möchtest, dass sich beide Windows partitionen sehen, so ändere die Grub-config (boot/grub/menu.lst) folgendermassen:
Code:
title Vista
hide (hd1,0)
rootnoverify (hd0,0)
makeactive
chainloader +1

###Don't change this comment - YaST2 identifier: Original name: windows 2###
title WinXP
map (hd1) (hd0)
map (hd0) (hd1)
hide (1,0)
rootnoverify (hd1,0)
makeactive
chainloader +1

"Vesteckt" wir die Partition, bei der Du im file menu.lst die hide section hinzufügst. Es wird die gemapte partition "versteckt".

ps. Vorher noch ein save vom file /boot/grub/menu.lst machen... damit wenns schief geht noch ein save vorhanden ist....

rgds pingu!
 
OP
H

Hein06

Member
Hallo
Nach einigem Try and error bin ich zu folgender Lösung gekommen:
# Modified by YaST2. Last modification on Do Dez 25 23:14:02 UTC 2008
default 0
timeout 8
gfxmenu (hd0,5)/boot/message

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.1 - 2.6.27.7-9
unhide (hd0,0)
unhide (hd1,0)
unhide (hd1,1)
root (hd0,5)
kernel /boot/vmlinuz-2.6.27.7-9-default root=/dev/disk/by-id/ata-SAMSUNG_HD501LJ_S0MUJ1KLB12899-part6 resume=/dev/disk/by-id/ata-SAMSUNG_HD501LJ_S0MUJ1KLB12899-part5 splash=silent showopts vga=0x31a
initrd /boot/initrd-2.6.27.7-9-default

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.1 - 2.6.27.7-9
root (hd0,5)
kernel /boot/vmlinuz-2.6.27.7-9-default root=/dev/disk/by-id/ata-SAMSUNG_HD501LJ_S0MUJ1KLB12899-part6 showopts ide=nodma apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x31a
initrd /boot/initrd-2.6.27.7-9-default

###Don't change this comment - YaST2 identifier: Original name: windows 1###
title Vista
unhide (hd0,0)
map (hd0) (hd0)
map (hd0) (hd0)
hide (hd1,0)
hide (hd1,1)
rootnoverify (hd0,0)
makeactive
chainloader +1

###Don't change this comment - YaST2 identifier: Original name: windows 2###
title WinXP
unhide (hd1,0)
unhide (hd1,1)
map (hd1) (hd0)
map (hd0) (hd1)
hide (hd0,0)
rootnoverify (hd1,0)
makeactive
chainloader +1

Heinz
 

pingu!

Member
Hi,
title Vista
unhide (hd0,0)
map (hd0) (hd0)
map (hd0) (hd0)
hide (hd1,0)
hide (hd1,1)
rootnoverify (hd0,0)
makeactive
chainloader +1
Das Mapping von: map (hd0) (hd0) muss nicht sein. Macht keinen Sinn ein map von / zu der selben Disk zu machen..
Auch unhide (hd0,0) ist nicht notwending.
title WinXP
unhide (hd1,0)
unhide (hd1,1)
map (hd1) (hd0)
map (hd0) (hd1)
hide (hd0,0)
rootnoverify (hd1,0)
makeactive
chainloader +1
Ist auf die 2 partition von der 2 Disk (hd1,1) der Zugriff von XP notwendig?
Die Einträge stören aber nicht all zu sehr. Hauptsache es funktioniert wie es gewünscht wurde.
rgds pingu!
 
Oben