• 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] Boot-Reihenfolge festlegen

Hallo!

Ich habe einen Debian 5.0 Server, in dem ich einen Raid Controller eingebaut habe:
Code:
server:~# lspci
...
01:00.0 RAID bus controller: 3ware Inc 9650SE SATA-II RAID (rev 01)
...

Dieser läuft auch ganz prima. An ihm hängen zwei Platten im RAID 1 die Partitionen für Root-, /home- sowie /srv enthalten. Zusätzlich habe ich eine 1,5 TB-Platte direkt am Motherboard (also NICHT am RAID-Controller) hängen, die für Videos u.ä. gedacht ist. Also Zeugs, das nicht gespiegelt werden muss und bei dem es egal ist, wenn es über den Jordan geht.

Das sieht insgesamt so aus:
Code:
server:~# fdisk -l

Disk /dev/sda: 749.9 GB, 749988741120 bytes
255 heads, 63 sectors/track, 91180 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000d365b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        4863    39062016   83  Linux
/dev/sda2            4864       17021    97659135   83  Linux
/dev/sda3           17022       90964   593947147+  83  Linux
/dev/sda4           90965       91201     1903702+  82  Linux swap / Solaris

Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x49ecfeba

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      182401  1465136001   83  Linux
server:~#
/dev/sda ist also das RAID 1 mit "/", "/home" und "/srv" und /dev/sdb die "Video"-Platte. Nun habe ich folgendes Problem:

Wenn ich reboote, erkennt GRUB sehr korrekt das Boot-Flag und zeigt mir die menu.lst an. Sobald er aber anfangen will, den Kernel zu booten fällt er auf die Nase, weil er nix mehr zum Booten findet. Ziehe ich vor dem Booten die Video-Platte ab, funktioniert alles wunderbar. Hier -auszugsweise- die menu.lst:
Code:
title           Debian GNU/Linux, kernel 2.6.26-2-amd64
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-2-amd64 root=/dev/sda1 ro
initrd          /boot/initrd.img-2.6.26-2-amd64

Ich denke also, dass ich irgendwie dem GRUB mitteilen muss, dass er doch bitte den RAID-Controller als (hd0,0) betrachten soll und nicht die Video-Festplatte, die halt direkt am Motherboard hängt. Wie bekomme ich das hin? Ich habe leider keinerlei Idee, wie ich das ansetzen soll?

Hier noch die /proc/scsi/scsi, die zeigt, dass der RAID als scsi0 erkannt wird und das die Video-Platte völlig korrekt am scsi2-Kanal hängt:
Code:
server:~# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: AMCC     Model: 9650SE-4LP DISK  Rev: 4.06
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi2 Channel: 00 Id: 00 Lun: 00
  Vendor: ATA      Model: WDC WD15EADS-00P Rev: 01.0
  Type:   Direct-Access                    ANSI  SCSI revision: 05
server:~#
 

towo

Moderator
Teammitglied
1. Zeig die komplette menu.lst
2. benutz uuid an Stelle von /dev/sdxy in der Kernel-Zeile.
 
Die komplette menu.lst:
Code:
server:~# cat /boot/grub/menu.lst
# 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         5

# 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=/dev/sda1 ro

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

## 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=

## 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=(single-user) single
# altoptions=(single-user 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

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title           Debian GNU/Linux, kernel 2.6.26-2-amd64
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-2-amd64 root=/dev/sda1 ro
initrd          /boot/initrd.img-2.6.26-2-amd64

title           Debian GNU/Linux, kernel 2.6.26-2-amd64 (single-user mode)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-2-amd64 root=/dev/sda1 ro single
initrd          /boot/initrd.img-2.6.26-2-amd64

title           Debian GNU/Linux, kernel 2.6.26-1-amd64
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-1-amd64 root=/dev/sda1 ro
initrd          /boot/initrd.img-2.6.26-1-amd64

title           Debian GNU/Linux, kernel 2.6.26-1-amd64 (single-user mode)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-1-amd64 root=/dev/sda1 ro single
initrd          /boot/initrd.img-2.6.26-1-amd64

