[SOLVED] Software Raid1 can boot only with both disks onboard

General support questions
soulreaver1
Posts: 8
Joined: 2012/03/31 14:54:39

[SOLVED] Software Raid1 can boot only with both disks onboard

Post by soulreaver1 » 2012/03/31 15:08:15

Hello,

I have a /boot partition on md0 (software raid1). Problem is that system boots only if both disks (sda, sdb) are connected. If any of them is removed grub error message appears:

[code]failed to read image
Press any key to enter the menu

Press any key to continue...[/code]

I've installed grub on both devices this way:

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

df
[code]df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_fileserver-LogVol01
20157076 2128044 17824288 11% /
tmpfs 742604 88 742516 1% /dev/shm
/dev/md0 495832 31699 438534 7% /boot
/dev/mapper/luks-3ff7295a-e14d-447d-bacb-d5e360aa3592
216670204 224356 205439592 1% /home
[/code]

grub.cfg:
[code]# 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 (hd1,0)
# kernel /vmlinuz-version ro root=/dev/mapper/vg_fileserver-LogVol01
# initrd /initrd-[generic-]version.img
#boot=/dev/md0
default=0
fallback=1
timeout=5
splashimage=(hd1,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-220.el6.i686)
root (hd1,0)
kernel /vmlinuz-2.6.32-220.el6.i686 ro root=/dev/mapper/vg_fileserver-LogVol01 \
rd_NO_LUKS LANG=en_US.UTF-8 rd_MD_UUID=a232e453:590569c0:2d918271:25600f33 quiet \
SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=pl2 \
rd_LVM_LV=vg_fileserver/LogVol01 rd_LVM_LV=vg_fileserver/LogVol00 rd_NO_DM
initrd /initramfs-2.6.32-220.el6.i686.img
[/code][Moderator edit: Wrap [b]long[/b] line.]

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

[SOLVED] Software Raid1 can boot only with both disks onboar

Post by pschaff » 2012/03/31 16:13:59

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

There was a bug in [b]dracut[/b] that caused this problem. Please "yum update" to get all current errata and try again.

soulreaver1
Posts: 8
Joined: 2012/03/31 14:54:39

Re: Software Raid1 can boot only with both disks onboard

Post by soulreaver1 » 2012/03/31 16:46:35

Unfortunately "yum update" hasn't changed the situation.

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Software Raid1 can boot only with both disks onboard

Post by TrevorH » 2012/03/31 16:56:18

You also need to rebuild the initrd/initramfs after updating dracut. Use `man dracut` to find out how.

soulreaver1
Posts: 8
Joined: 2012/03/31 14:54:39

Re: Software Raid1 can boot only with both disks onboard

Post by soulreaver1 » 2012/03/31 18:57:00

I've rebuilded initrd using examples from this article: http://linuxman.wikispaces.com/Rebuilding+initrd+on+CentOS ,but still the same problem is present.

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

Re: Software Raid1 can boot only with both disks onboard

Post by pschaff » 2012/03/31 20:09:00

Did you update everything? An initramfs rebuild should have happened automatically with the new kernel install.

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

Re: Software Raid1 can boot only with both disks onboard

Post by pschaff » 2012/03/31 20:10:44

If more help is needed then please [url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=28723&forum=54]provide more information about your system[/url] by running "./getinfo.sh disk" and showing us the output file, along with "rpm -q dracut" and "ls -lF /boot".

soulreaver1
Posts: 8
Joined: 2012/03/31 14:54:39

Re: Software Raid1 can boot only with both disks onboard

Post by soulreaver1 » 2012/04/01 08:06:32

More help would be welcome.

getinfo.sh disk output: http://pastebin.centos.org/38610

[code]rpm -q dracut
dracut-004-256.el6_2.1.noarch
[/code]

