CentOS Icon CentOS Logo
CentOS Text
   
  
www.centos.org Forum Index
   CentOS 6 - General Support
  Install grub on /dev/md0, CentOS 6

 

 Bottom   Previous Topic   Next Topic
12>
  •  Rate Thread
      Rate this Thread
      Excellent
      Good
      Average
      Bad
      Terrible
Poster Thread
  •  ebroch
      ebroch
Install grub on /dev/md0, CentOS 6
#1
Peeking in the Member Window
Joined: 2011/12/28
From MT
Posts: 15
Hello,

I am trying to install CentOS 6 on a new Dell Server made for RHEL 6. I am have a problem installing the boot loader on to the software RAID device /dev/md0. When I have done so the machine won't boot. I have read other threads here and posts on other websites that indicate that one must install the boot loader on /dev/sda during installation then run commands at the grub prompt in order to install the boot loader on both drives in the RAID 1 mirror. I've followed those instructions but cannot get the machine to boot when I simulate a disk failure.

I've been running CentOS 5 for years and have installed the boot loader on /dev/md0 on that platform, and on many, many machines, with absolutely no problems. With real and simulated disk failures the machines always boot.

Is there something to a CentOS 6 installation that I'm not taking into account in setting up a bootable software RAID 1 device? Can anyone help me figure this out?
Posted on: 2011/12/29 0:11
Create PDF from Post Print
Top
  •  ebroch
      ebroch
Re: Install grub on /dev/md0, CentOS 6
#2
Peeking in the Member Window
Joined: 2011/12/28
From MT
Posts: 15
The above Dell server has NO hardware raid devices, so I'm not sure whether the the information on this link (http://wiki.centos.org/HowTos/SoftwareRAIDonCentOS5) applies.

When installing CentOS 6 I went through the same procedure as with CentOS 5 (which I have done many, many times before) when implementing a bootable RAID 1 on /dev/md0. Why does it work in CentOS 5 and not in CentOS 6 when following the same procedures as I've always done?

Any help would be greatly appreciated.
Posted on: 2011/12/29 15:28
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: Install grub on /dev/md0, CentOS 6
#3
Moderator
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
Did you install GRUB on the MBR on both RAID members as outlined in the Wiki article? That should work if done correctly, although I admittedly have not tested it on CentOS-6.
_________________
Phil

Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2011/12/31 14:18
Create PDF from Post Print
Top
  •  ebroch
      ebroch
Re: Install grub on /dev/md0, CentOS 6
#4
Peeking in the Member Window
Joined: 2011/12/28
From MT
Posts: 15
I followed the instructions on this wiki (http://wiki.centos.org/HowTos/SoftwareRAIDonCentOS5) and when I failed a drive to test whether the machine would boot from 1 drive or the other I got the message 'kernel panic - not syncing: Attempted to kill init!"
Posted on: 2012/1/2 19:52
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: Install grub on /dev/md0, CentOS 6
#5
Moderator
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
Please provide more information about your system by running "./getinfo.sh disk" and showing us the output file, along with the contents of /boot/grub/grub.conf.
_________________
Phil

Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2012/1/2 19:59
Create PDF from Post Print
Top
  •  gerald_clark
      gerald_clark
Re: Install grub on /dev/md0, CentOS 6
#6
Professional Board Member
Joined: 2005/8/5
From Northern Illinois, USA
Posts: 6175
If you installed grub on md0, you must have a standard MBRs with the md0 raid partitions marked as active.
Posted on: 2012/1/3 18:17
Create PDF from Post Print
Top
  •  ebroch
      ebroch
Re: Install grub on /dev/md0, CentOS 6
#7
Peeking in the Member Window
Joined: 2011/12/28
From MT
Posts: 15
Sorry about the delay getting the output of 'getinfo.sh' I was in the middle of trying another procedure with the machine.

I followed the instructions here: http://wiki.centos.org/HowTos/SoftwareRAIDonCentOS5 with the following exceptions:

1) Installed CentOS 6 minimal install
2) Didn't make /dev/sda1 and /dev/sdb1 primary partitions. Is this necessary?
3) Started network services to do update of system.


To test the system I shut it down, unplugged hd1 and started it. The following error ensued:

Kernel panic - not syncing: Attempted to kill init!
panic occurred, switching back to text console


I've posted the output to 'getinfo.sh' at http://pastebin.centos.org

[Moderator edit] The actual URL is http://pastebin.centos.org/38234 .
Posted on: 2012/1/4 16:49
Create PDF from Post Print
Top
  •  gerald_clark
      gerald_clark
Re: Install grub on /dev/md0, CentOS 6
#8
Professional Board Member
Joined: 2005/8/5
From Northern Illinois, USA
Posts: 6175
They should be primary partitions.
Posted on: 2012/1/4 17:24
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: Install grub on /dev/md0, CentOS 6
#9
Moderator
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
So, they are primary partitions. Have you have done
grub> device (hd0) /dev/sda
grub> device (hd1) /dev/sdb
grub> root (hd0,0)
grub> setup (hd0)
grub> root (hd1,0)
grub> setup (hd1)
grub> quit
?

You forgot /boot/grub/grub.conf
_________________
Phil

Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2012/1/4 21:00
Create PDF from Post Print
Top
  •  ebroch
      ebroch
Re: Install grub on /dev/md0, CentOS 6
#10
Peeking in the Member Window
Joined: 2011/12/28
From MT
Posts: 15
I did the following:

grub> root (hd1,0)
grub> setup (hd1)
grub> root (hd0,0)
grub> setup (hd0)
Posted on: 2012/1/5 0:08
Create PDF from Post Print
Top
  •  ebroch
      ebroch
Re: Install grub on /dev/md0, CentOS 6
#11
Peeking in the Member Window
Joined: 2011/12/28
From MT
Posts: 15
On the link (http://wiki.centos.org/HowTos/SoftwareRAIDonCentOS5) I installed the bootloader using method 1.
Posted on: 2012/1/5 0:11
Create PDF from Post Print
Top
  •  ebroch
      ebroch
Re: Install grub on /dev/md0, CentOS 6
#12
Peeking in the Member Window
Joined: 2011/12/28
From MT
Posts: 15
I'm going to reinstall the system with sda1 and sdb1 as md0 raid 1 on which /boot resides as primary partitions and I'll resubmit the output of 'getinfo.sh' and the grub configuration file.
Posted on: 2012/1/5 0:18
Create PDF from Post Print
Top
  •  ebroch
      ebroch
Re: Install grub on /dev/md0, CentOS 6
#13
Peeking in the Member Window
Joined: 2011/12/28
From MT
Posts: 15
OK. I Re-installed CentOS 6 with sda1 and sdb1 as primary partitions. Still no boot on failed drive...same error as above. The grub config. file and the output of getinfo.sh is at this link: http://pastebin.centos.org/38236
Posted on: 2012/1/5 2:25
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: Install grub on /dev/md0, CentOS 6
#14
Moderator
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
They were already primary partitions the last time around - you apparently just did not force them to be. I'm mystified, but right now it's past my bedtime. Will try to do some testing tomorrow on VirtualBox.
_________________
Phil

Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2012/1/5 2:46
Create PDF from Post Print
Top
  •  ebroch
      ebroch
Re: Install grub on /dev/md0, CentOS 6
#15
Peeking in the Member Window
Joined: 2011/12/28
From MT
Posts: 15
'Mystified' is a good word for it and describes my thoughts exactly. Thanks for all your help so far, though. I have confidence in Linux because there has always been ryhme or reason to dilemmas and it usually ends in my having made a mistake.
In my 'travels' through this dilemma I've installed the i386 version of CentOS 6 and the x86_64 version of the same, both minimal installs. There is a difference in options upon install. In the i386 install there is a screen which allows one to make devices 'system' drives rather than 'data' drives and at the same time gives the option to choose which device will have the boot-loader. This screen comes after the screen of options 'Which type of installation would you like' where the 'Create Custom Layout' occurs. This screen of options (devices system or data and boot-loader) has not been present in the x86_64 minimal install. During the i386 install I made both disks system disks with the boot-loader on the first. After install and update I was able to boot the OS after disk failure but only the kernel which was originally installed. The updated kernel would not boot on disk failure and yielded the error mentioned above.
Posted on: 2012/1/5 5:12
Create PDF from Post Print
Top
  •  johann8
      johann8
Re: Install grub on /dev/md0, CentOS 6
#16
Newbie
Joined: 2012/1/5
From
Posts: 2
Hi,

I have the same behavior here. no boot on failed drive. It works only with kernel which was originally installed. After update no boot on failed drive, kernel panic.
md0 is created on sda1 and sdb1 as primary partition. Grub is installed on both sda1 and sdb1. it works fine on CentOS 5.

Grub.conf
------------------------
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-220.2.1.el6.i686)
root (hd0,0)
kernel /vmlinuz-2.6.32-220.2.1.el6.i686 ro root=/dev/mapper/VG-LV_root rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=de-latin1-nodeadkeys SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VG/LV_swap rd_MD_UUID=281f0128:d9149f07:ecadd945:a2317fad LANG=de_DE.UTF-8 rd_NO_DM rd_LVM_LV=VG/LV_root
initrd /initramfs-2.6.32-220.2.1.el6.i686.img
title centos (2.6.32-220.el6.i686)
root (hd0,0)
kernel /vmlinuz-2.6.32-220.el6.i686 ro root=/dev/mapper/VG-LV_root rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=de-latin1-nodeadkeys quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto rd_LVM_LV=VG/LV_swap rd_MD_UUID=281f0128:d9149f07:ecadd945:a2317fad LANG=de_DE.UTF-8 rd_NO_DM rd_LVM_LV=VG/LV_root
initrd /initramfs-2.6.32-220.el6.i686.img
--------------------------