title           Debian GNU/Linux, kernel memtest86+
root            (hd0,0)
kernel          /boot/memtest86+.bin

### END DEBIAN AUTOMAGIC KERNELS LIST
server:~#

Ok, die UUID hole ich mir wie folgt:
Code:
server:~# tune2fs -l /dev/sda1
tune2fs 1.41.3 (12-Oct-2008)
Filesystem volume name:   <none>
Last mounted on:          <not available>
Filesystem UUID:          3ce62f8f-02d9-4e06-bf03-2d3982287e82
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal resize_inode dir_index filetype needs_recovery sparse_super large_file
Filesystem flags:         signed_directory_hash
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              4889248
Block count:              9765504
Reserved block count:     488275
Free blocks:              8518213
Free inodes:              4812746
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      1021
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         16352
Inode blocks per group:   511
Filesystem created:       Thu Mar 13 23:26:49 2008
Last mount time:          Sun Nov 29 22:06:13 2009
Last write time:          Sun Nov 29 22:06:13 2009
Mount count:              8
Maximum mount count:      25
Last checked:             Sun Nov 29 16:22:42 2009
Check interval:           15552000 (6 months)
Next check after:         Fri May 28 17:22:42 2010
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               128
Journal inode:            8
First orphan inode:       3924670
Default directory hash:   tea
Directory Hash Seed:      fd536c74-0ba4-4fe7-a833-245722eedaef
Journal backup:           inode blocks
server:~#

Ok, die UUID ist also 3ce62f8f-02d9-4e06-bf03-2d3982287e82

Wie trage ich die nun in die menu.lst ein? :???: In den Manuals (grub, grub-install, update-grub) habe ich leider nix gefunden... :(
 

towo

Moderator
Teammitglied
In der menu.lst
Code:
# kopt=root=/dev/sda1 ro
ändern in
Code:
# kopt=root=UUID=3ce62f8f-02d9-4e06-bf03-2d3982287e82 ro

Dann update-grub ausführen.
 
Volltreffer, das hat geklappt und läuft prima! Vielen, vielen Dank für die präzise und schnelle Hilfe! :)

Der Vollständigkeit halber - so sieht die menu.lst jetzt aus:
Code:
server:~# cat /boot/grub/menu.lst
# 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         5

# 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=3ce62f8f-02d9-4e06-bf03-2d3982287e82 ro

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

## 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=

## 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=(single-user) single
# altoptions=(single-user 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

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title           Debian GNU/Linux, kernel 2.6.26-2-amd64
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-2-amd64 root=UUID=3ce62f8f-02d9-4e06-bf03-2d3982287e82 ro
initrd          /boot/initrd.img-2.6.26-2-amd64

title           Debian GNU/Linux, kernel 2.6.26-2-amd64 (single-user mode)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-2-amd64 root=UUID=3ce62f8f-02d9-4e06-bf03-2d3982287e82 ro single
initrd          /boot/initrd.img-2.6.26-2-amd64

title           Debian GNU/Linux, kernel 2.6.26-1-amd64
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-1-amd64 root=UUID=3ce62f8f-02d9-4e06-bf03-2d3982287e82 ro
initrd          /boot/initrd.img-2.6.26-1-amd64

title           Debian GNU/Linux, kernel 2.6.26-1-amd64 (single-user mode)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-1-amd64 root=UUID=3ce62f8f-02d9-4e06-bf03-2d3982287e82 ro single
initrd          /boot/initrd.img-2.6.26-1-amd64

title           Debian GNU/Linux, kernel memtest86+
root            (hd0,0)
kernel          /boot/memtest86+.bin

### END DEBIAN AUTOMAGIC KERNELS LIST
server:~#
 
Eine Frage habe ich nun allerdings noch:

Wenn nun eine Platte aus dem Array ausfällt und ersetzt werden muss, ändert sich dann nicht auch die UUID? Oder ist die UUID nun die des Raid-Controllers?
 
Ok, die Frage ist beantwortet: Die ID ist die des Controllers. Zumindest änderte sie sich nicht, als ich eine der beiden Platten austauschte. ;)

Nochmal vielen Dank für die Hilfe! :)
 
Oben