Install grub on /dev/md0, CentOS 6

General support questions
ebroch
Posts: 15
Joined: 2011/12/28 23:18:25
Location: MT

Re: Install grub on /dev/md0, CentOS 6

Post by ebroch » 2012/01/05 00:11:16

On the link (http://wiki.centos.org/HowTos/SoftwareRAIDonCentOS5) I installed the bootloader using method 1.

ebroch
Posts: 15
Joined: 2011/12/28 23:18:25
Location: MT

Re: Install grub on /dev/md0, CentOS 6

Post by ebroch » 2012/01/05 00:18:25

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.

ebroch
Posts: 15
Joined: 2011/12/28 23:18:25
Location: MT

Re: Install grub on /dev/md0, CentOS 6

Post by ebroch » 2012/01/05 02:25:03

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

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Install grub on /dev/md0, CentOS 6

Post by pschaff » 2012/01/05 02:46:17

They were already primary partitions the last time around - you apparently just did not [i]force[/i] them to be. I'm mystified, but right now it's past my bedtime. Will try to do some testing tomorrow on VirtualBox.

ebroch
Posts: 15
Joined: 2011/12/28 23:18:25
Location: MT

Re: Install grub on /dev/md0, CentOS 6

Post by ebroch » 2012/01/05 05:12:38

'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.

johann8
Posts: 2
Joined: 2012/01/05 10:06:14

Re: Install grub on /dev/md0, CentOS 6

Post by johann8 » 2012/01/05 12:39:25

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

[code]
== 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 ==

[/code]

Any help would be greatly appreciated.

PS. sorry for my bad english

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Install grub on /dev/md0, CentOS 6

Post by pschaff » 2012/01/05 16:34:40

[quote]
johann8 wrote:
Hi,

I have the same behavior here. no boot on failed drive. ...[/quote]

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.

ebroch
Posts: 15
Joined: 2011/12/28 23:18:25
Location: MT

Re: Install grub on /dev/md0, CentOS 6

Post by ebroch » 2012/01/05 17:50:35

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

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Install grub on /dev/md0, CentOS 6

Post by pschaff » 2012/01/06 14:55:11

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.

ebroch
Posts: 15
Joined: 2011/12/28 23:18:25
Location: MT

Re: Install grub on /dev/md0, CentOS 6

Post by ebroch » 2012/01/06 15:30:17

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

Post Reply