[code] ls -lF /boot
total 55904
-rw-r--r--. 1 root root 105748 Mar 6 23:05 config-2.6.32-220.7.1.el6.i686
-rw-r--r--. 1 root root 105744 Dec 6 17:59 config-2.6.32-220.el6.i686
drwxr-xr-x. 3 root root 1024 Dec 16 05:46 efi/
-rw-r--r--. 1 root root 166756 Jul 20 2011 elf-memtest86+-4.10
drwxr-xr-x. 2 root root 1024 Mar 31 21:29 grub/
-rw-r--r--. 1 root root 14940924 Mar 31 21:57 initramfs-2.6.32-220.7.1.el6.i686.img
-rw-r--r--. 1 root root 14940939 Mar 31 21:29 initramfs-2.6.32-220.7.1.el6.i686.img.old
-rw-r--r--. 1 root root 14940004 Mar 31 20:41 initramfs-2.6.32-220.el6.i686.img
drwx------. 2 root root 12288 Mar 31 20:29 lost+found/
-rw-r--r--. 1 root root 165080 Jul 20 2011 memtest86+-4.10
-rw-r--r--. 1 root root 168282 Mar 6 23:05 symvers-2.6.32-220.7.1.el6.i686.gz
-rw-r--r--. 1 root root 168173 Dec 6 17:59 symvers-2.6.32-220.el6.i686.gz
-rw-r--r--. 1 root root 1824809 Mar 6 23:05 System.map-2.6.32-220.7.1.el6.i686
-rw-r--r--. 1 root root 1823458 Dec 6 17:59 System.map-2.6.32-220.el6.i686
-rwxr-xr-x. 1 root root 3812448 Mar 6 23:05 vmlinuz-2.6.32-220.7.1.el6.i686*
-rwxr-xr-x. 1 root root 3811616 Dec 6 17:59 vmlinuz-2.6.32-220.el6.i686*
[/code]

[quote]
pschaff wrote:
Did you update everything? An initramfs rebuild should have happened automatically with the new kernel install.[/quote]

Yes, I think so

[code]yum update
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: www.idg.pl
* extras: www.idg.pl
* updates: www.idg.pl
Setting up Update Process
No Packages marked for Update
[/code]

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

Re: Software Raid1 can boot only with both disks onboard

Post by pschaff » 2012/04/01 12:21:47

I can't spot any problems. Perhaps somehow the update did not use the new dracut when the kernel was updated. I'd try rebuilding the initramfs yet again. See the [url=http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-Verifying_the_Initial_RAM_Disk_Image.html]upstream docs[/url] for details.

soulreaver1
Posts: 8
Joined: 2012/03/31 14:54:39

Re: Software Raid1 can boot only with both disks onboard

Post by soulreaver1 » 2012/04/01 14:03:28

It seems to be solved :). I've done two changes more, and one of them (or maybe even both) makes the thing working. Thank you all for your valuable help. It was a hard start into CentOs, but now it would be only better... I hope :).


first move :
[code] dracut "initramfs-$(uname -r).img" $(uname -r) [/code]
second move in grub.cfg file (bold lines are changed):
[code]# root (hd1,0)
# kernel /vmlinuz-version ro root=/dev/mapper/vg_fileserver-LogVol00
# initrd /initrd-[generic-]version.img
#boot=/dev/md0
default=0
timeout=5
[b]splashimage=(hd0,0)/grub/splash.xpm.gz[/b]
hiddenmenu
title CentOS (2.6.32-220.7.1.el6.i686)
[b]root (hd0,0)[/b]
kernel /vmlinuz-2.6.32-220.7.1.el6.i686 ro root=/dev/mapper/vg_fileserver-LogVol00
rd_MD_UUID=85da8407:95b46f97:b25099d7:5a92b9da rd_NO_LUKS LANG=en_US.UTF-8 quiet
SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=pl2
rd_LVM_LV=vg_fileserver/LogVol00 rd_NO_DM rd_LVM_LV=vg_fileserver/LogVol02
initrd /initramfs-2.6.32-220.7.1.el6.i686.img
title CentOS (2.6.32-220.el6.i686)
root (hd1,0)
kernel /vmlinuz-2.6.32-220.el6.i686 ro root=/dev/mapper/vg_fileserver-LogVol00
rd_MD_UUID=85da8407:95b46f97:b25099d7:5a92b9da rd_NO_LUKS LANG=en_US.UTF-8 quiet
SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=pl2
rd_LVM_LV=vg_fileserver/LogVol00 rd_NO_DM rd_LVM_LV=vg_fileserver/LogVol02
initrd /initramfs-2.6.32-220.el6.i686.img
[/code]

Post Reply