boot de invasão de software degradado

5

Instalei o Ubuntu 12.04.1 em um novo servidor e configurei 4 discos rígidos com 3 dispositivos RAID 1, a configuração é tal que as duas primeiras unidades têm md0 (espaço de troca) e md1 (/) com o terceira e quarta unidades tendo md2 (/ var).

Eu tenho testado a operação em uma falha de unidade e descobri que o sistema inicializa bem se eu remover o disco dois, mas se eu remover o disco um, o sistema será reiniciado e reinicializado. Estou confuso sobre por que o grub parece estar carregando corretamente do disco dois, mas a inicialização falha.

Eu tentei copiar o MBR do disco 1 para o 2:

dd if=/dev/sda of=/dev/sdb bs=512 count=1

mas isso não fez diferença.

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
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 recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

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

insmod raid
insmod mdraid1x
insmod part_msdos
insmod part_msdos
insmod ext2
set root='(mduuid/bec69e6b53a222d6726d1f6a11d27043)'
search --no-floppy --fs-uuid --set=root c3a8948c-4ca8-4d3b-acbe-64baa0f7a181
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  insmod raid
  insmod mdraid1x
  insmod part_msdos
  insmod part_msdos
  insmod ext2
  set root='(mduuid/bec69e6b53a222d6726d1f6a11d27043)'
  search --no-floppy --fs-uuid --set=root c3a8948c-4ca8-4d3b-acbe-64baa0f7a181
  set locale_dir=($root)/boot/grub/locale
  set lang=en_GB
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=2
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
    set gfxpayload="${1}"
    if [ "${1}" = "keep" ]; then
        set vt_handoff=vt.handoff=7
    else
        set vt_handoff=
    fi
}
if [ "${recordfail}" != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "${linux_gfx_mode}" != "text" ]; then load_video; fi
menuentry 'Ubuntu, with Linux 3.2.0-29-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    gfxmode $linux_gfx_mode
    insmod gzio
    insmod raid
    insmod mdraid1x
    insmod part_msdos
    insmod part_msdos
    insmod ext2
    set root='(mduuid/bec69e6b53a222d6726d1f6a11d27043)'
    search --no-floppy --fs-uuid --set=root c3a8948c-4ca8-4d3b-acbe-64baa0f7a181
    linux   /boot/vmlinuz-3.2.0-29-generic root=UUID=c3a8948c-4ca8-4d3b-acbe-64baa0f7a181 ro   
    initrd  /boot/initrd.img-3.2.0-29-generic
}
menuentry 'Ubuntu, with Linux 3.2.0-29-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod gzio
    insmod raid
    insmod mdraid1x
    insmod part_msdos
    insmod part_msdos
    insmod ext2
    set root='(mduuid/bec69e6b53a222d6726d1f6a11d27043)'
    search --no-floppy --fs-uuid --set=root c3a8948c-4ca8-4d3b-acbe-64baa0f7a181
    echo    'Loading Linux 3.2.0-29-generic ...'
    linux   /boot/vmlinuz-3.2.0-29-generic root=UUID=c3a8948c-4ca8-4d3b-acbe-64baa0f7a181 ro recovery nomodeset 
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initrd.img-3.2.0-29-generic
}
### 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+ ###
menuentry "Memory test (memtest86+)" {
    insmod raid
    insmod mdraid1x
    insmod part_msdos
    insmod part_msdos
    insmod ext2
    set root='(mduuid/bec69e6b53a222d6726d1f6a11d27043)'
    search --no-floppy --fs-uuid --set=root c3a8948c-4ca8-4d3b-acbe-64baa0f7a181
    linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
    insmod raid
    insmod mdraid1x
    insmod part_msdos
    insmod part_msdos
    insmod ext2
    set root='(mduuid/bec69e6b53a222d6726d1f6a11d27043)'
    search --no-floppy --fs-uuid --set=root c3a8948c-4ca8-4d3b-acbe-64baa0f7a181
    linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### 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  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

configuração do mdadm

:~$ mdadm /dev/md0 
/dev/md0:
        Version : 1.2
  Creation Time : Wed Aug 29 10:28:02 2012
     Raid Level : raid1
     Array Size : 15615872 (14.89 GiB 15.99 GB)
  Used Dev Size : 15615872 (14.89 GiB 15.99 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Mon Sep  3 10:35:25 2012
          State : clean 
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : norsewind-obs:0  (local to host norsewind-obs)
           UUID : b55552d2:1e554573:82671934:3831d058
         Events : 19

    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync   /dev/sda1
       1       8       17        1      active sync   /dev/sdb1


:~$ sudo mdadm -D /dev/md1
        Version : 1.2
  Creation Time : Wed Aug 29 10:28:11 2012
     Raid Level : raid1
     Array Size : 1937758016 (1847.99 GiB 1984.26 GB)
  Used Dev Size : 1937758016 (1847.99 GiB 1984.26 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Mon Sep  3 10:47:40 2012
          State : clean 
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : norsewind-obs:1  (local to host norsewind-obs)
           UUID : bec69e6b:53a222d6:726d1f6a:11d27043
         Events : 263

    Number   Major   Minor   RaidDevice State
       0       8        2        0      active sync   /dev/sda2
       2       8       18        1      active sync   /dev/sdb2

fdisk

:~$ sudo fdisk -l

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 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: 0x000ccfa5

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048    31250431    15624192   fd  Linux RAID autodetect
/dev/sda2   *    31250432  3907028991  1937889280   fd  Linux RAID autodetect

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 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: 0x000ccfa5

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    31250431    15624192   fd  Linux RAID autodetect
/dev/sdb2   *    31250432  3907028991  1937889280   fd  Linux RAID autodetect

Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 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: 0x000c73aa

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048  3907028991  1953513472   fd  Linux RAID autodetect

Disk /dev/sdd: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 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: 0x00035b05

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1            2048  3907028991  1953513472   fd  Linux RAID autodetect

Disk /dev/md2: 2000.3 GB, 2000263380992 bytes
2 heads, 4 sectors/track, 488345552 cylinders, total 3906764416 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: 0x00000000

Disk /dev/md2 doesn't contain a valid partition table

Disk /dev/md0: 16.0 GB, 15990652928 bytes
2 heads, 4 sectors/track, 3903968 cylinders, total 31231744 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: 0x00000000

Disk /dev/md0 doesn't contain a valid partition table

Disk /dev/md1: 1984.3 GB, 1984264208384 bytes
2 heads, 4 sectors/track, 484439504 cylinders, total 3875516032 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: 0x00000000

Disk /dev/md1 doesn't contain a valid partition table
    
por beacon_bonanza 31.08.2012 / 16:18

1 resposta

1

Use grub-install em vez de dd para instalar o grub no MBR.

por exemplo. (como root ou com sudo):

grub-install /dev/sda
grub-install /dev/sdb

BTW, a menos que você esteja hibernando para a partição swap, você não precisa de RAID em dispositivos de swap. Talvez seja melhor você destruir o md0 e usar as partições de troca em sda e sdb individualmente.

    
por 01.09.2012 / 04:44