./getinfo.sh disk

== BEGIN uname -rmi ==
2.6.32-220.2.1.el6.i686 i686 i386
== END   uname -rmi ==

== BEGIN rpm -qa \*-release\* ==
centos-release-6-2.el6.centos.7.i686
epel-release-6-5.noarch
== END   rpm -qa \*-release\* ==

== BEGIN cat /etc/redhat-release ==
CentOS release 6.2 (Final)
== END   cat /etc/redhat-release ==

== BEGIN getenforce ==
Disabled
== END   getenforce ==

== BEGIN free -m ==
             total       used       free     shared    buffers     cached
Mem:          1514       1271        243          0         54        454
-/+ buffers/cache:        762        751
Swap:         1023          0       1023
== END   free -m ==

== BEGIN cat /etc/fstab ==

#
# /etc/fstab
# Created by anaconda on Thu Dec 29 13:31:35 2011
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/dm-0               /                       ext4    defaults        1 1
#UUID=e7db0186-7a21-46d1-8127-f0689d5518f4 /boot                   ext3    defaults        1 2
/dev/md0               /boot                   ext3    defaults        1 2
/dev/dm-3               /opt                    ext4    defaults        1 2
/dev/dm-4               /usr                    ext4    defaults        1 2
/dev/dm-2               /var                    ext4    defaults        1 2
/dev/dm-1               swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0

== END   cat /etc/fstab ==

== BEGIN df -h ==
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VG-LV_root
                      2.0G  386M  1.5G  21% /
tmpfs                 758M     0  758M   0% /dev/shm
/dev/md0              194M   44M  140M  24% /boot
/dev/mapper/VG-LV_opt
                      4.9G  190M  4.4G   5% /opt
/dev/mapper/VG-LV_usr
                      4.9G  1.6G  3.1G  33% /usr
/dev/mapper/VG-LV_var
                       87G  584M   82G   1% /var
== END   df -h ==

== BEGIN fdisk -l ==
Disk /dev/md1 doesn't contain a valid partition table
Disk /dev/mapper/VG-LV_root doesn't contain a valid partition table
Disk /dev/mapper/VG-LV_swap doesn't contain a valid partition table
Disk /dev/md0 doesn't contain a valid partition table
Disk /dev/mapper/VG-LV_var doesn't contain a valid partition table
Disk /dev/mapper/VG-LV_opt doesn't contain a valid partition table
Disk /dev/mapper/VG-LV_usr doesn't contain a valid partition table

Disk /dev/sda: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 14946 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00019547

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   fd  Linux raid autodetect
Partition 1 does not end on cylinder boundary.
/dev/sda2              26       14947   119854080   fd  Linux raid autodetect

Disk /dev/sdb: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 14946 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x7406872f

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          26      204800   fd  Linux raid autodetect
Partition 1 does not end on cylinder boundary.
/dev/sdb2              26       14947   119854080   fd  Linux raid autodetect

Disk /dev/md1: 122.7 GB, 122729459712 bytes
2 heads, 4 sectors/track, 29963247 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VG-LV_root: 2097 MB, 2097152000 bytes
255 heads, 63 sectors/track, 254 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VG-LV_swap: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/md0: 209 MB, 209702912 bytes
2 heads, 4 sectors/track, 51197 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VG-LV_var: 94.4 GB, 94371840000 bytes
255 heads, 63 sectors/track, 11473 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VG-LV_opt: 5242 MB, 5242880000 bytes
255 heads, 63 sectors/track, 637 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VG-LV_usr: 5242 MB, 5242880000 bytes
255 heads, 63 sectors/track, 637 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

== END   fdisk -l ==

== BEGIN blkid ==
/dev/sda1: UUID="9bafc4cb-5fa8-2692-c31c-cf5c461d2120" UUID_SUB="712f8693-5a85-2aa7-acbc-16b705a1d303" LABEL="ox.berlicall.local:0" TYPE="linux_raid_member"
/dev/sda2: UUID="281f0128-d914-9f07-ecad-d945a2317fad" UUID_SUB="5423048b-8ff1-e0a1-02f9-dc3180988265" LABEL="ox.berlicall.local:1" TYPE="linux_raid_member"
/dev/sdb1: UUID="9bafc4cb-5fa8-2692-c31c-cf5c461d2120" UUID_SUB="79deea05-6c3d-73ad-0191-c0c016c73f7c" LABEL="ox.berlicall.local:0" TYPE="linux_raid_member"
/dev/sdb2: UUID="281f0128-d914-9f07-ecad-d945a2317fad" UUID_SUB="63d7cf06-f307-04f0-8ffb-5416a05ec012" LABEL="ox.berlicall.local:1" TYPE="linux_raid_member"
/dev/md1: UUID="TPUAFM-C2Mz-jOUU-E6Lq-12h3-Gkh8-M6qHwv" TYPE="LVM2_member"
/dev/mapper/VG-LV_root: UUID="bbede96f-5240-48a8-b177-9df2a6ca6797" TYPE="ext4"
/dev/mapper/VG-LV_swap: UUID="413b55aa-fc5e-4dbd-b5d2-4b676bb8cecd" TYPE="swap"
/dev/md0: UUID="e7db0186-7a21-46d1-8127-f0689d5518f4" TYPE="ext3"
/dev/mapper/VG-LV_var: UUID="fe58f909-20c2-49ce-9e71-1344e59fcd79" TYPE="ext4"
/dev/mapper/VG-LV_opt: UUID="530c41e9-02ba-4131-b09e-de8724c085ab" TYPE="ext4"
/dev/mapper/VG-LV_usr: UUID="adf3ea67-eb99-47b0-a14a-8ea160ca6932" TYPE="ext4"
== END   blkid ==

== BEGIN cat /proc/mdstat ==
Personalities : [raid1]
md0 : active raid1 sda1[0] sdb1[1]
      204788 blocks super 1.0 [2/2] [UU]

md1 : active raid1 sda2[0] sdb2[1]
      119852988 blocks super 1.1 [2/2] [UU]
      bitmap: 1/1 pages [4KB], 65536KB chunk

unused devices: <none>
== END   cat /proc/mdstat ==

== BEGIN pvs ==
  PV         VG   Fmt  Attr PSize   PFree
  /dev/md1   VG   lvm2 a--  114.30g 13.69g
== END   pvs ==

== BEGIN vgs ==
  VG   #PV #LV #SN Attr   VSize   VFree
  VG     1   5   0 wz--n- 114.30g 13.69g
== END   vgs ==

== BEGIN lvs ==
  LV      VG   Attr   LSize  Origin Snap%  Move Log Copy%  Convert
  LV_opt  VG   -wi-ao  4.88g
  LV_root VG   -wi-ao  1.95g
  LV_swap VG   -wi-ao  1.00g
  LV_usr  VG   -wi-ao  4.88g
  LV_var  VG   -wi-ao 87.89g
== END   lvs ==



Any help would be greatly appreciated.

PS. sorry for my bad english
Posted on: 2012/1/5 12:39
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: Install grub on /dev/md0, CentOS 6
#17
Moderator
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
Quote:

johann8 wrote:
Hi,

I have the same behavior here. no boot on failed drive. ...


Welcome to the CentOS fora. Please see the recommended reading for new users linked in my signature.

After reading those links you should realize why you should not hijack threads as you have done. Please start a new Topic for your issue to get the attention you need, providing a link to this one if required for context.
_________________
Phil

Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2012/1/5 16:34
Create PDF from Post Print
Top
  •  ebroch
      ebroch
Re: Install grub on /dev/md0, CentOS 6
#18
Peeking in the Member Window
Joined: 2011/12/28
From MT
Posts: 15
Phil,

I installed an earlier version of CentOS 6 (Version 6.0), a minimal install, without doing an update and it boots when either drive is failed. I'm posting the output of 'getinfo.sh' and grub.conf.

This was accomplished using 'http://wiki.centos.org/HowTos/SoftwareRAIDonCentOS5' (method 2), including zeroing sda1/sdb1, and using 'nodmraid' at install time. I have not done the update yet but will proceed to see if that works.

http://pastebin.centos.org/38238

Eric
Posted on: 2012/1/5 17:50
Create PDF from Post Print
Top
  •  pschaff
      pschaff
Re: Install grub on /dev/md0, CentOS 6
#19
Moderator
Joined: 2006/12/13
From Tidewater, Virginia, North America
Posts: 18773
Tried a fresh 6.2 install with RAID1 on VirtualBox. Took the default of /dev/sda for GRUB at install time. No matter which method I use to update grub on both disks, nor which disk I remove, I am getting "Kernel panic - not syncing: attempted to kill init!" if either disk is missing.

Looks a lot like a bug to me. If there is one upstream I failed to find it. None found for CentOS either.
_________________
Phil

Recommended reading: FAQ & Readme first ; Search hint: google "your topic site:centos.org"; Smart Questions
Posted on: 2012/1/6 14:55
Create PDF from Post Print
Top
  •  ebroch
      ebroch
Re: Install grub on /dev/md0, CentOS 6
#20
Peeking in the Member Window
Joined: 2011/12/28
From MT
Posts: 15
Phil,

Since it works with kernel 2.6.32-131.0.15.el6.x86_64 (CentOS 6.1) and not with kernel 2.6.32-220.2.1.el6.x86_64 (CentOS 6.2) do you believe it to be a problem with later kernel? Do you have any recommendations? I've never reported a bug before.

Eric
Posted on: 2012/1/6 15:30
Create PDF from Post Print
Top
 Top   Previous Topic   Next Topic
12>

 


 You cannot start a new topic.
 You cannot view topic.
 You cannot reply to posts.
 You cannot edit your posts.
 You cannot delete your posts.
 You cannot add new polls.
 You cannot vote in polls.
 You cannot attach files to posts.
 You cannot post without approval.




"Linux" is a registered trademark of Linus Torvalds. | All other trademarks are property of their respective owners. | All other content is Copyright @ 2004-2009 by the CentOS Project or "each individual contributor (forums, comments, etc.) unless otherwise assigned".| Theme based on a theme by 7dana.com