GRUB 2 nebootuje z degradovaného RAID 1

Ston3

GRUB 2 nebootuje z degradovaného RAID 1
« kdy: 14. 03. 2016, 21:52:31 »
Zdravím ve spolek, chtěl bych nasadit RAID 1 a tak zkouším ve VMware různé scénáře jak se bude pole chovat.
Stále se mi nedaří nabootovat z degradovaného pole.
Instaluji Debian 8.2 na takto rozdělené disky

/dev/sda1 250 MB - linux raid
/dev/sda5 1 GB - linux raid
/dev/sda6 20 GB - linux raid

/dev/sdb1 250 MB - linux raid
/dev/sdb5 1 GB - linux raid
/dev/sdb6 20 GB - linux raid

tyto disky pak spojené do raidu vzniknou

/dev/md0 250 MB ext4 /boot
/dev/md1 1 GB swap
/dev/md2 20 GB ext4 /

zavaděč GRUB jsem při instalaci nainstaloval na disk /dev/sda
po instalaci a prvním bootu systému jsem GRUB nainstaloval i na sdb příkazem
grub-install /dev/sdb
Bohužel ale když vyřadím disk sda tak mi stroj nenabootuje :(

Prosím o radu co dělám špatně...
« Poslední změna: 14. 03. 2016, 22:45:44 od Petr Krčmář »


Re:RAID 1 GRUB 2
« Odpověď #1 kdy: 14. 03. 2016, 21:57:11 »
Bohužel ale když vyřadím disk sda tak mi stroj nenabootuje :(

Prosím o radu co dělám špatně...
Tyjo, takovej pěknej začátek a tak pokazit konec... :(

Nechtěl bys stejně pěkně popsat i co znamená "tak mi stroj nenabootuje"? Co třeba screenshot z toho VMware? To přece není tolik práce, ne?

Ston3

Re:RAID 1 GRUB 2
« Odpověď #2 kdy: 14. 03. 2016, 22:09:09 »
Ono není moc z čeho dělat printscreen, prostě bliká kurzor na černým pozadí. Nic to nepíše, nic to nedělá, žádnej systém, žádnej bootloader, nic.

samalama

Re:RAID 1 GRUB 2
« Odpověď #3 kdy: 14. 03. 2016, 22:26:33 »
RAID 1 GRUB 2 \?\?\? 3

zeby ti vmware nebootoval z dalsieho disku (sdb)...?

fedorac

Re:GRUB 2 nebootuje z degradovaného RAID 1
« Odpověď #4 kdy: 14. 03. 2016, 23:35:41 »
me vmware na linuxu prestal jet uplne, takze to nezkusim. ale urcite je lepsi se zeptat primo na forech vmware, celkem funguji


trubicoid2

Re:GRUB 2 nebootuje z degradovaného RAID 1
« Odpověď #5 kdy: 15. 03. 2016, 10:04:33 »
a ten md0 ma jaky metadata? cat /proc/mdstat
tam bylo kvuli grubu potreba dat --metadata 0.9

jinak si grub proste bude cist data z prvniho disku, co je v /boot/grub/grub.cfg?

Ston3

Re:GRUB 2 nebootuje z degradovaného RAID 1
« Odpověď #6 kdy: 15. 03. 2016, 10:57:40 »
Zaznamenal jsem nějakej pokrok.
Už mi to něco píše.

Ale více méně jsem s tím nic nedělal, jenom jsem snad znovu udělal
Kód: [Vybrat]
grub-install /dev/sdb

Pavouk106

  • *****
  • 2 395
    • Zobrazit profil
    • Můj blog
    • E-mail
Re:GRUB 2 nebootuje z degradovaného RAID 1
« Odpověď #7 kdy: 15. 03. 2016, 11:08:27 »
Nastartuj do systému (z nedegradovanýho pole) a mrkni se například pomocí ls -la, kam ukazuje to, co Ti píše, tedy:
/dev/disk/by-uuid/....

Jestli míří na nějakou pitomost (/dev/sda), tak se není čemu, divit, že to nejede... :-)

trubicoid2

Re:GRUB 2 nebootuje z degradovaného RAID 1
« Odpověď #8 kdy: 15. 03. 2016, 11:09:33 »
no, akorat chce cist z disku /dev/disks/by-uuid....
to asi neni to pole md0, nebo jo?

a metadata na md0 jsou jaky? cat /proc/mdstat

Ston3

Re:GRUB 2 nebootuje z degradovaného RAID 1
« Odpověď #9 kdy: 15. 03. 2016, 11:21:11 »
metadata jsou v.1.2
uuid ktere to nemuze najit je zarizeni md2 ktere ma byt pripojene jako / (root)

Ston3

Re:GRUB 2 nebootuje z degradovaného RAID 1
« Odpověď #10 kdy: 15. 03. 2016, 11:24:15 »
Ještě přidávám obrázek, to nahoře je
Kód: [Vybrat]
ls -la /dev/disk/by-uuid/

Ston3

Re:GRUB 2 nebootuje z degradovaného RAID 1
« Odpověď #11 kdy: 15. 03. 2016, 11:30:16 »
ještě výpis grub.cfg
už to není obrázek, debugoval jsem síť ve vmware a už mi jede SSH :-)

Kód: [Vybrat]
root@debian:~# 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
  set have_grubenv=true
  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="0"
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 [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos
insmod part_msdos
insmod diskfilter
insmod mdraid1x
insmod ext2
set root='mduuid/e8b86af491b164c186e96a8cc3aa183f'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint='mduuid/e8b86af491b164c186e96a8cc3aa183f'  feda4d52-aaae-47a8-a3fa-c1d4a6d9f51e
else
  search --no-floppy --fs-uuid --set=root feda4d52-aaae-47a8-a3fa-c1d4a6d9f51e
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=-1
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
    set timeout=5
  # Fallback normal timeout code in case the timeout_style feature is
  # unavailable.
  else
    set timeout=5
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
        set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-feda4d52-aaae-47a8-a3fa-c1d4a6d9f51e' {
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_msdos
        insmod part_msdos
        insmod diskfilter
        insmod mdraid1x
        insmod ext2
        set root='mduuid/06812a671e67403fb3d71ef586923f55'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint='mduuid/06812a671e67403fb3d71ef586923f55'  02c134f7-a13d-4781-9232-8ac3cf8d3f49
        else
          search --no-floppy --fs-uuid --set=root 02c134f7-a13d-4781-9232-8ac3cf8d3f49
        fi
        echo    'Loading Linux 3.16.0-4-amd64 ...'
        linux   /vmlinuz-3.16.0-4-amd64 root=UUID=feda4d52-aaae-47a8-a3fa-c1d4a6d9f51e ro  quiet
        echo    'Loading initial ramdisk ...'
        initrd  /initrd.img-3.16.0-4-amd64
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-feda4d52-aaae-47a8-a3fa-c1d4a6d9f51e' {
        menuentry 'Debian GNU/Linux, with Linux 3.16.0-4-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-4-amd64-advanced-feda4d52-aaae-47a8-a3fa-c1d4a6d9f51e' {
                load_video
                insmod gzio
                if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
                insmod part_msdos
                insmod part_msdos
                insmod diskfilter
                insmod mdraid1x
                insmod ext2
                set root='mduuid/06812a671e67403fb3d71ef586923f55'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint='mduuid/06812a671e67403fb3d71ef586923f55'  02c134f7-a13d-4781-9232-8ac3cf8d3f49
                else
                  search --no-floppy --fs-uuid --set=root 02c134f7-a13d-4781-9232-8ac3cf8d3f49
                fi
                echo    'Loading Linux 3.16.0-4-amd64 ...'
                linux   /vmlinuz-3.16.0-4-amd64 root=UUID=feda4d52-aaae-47a8-a3fa-c1d4a6d9f51e ro  quiet
                echo    'Loading initial ramdisk ...'
                initrd  /initrd.img-3.16.0-4-amd64
        }
        menuentry 'Debian GNU/Linux, with Linux 3.16.0-4-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-4-amd64-recovery-feda4d52-aaae-47a8-a3fa-c1d4a6d9f51e' {
                load_video
                insmod gzio
                if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
                insmod part_msdos
                insmod part_msdos
                insmod diskfilter
                insmod mdraid1x
                insmod ext2
                set root='mduuid/06812a671e67403fb3d71ef586923f55'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint='mduuid/06812a671e67403fb3d71ef586923f55'  02c134f7-a13d-4781-9232-8ac3cf8d3f49
                else
                  search --no-floppy --fs-uuid --set=root 02c134f7-a13d-4781-9232-8ac3cf8d3f49
                fi
                echo    'Loading Linux 3.16.0-4-amd64 ...'
                linux   /vmlinuz-3.16.0-4-amd64 root=UUID=feda4d52-aaae-47a8-a3fa-c1d4a6d9f51e ro single
                echo    'Loading initial ramdisk ...'
                initrd  /initrd.img-3.16.0-4-amd64
        }
}

### 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 ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###

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

Pavouk106

  • *****
  • 2 395
    • Zobrazit profil
    • Můj blog
    • E-mail
Re:GRUB 2 nebootuje z degradovaného RAID 1
« Odpověď #12 kdy: 15. 03. 2016, 11:39:51 »
Před pár lety bylo potřeba mít metadata 0.90 (alespoň na /boot, zbytek už byl si myslím fuk).

Mimochodem - jsem debil/prase, když v grub.cfg mám jen totoM
Kód: [Vybrat]
setparams blablabla {
  nějakej disk
  nějaký jádro
}

Ston3

Re:GRUB 2 nebootuje z degradovaného RAID 1
« Odpověď #13 kdy: 15. 03. 2016, 11:40:29 »
Dám sem i textovej výpis, pro lepší hledání.

Kód: [Vybrat]
root@debian:~# ls -la /dev/disk/by-uuid/
total 0
drwxr-xr-x 2 root root 120 Feb 14 07:13 .
drwxr-xr-x 6 root root 120 Feb 14 07:13 ..
lrwxrwxrwx 1 root root   9 Feb 14 07:13 02c134f7-a13d-4781-9232-8ac3cf8d3f49 -> ../../md0
lrwxrwxrwx 1 root root   9 Feb 14 07:13 2015-09-06-11-12-07-00 -> ../../sr0
lrwxrwxrwx 1 root root   9 Feb 14 07:13 7a8c8e66-f470-4c88-860e-300efe490952 -> ../../md1
lrwxrwxrwx 1 root root   9 Feb 14 07:13 feda4d52-aaae-47a8-a3fa-c1d4a6d9f51e -> ../../md2

Kód: [Vybrat]
root@debian:~# cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 sda6[0] sdb6[1]
      7806976 blocks super 1.2 [2/2] [UU]
      bitmap: 1/1 pages [4KB], 65536KB chunk

md1 : active (auto-read-only) raid1 sdb5[1] sda5[0]
      975296 blocks super 1.2 [2/2] [UU]

md0 : active raid1 sdb1[1] sda1[0]
      242496 blocks super 1.2 [2/2] [UU]
      bitmap: 0/1 pages [0KB], 65536KB chunk

unused devices: <none>

Ston3

Re:GRUB 2 nebootuje z degradovaného RAID 1
« Odpověď #14 kdy: 15. 03. 2016, 11:42:50 »
Před pár lety bylo potřeba mít metadata 0.90 (alespoň na /boot, zbytek už byl si myslím fuk).

Mimochodem - jsem debil/prase, když v grub.cfg mám jen totoM
Kód: [Vybrat]
setparams blablabla {
  nějakej disk
  nějaký jádro
}
V jednoduchostí je síla, bohužel ale GRUB 2 (můj) už je generovaný podle obsahu adresáře /etc/grub.d/
Kód: [Vybrat]
root@debian:~# ls -la /etc/grub.d/
total 80
drwxr-xr-x  2 root root  4096 Feb 14 06:40 .
drwxr-xr-x 72 root root  4096 Feb 14 07:18 ..
-rwxr-xr-x  1 root root  9424 Mar 23  2015 00_header
-rwxr-xr-x  1 root root  6058 Mar 23  2015 05_debian_theme
-rwxr-xr-x  1 root root 12261 Mar 23  2015 10_linux
-rwxr-xr-x  1 root root 11082 Mar 23  2015 20_linux_xen
-rwxr-xr-x  1 root root 11692 Mar 23  2015 30_os-prober
-rwxr-xr-x  1 root root  1416 Mar 23  2015 30_uefi-firmware
-rwxr-xr-x  1 root root   214 Mar 23  2015 40_custom
-rwxr-xr-x  1 root root   216 Mar 23  2015 41_custom
-rw-r--r--  1 root root   483 Mar 23  2015 README