Umgang mit redundanten Laufwerken unter OpenSUSE 13.1 (GRUB2)
| Dieser Artikel oder Teile davon wurden mit 'Review' markiert. Das bedeutet, dass größere Arbeiten am Inhalt des Artikels abgeschlossen sind und der Autor eine Korrekturlesung durch andere User zur Qualitätssicherung für angebracht hält.
Zu sichtende Teile: Kompletter Artikel Bitte hilf LinuxClubWiki, indem du den zu sichtenden Teil überprüfst und den Artikel gegebenenfalls überarbeitest! |
--Gehrke (Diskussion) 07:22, 19. Dez. 2013 (CET)
Diese Seite gehört zum Kontext Umgang mit redundanten Laufwerken (GRUB2).
Inhaltsverzeichnis
Systembeschreibung
Partitionierung:
localhost:~ # lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 8G 0 disk
├─sda1 8:1 0 509M 0 part
│ └─md0 9:0 0 509M 0 raid1 /boot
└─sda2 8:2 0 7.5G 0 part
└─md1 9:1 0 7.5G 0 raid1
└─cr_md1 253:0 0 7.5G 0 crypt
├─system-root 253:1 0 6.5G 0 lvm /
└─system-swap 253:2 0 1G 0 lvm [SWAP]
sdb 8:16 0 8G 0 disk
├─sdb1 8:17 0 509M 0 part
│ └─md0 9:0 0 509M 0 raid1 /boot
└─sdb2 8:18 0 7.5G 0 part
└─md1 9:1 0 7.5G 0 raid1
└─cr_md1 253:0 0 7.5G 0 crypt
├─system-root 253:1 0 6.5G 0 lvm /
└─system-swap 253:2 0 1G 0 lvm [SWAP]
Zustand des Arrays:
localhost:~ # cat /proc/mdstat
Personalities : [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [linear]
md0 : active raid1 sda1[0] sdb1[1]
521152 blocks super 1.0 [2/2] [UU]
bitmap: 0/1 pages [0KB], 65536KB chunk
md1 : active raid1 sda2[0] sdb2[1]
7866304 blocks super 1.0 [2/2] [UU]
bitmap: 1/1 pages [4KB], 65536KB chunk
unused devices: <none>
Details zum RAID:
localhost:~ # mdadm -Evvs
mdadm: No md superblock detected on /dev/sr0.
mdadm: No md superblock detected on /dev/md0.
mdadm: No md superblock detected on /dev/dm-2.
mdadm: No md superblock detected on /dev/dm-1.
mdadm: No md superblock detected on /dev/dm-0.
mdadm: No md superblock detected on /dev/md1.
/dev/sdb2:
Magic : a92b4efc
Version : 1.0
Feature Map : 0x1
Array UUID : cbb0a19a:3ab9c866:a55c498b:dad77155
Name : linux:1
Creation Time : Thu Dec 12 21:41:51 2013
Raid Level : raid1
Raid Devices : 2
Avail Dev Size : 15732704 (7.50 GiB 8.06 GB)
Array Size : 7866304 (7.50 GiB 8.06 GB)
Used Dev Size : 15732608 (7.50 GiB 8.06 GB)
Super Offset : 15732720 sectors
Unused Space : before=0 sectors, after=96 sectors
State : clean
Device UUID : 3643b447:54e45c14:3ffbebc4:47a1727e
Internal Bitmap : -16 sectors from superblock
Update Time : Fri Dec 13 19:37:03 2013
Bad Block Log : 512 entries available at offset -8 sectors
Checksum : 484ff8f3 - correct
Events : 155
Device Role : Active device 1
Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdb1:
Magic : a92b4efc
Version : 1.0
Feature Map : 0x1
Array UUID : ce6547f1:6bcb31bc:02c20a67:2587a62a
Name : linux:0
Creation Time : Thu Dec 12 21:41:50 2013
Raid Level : raid1
Raid Devices : 2
Avail Dev Size : 1042400 (509.07 MiB 533.71 MB)
Array Size : 521152 (509.02 MiB 533.66 MB)
Used Dev Size : 1042304 (509.02 MiB 533.66 MB)
Super Offset : 1042416 sectors
Unused Space : before=0 sectors, after=96 sectors
State : clean
Device UUID : c37e1f95:4d6611e3:a7046773:e84fa160
Internal Bitmap : -16 sectors from superblock
Update Time : Fri Dec 13 19:17:35 2013
Bad Block Log : 512 entries available at offset -8 sectors
Checksum : 4f7ccd48 - correct
Events : 21
Device Role : Active device 1
Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdb:
MBR Magic : aa55
Partition[0] : 1042432 sectors at 2048 (type fd)
Partition[1] : 15732736 sectors at 1044480 (type fd)
/dev/sda2:
Magic : a92b4efc
Version : 1.0
Feature Map : 0x1
Array UUID : cbb0a19a:3ab9c866:a55c498b:dad77155
Name : linux:1
Creation Time : Thu Dec 12 21:41:51 2013
Raid Level : raid1
Raid Devices : 2
Avail Dev Size : 15732704 (7.50 GiB 8.06 GB)
Array Size : 7866304 (7.50 GiB 8.06 GB)
Used Dev Size : 15732608 (7.50 GiB 8.06 GB)
Super Offset : 15732720 sectors
Unused Space : before=0 sectors, after=96 sectors
State : clean
Device UUID : 3a81e6b4:ea6a410b:cc3668e9:26fc95dc
Internal Bitmap : -16 sectors from superblock
Update Time : Fri Dec 13 19:37:03 2013
Bad Block Log : 512 entries available at offset -8 sectors
Checksum : 2f0653f9 - correct
Events : 155
Device Role : Active device 0
Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sda1:
Magic : a92b4efc
Version : 1.0
Feature Map : 0x1
Array UUID : ce6547f1:6bcb31bc:02c20a67:2587a62a
Name : linux:0
Creation Time : Thu Dec 12 21:41:50 2013
Raid Level : raid1
Raid Devices : 2
Avail Dev Size : 1042400 (509.07 MiB 533.71 MB)
Array Size : 521152 (509.02 MiB 533.66 MB)
Used Dev Size : 1042304 (509.02 MiB 533.66 MB)
Super Offset : 1042416 sectors
Unused Space : before=0 sectors, after=96 sectors
State : clean
Device UUID : d3a6b43b:ec7adf57:042686a4:f665aa63
Internal Bitmap : -16 sectors from superblock
Update Time : Fri Dec 13 19:17:35 2013
Bad Block Log : 512 entries available at offset -8 sectors
Checksum : 9f084160 - correct
Events : 21
Device Role : Active device 0
Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sda:
MBR Magic : aa55
Partition[0] : 1042432 sectors at 2048 (type fd)
Partition[1] : 15732736 sectors at 1044480 (type fd)
Diese grub.cfg wurde bei der Installation geschrieben:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-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
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="${saved_entry}"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
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 {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if loadfont unicode ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=
insmod gettext
fi
terminal_output gfxterm
insmod part_msdos
insmod part_msdos
insmod diskfilter
insmod mdraid1x
insmod ext2
set root='mduuid/ce6547f16bcb31bc02c20a672587a62a'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='mduuid/ce6547f16bcb31bc02c20a672587a62a' f19541aa-6e4a-4954-8c29-2ac69b9a4e21
else
search --no-floppy --fs-uuid --set=root f19541aa-6e4a-4954-8c29-2ac69b9a4e21
fi
insmod gfxmenu
loadfont ($root)/grub2/themes/openSUSE/DejaVuSans-Bold14.pf2
loadfont ($root)/grub2/themes/openSUSE/DejaVuSans10.pf2
loadfont ($root)/grub2/themes/openSUSE/DejaVuSans12.pf2
loadfont ($root)/grub2/themes/openSUSE/ascii.pf2
insmod png
set theme=($root)/grub2/themes/openSUSE/theme.txt
export theme
if [ x${boot_once} = xtrue ]; then
set timeout=0
elif sleep --interruptible 0 ; then
set timeout=8
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'openSUSE 13.1' --class 'opensuse-13-1' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-9ca3c62f-d5b8-46a7-a494-8ce2270e2f47' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod part_msdos
insmod diskfilter
insmod mdraid1x
insmod ext2
set root='mduuid/ce6547f16bcb31bc02c20a672587a62a'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='mduuid/ce6547f16bcb31bc02c20a672587a62a' f19541aa-6e4a-4954-8c29-2ac69b9a4e21
else
search --no-floppy --fs-uuid --set=root f19541aa-6e4a-4954-8c29-2ac69b9a4e21
fi
echo 'Loading Linux 3.11.6-4-desktop ...'
linux /vmlinuz-3.11.6-4-desktop root=/dev/mapper/system-root resume=/dev/system/swap splash=silent quiet showopts
echo 'Loading initial ramdisk ...'
initrd /initrd-3.11.6-4-desktop
}
submenu 'Advanced options for openSUSE 13.1' $menuentry_id_option 'gnulinux-advanced-9ca3c62f-d5b8-46a7-a494-8ce2270e2f47' {
menuentry 'openSUSE 13.1, with Linux 3.11.6-4-desktop' --class 'opensuse-13-1' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.11.6-4-desktop-advanced-9ca3c62f-d5b8-46a7-a494-8ce2270e2f47' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod part_msdos
insmod diskfilter
insmod mdraid1x
insmod ext2
set root='mduuid/ce6547f16bcb31bc02c20a672587a62a'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='mduuid/ce6547f16bcb31bc02c20a672587a62a' f19541aa-6e4a-4954-8c29-2ac69b9a4e21
else
search --no-floppy --fs-uuid --set=root f19541aa-6e4a-4954-8c29-2ac69b9a4e21
fi
echo 'Loading Linux 3.11.6-4-desktop ...'
linux /vmlinuz-3.11.6-4-desktop root=/dev/mapper/system-root resume=/dev/system/swap splash=silent quiet showopts
echo 'Loading initial ramdisk ...'
initrd /initrd-3.11.6-4-desktop
}
menuentry 'openSUSE 13.1, with Linux 3.11.6-4-desktop (recovery mode)' --class 'opensuse-13-1' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.11.6-4-desktop-recovery-9ca3c62f-d5b8-46a7-a494-8ce2270e2f47' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod part_msdos
insmod diskfilter
insmod mdraid1x
insmod ext2
set root='mduuid/ce6547f16bcb31bc02c20a672587a62a'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='mduuid/ce6547f16bcb31bc02c20a672587a62a' f19541aa-6e4a-4954-8c29-2ac69b9a4e21
else
search --no-floppy --fs-uuid --set=root f19541aa-6e4a-4954-8c29-2ac69b9a4e21
fi
echo 'Loading Linux 3.11.6-4-desktop ...'
linux /vmlinuz-3.11.6-4-desktop root=/dev/mapper/system-root showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe
echo 'Loading initial ramdisk ...'
initrd /initrd-3.11.6-4-desktop
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/20_ppc_terminfo ###
### END /etc/grub.d/20_ppc_terminfo ###
### BEGIN /etc/grub.d/30_os-prober ###
### 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 ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
### BEGIN /etc/grub.d/90_persistent ###
### END /etc/grub.d/90_persistent ###
Funktionale Tests
Test 1: Boot-Partitionen im RAID abschalten
Mit diesem Test wird der Ausfall jeweils einer Partition simuliert. Das System sollte dank der Redundanz fehlerfrei booten.
Eine Boot-Partition aus dem RAID entfernen:
localhost:~ # mdadm --set-faulty /dev/md0 /dev/sda1
mdadm: set /dev/sda1 faulty in /dev/md0
localhost:~ # cat /proc/mdstat
Personalities : [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [linear]
md0 : active raid1 sda1[0](F) sdb1[1]
521152 blocks super 1.0 [2/1] [_U]
bitmap: 0/1 pages [0KB], 65536KB chunk
...
localhost:~ # reboot
Reboot funktionierte problemlos.
Partition hinzufügen (etwas warten bis Recovery-Prozess abgeschlossen ist) und andere entfernen:
localhost:~ # mdadm --re-add /dev/md0 /dev/sda1
mdadm: re-added /dev/sda1
localhost:~ # mdadm --set-faulty /dev/md0 /dev/sdb1
mdadm: set /dev/sdb1 faulty in /dev/md0
localhost:~ # cat /proc/mdstat
Personalities : [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [linear]
md0 : active raid1 sda1[0] sdb1[1](F)
521152 blocks super 1.0 [2/1] [U_]
bitmap: 0/1 pages [0KB], 65536KB chunk
...
localhost:~ # reboot
Reboot funktionierte problemlos.
localhost:~ # mdadm --re-add /dev/md0 /dev/sdb1 mdadm: re-added /dev/sdb1
Fazit: OK
Test 2: Festplatten entfernen
Zur Simulation einer ausgefallenen Festplatte wurde vor dem Start die Festplatte aus der Konfiguration von VirtualBox entfernt.
Fall 1: Nur Festplatte 1 im System
Beobachtung: Das Menü von GRUB erscheint. Bei Start des Systems kommt es zu einer Endlosschleife, ohne dass die Passphrase für dm-crypt eingegeben werden kann:
PARTIAL MODE. Incomplete logical volumes will be processed. Volume group "system" not found No volume groups found
Fall 2: Nur Festplatte 2 im System
Beobachtung: Das Menü von GRUB erscheint nicht.
Vermutung: GRUB-Installation fehlt im MBR auf zweiter Festplatte.
Lösungsversuch 1: Installation nachgeholt:
localhost:~ # grub-install.unsupported /dev/sda Probing devices to guess BIOS drives. This may take a long time. /dev/md0 does not have any corresponding BIOS drive. localhost:~ # grub-install.unsupported /dev/sdb /dev/md0 does not have any corresponding BIOS drive.
Ergebnis: Bootet nicht.
Fehlermeldung: keine (alles schwarz, Cursor blinkt nicht)
Nachtrag 19.03.2016: Einer Leserzuschrift zufolge funktioniert hier der folgende Ansatz:
localhost:~ # grub2-install /dev/sda localhost:~ # grub2-install /dev/sdb
Leider besteht heute das zum Zeitpunkt der Erstellung dieses Artikels verwendete Systemsetup nicht mehr, so dass dies nicht mehr geprüft werden kann.
Lösungsversuch 2: Per YaST nach sda und sdb schreiben
Beim Start von Yast gibt es schon diesen Hinweis:
localhost:~ # yast2 bootloader Perl-Bootloader: 2013-12-13 22:53:57 <3> yast-1572.1 MBRTools::examineMBR.189: Error: Examine MBR cannot open /dev/md
Das explizite Schreiben über
- Boot Loader Location
- Custom Boot Partiton => /dev/sdb
sowie das ganze zusätzlich nach /dev/sda brachte nichts. Ohne die erste Disk bootete das System nicht.
Links: