Koozali.org: home of the SME Server

How do I install grub on new raid device?

Offline kruhm

  • *
  • 680
  • +0/-0
How do I install grub on new raid device?
« on: January 27, 2013, 01:58:23 PM »
Hi Everyone,

How do I install grub on new raid device?

sdb went bad and it was replaced and resynced via console > manage disk redundancy.

When I reboot with sda, everything is great. When I reboot with sdb, all I get is a black screen; no grub.

Here is grub.conf:
Code: [Select]
# cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/main/root
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/smeserver.xpm.gz
foreground 000000
background 4E95D3
title SME Server (2.6.18-308.16.1.el5PAE)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-308.16.1.el5PAE ro root=/dev/main/root
        initrd /initrd-2.6.18-308.16.1.el5PAE.img
[root@server ~]#

Here is device map:
Code: [Select]
# cat /boot/grub/device.map
# this device map was generated by anaconda
(fd0)     /dev/fd0
(hd0)     /dev/sda
(hd1)     /dev/sdb

Believe it or not, I've never had to deal with grub before. I don't want to make the wrong move here.

Your advice and assistance is greatly appreciated.

Thanks,
kruhm

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: How do I install grub on new raid device?
« Reply #1 on: January 27, 2013, 04:42:39 PM »
please raise a bug,  thank you

Offline stephdl

  • *
  • 1,523
  • +0/-0
    • Linux et Geekeries
Re: How do I install grub on new raid device?
« Reply #2 on: January 27, 2013, 05:06:51 PM »
What about of this in a console with root privilege

Code: [Select]
grub-install /dev/sdb
i don't believe the grub is installed automatically on other raid disk ?

or in another way you have this http://wiki.contribs.org/Raid:Manual_Rebuild#HowTo:_Write_the_GRUB_boot_sector
« Last Edit: January 27, 2013, 05:08:56 PM by stephdl »
See http://wiki.contribs.org/Koozali_Foundation
irc : Freenode #sme_server #sme-fr

!!! Please write your knowledge to the Wiki !!!

Offline kruhm

  • *
  • 680
  • +0/-0
Re: How do I install grub on new raid device?
« Reply #3 on: January 27, 2013, 07:29:21 PM »
Hi,

Thanks for responding.

Quote
please raise a bug,  thank you
I went ahead and submitted a bug report here:
http://bugs.contribs.org/show_bug.cgi?id=7239

Quote
i don't believe the grub is installed automatically on other raid disk ?
Here is what I see from the logs:

Code: [Select]
Jan 26 10:24:55 server add_drive_to_raid: mdadm: re-added /dev/sdb2
Jan 26 10:25:12 server add_drive_to_raid:
Jan 26 10:25:12 server add_drive_to_raid: Waiting for boot partition to sync before installing grub...
Jan 26 10:25:13 server add_drive_to_raid: Probing devices to guess BIOS drives. This may take a long time.
Jan 26 10:25:13 server add_drive_to_raid:
Jan 26 10:25:13 server add_drive_to_raid:
Jan 26 10:25:13 server add_drive_to_raid:     GNU GRUB  version 0.97  (640K lower / 3072K upper memory)
Jan 26 10:25:13 server add_drive_to_raid:
Jan 26 10:25:13 server add_drive_to_raid:  [ Minimal BASH-like line editing is supported.  For the first word, TAB
Jan 26 10:25:13 server add_drive_to_raid:    lists possible command completions.  Anywhere else TAB lists the possible
Jan 26 10:25:13 server add_drive_to_raid:    completions of a device/filename.]
Jan 26 10:25:13 server add_drive_to_raid: grub> device (hd0) /dev/sdb
Jan 26 10:25:13 server add_drive_to_raid: grub> root (hd0,0)
Jan 26 10:25:13 server add_drive_to_raid:  Filesystem type is ext2fs, partition type 0xfd
Jan 26 10:25:13 server add_drive_to_raid: grub> setup (hd0)
Jan 26 10:25:13 server add_drive_to_raid:  Checking if "/boot/grub/stage1" exists... no
Jan 26 10:25:13 server add_drive_to_raid:  Checking if "/grub/stage1" exists... yes
Jan 26 10:25:13 server add_drive_to_raid:  Checking if "/grub/stage2" exists... yes
Jan 26 10:25:13 server add_drive_to_raid:  Checking if "/grub/e2fs_stage1_5" exists... yes
Jan 26 10:25:13 server add_drive_to_raid:  Running "embed /grub/e2fs_stage1_5 (hd0)"... failed (this is not fatal)
Jan 26 10:25:13 server add_drive_to_raid:  Running "embed /grub/e2fs_stage1_5 (hd0,0)"... failed (this is not fatal)
Jan 26 10:25:13 server add_drive_to_raid:  Running "install /grub/stage1 (hd0) /grub/stage2 p /grub/grub.conf "... succeeded
Jan 26 10:25:13 server add_drive_to_raid: Done.
Jan 26 10:25:13 server add_drive_to_raid: grub> quit

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: How do I install grub on new raid device?
« Reply #4 on: January 28, 2013, 02:05:53 AM »
I went ahead and submitted a bug report here:
http://bugs.contribs.org/show_bug.cgi?id=7239

Please followup only by the bugtracker. Anyone who thinks they can help - please post in the bug tracker.