Operating System - Linux
1821216 Members
3126 Online
109632 Solutions
New Discussion юеВ

Re: Software RAID: Unable to boot from Second Disk

 
SOLVED
Go to solution
Yogeeraj_1
Honored Contributor

Software RAID: Unable to boot from Second Disk

Dear Experts!

I have done a new "RedHat Enterprise Linux Advanced Server Update 4" installation and most probably done a wrong configuration so that i am not able to both from the second disk which is supposed to be a mirror of the first boot disk. I have configured Software RAID.

Can any one explain why?

I am posting some information that may be useful to you in guiding me on how to fix this.

==========================================
[root@server1 ~]# more /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/md2 / ext3 defaults 1 1
/dev/md1 /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
/dev/md3 /home ext3 defaults 1 2
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
/dev/md4 /tmp ext3 defaults 1 2
/dev/md5 /var ext3 defaults 1 2
/dev/md0 swap swap defaults 0 0
/dev/hde /media/cdrecorder auto pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0
[root@server1 ~]# cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sdb2[1] sda2[0]
305152 blocks [2/2] [UU]

md2 : active raid1 sdb5[1]
6289344 blocks [2/1] [_U]

md3 : active raid1 sdb6[1] sda6[0]
4192832 blocks [2/2] [UU]

md5 : active raid1 sdb7[1] sda7[0]
2096384 blocks [2/2] [UU]

md4 : active raid1 sdb8[1] sda8[0]
2096384 blocks [2/2] [UU]

md0 : active raid1 sdb3[1] sda3[0]
20972736 blocks [2/2] [UU]

unused devices:
[root@server1 ~]# cat /etc/yaboot.conf
# yaboot.conf generated by anaconda

boot=/dev/sdb1 /dev/sda1
init-message=Welcome to Red Hat Enterprise Linux AS!\nHit for boot options

partition=2
timeout=20
install=/usr/lib/yaboot/yaboot
delay=5
nonvram

image=/vmlinuz-2.6.9-42.EL
label=linux
read-only
initrd=/mpp-2.6.9-42.EL.img
root=/dev/md2
append="rhgb quiet"

[root@server1 ~]#
==============================================

Thanking you in advance for your insights.

Kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
8 REPLIES 8
Stuart Browne
Honored Contributor
Solution

Re: Software RAID: Unable to boot from Second Disk

The issue is the grub boot loader.

Software RAID doesn't mirror the boot sector of the hard-drive.

So simply put, once the machine is built, you need to grub-install to the 2nd disks' boot sector to install the boot loader.

Once that's done, after a disk swap, it should successfully boot from the 2nd disk.
One long-haired git at your service...
Yogeeraj_1
Honored Contributor

Re: Software RAID: Unable to boot from Second Disk

Hi,

Thank you Stuart for the prompt response.

>So simply put, once the machine is built, you need to grub-install to the 2nd disks' boot sector to install the boot loader.

Do you have any link to this step?

I have got some guidelines from:
http://togami.com/~warren/guides/remoteraidcrazies/

(too scrary!!)

Below more info on the current partitions:
[root@server1 ~]# parted
GNU Parted 1.6.19
...
Using /dev/sda
(parted) p
Disk geometry for /dev/sda: 0.000-70006.835 megabytes
Disk label type: msdos
Minor Start End Type Filesystem Flags
1 0.031 7.844 primary boot
2 7.844 305.925 primary ext3 raid
3 305.925 20787.231 primary linux-swap raid
4 20787.231 70001.982 extended
5 20787.262 26929.270 logical ext3 raid
6 26929.301 31023.962 logical ext3 raid
7 31023.993 33071.308 logical ext3 raid
8 33071.339 35118.654 logical ext3 raid
9 35118.686 55599.960 logical
(parted) q
Information: Don't forget to update /etc/fstab, if necessary.

[root@server1 ~]# parted /dev/sdb
GNU Parted 1.6.19
...
Using /dev/sdb
(parted) p
Disk geometry for /dev/sdb: 0.000-70006.835 megabytes
Disk label type: msdos
Minor Start End Type Filesystem Flags
1 0.031 7.844 primary boot
2 7.844 305.925 primary ext3 raid
3 305.925 20787.231 primary linux-swap raid
4 20787.231 70001.982 extended
5 20787.262 26929.270 logical ext3 raid
6 26929.301 31023.962 logical ext3 raid
7 31023.993 33071.308 logical ext3 raid
8 33071.339 35118.654 logical ext3 raid
9 35118.686 55599.960 logical
(parted) q
Information: Don't forget to update /etc/fstab, if necessary.

[root@server1 ~]#


Does this imply a copy of the partition table to the second disk:

e.g. sfdisk -d /dev/sda > /tmp/partitions.txt
then

fdisk -d /dev/sdb < /tmp/partitions.txt


Please advise further

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Stuart Browne
Honored Contributor

Re: Software RAID: Unable to boot from Second Disk

grub-install /dev/sdb

That should be all that's needed once all the raid stuff is set up (which it looks to be).
One long-haired git at your service...
Yogeeraj_1
Honored Contributor

Re: Software RAID: Unable to boot from Second Disk

Hi Stuart!

thanks again for your reply.

[root@server1 ~]# grub-install /dev/sdb
-bash: grub-install: command not found
[root@server1 ~]#


There does not seem to be any grub software installed. Is it another rpm that needs to be added? any other alternatives?

please advise further..

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Rob Leadbeater
Honored Contributor

Re: Software RAID: Unable to boot from Second Disk

Hi,

Maybe it's just a path thing... You could try:

# /sbin/grub-install /dev/sdb

Failing that, this RedHat article may help...

http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/en-US/System_Administration_Guide/s2-rescuemode-boot-reinstall-bootloader.html

Cheers,

Rob
skt_skt
Honored Contributor

Re: Software RAID: Unable to boot from Second Disk

#whereis grub-install
grub-install: /sbin/grub-install /usr/share/man/man8/grub-install.8.gz
#rpm -qa|grep -i grub
grub-0.95-3.8
Yogeeraj_1
Honored Contributor

Re: Software RAID: Unable to boot from Second Disk

hi to all,

thank you for the responses.

Just want to clarify. I do not have the grub-install package installed on the system. But it seems to me that the bootloader does not use the grub configuration. Using yaboot instead.


[root@server1 ~]# yabootconfig --help
Usage: yabootconfig [OPTION]...
Generate a working /etc/yaboot.conf.

-t, --chroot set root directory yabootconfig should work from
-r, --root set root partition, Example: /dev/hda3
default: determined from {chroot}/etc/fstab
-b, --boot set bootstrap partition, Example: /dev/hda2
default: first type: Apple_Bootstrap partition
-C, --config set config file name (Example: /etc/yaboot.conf)
--kernel-args add an append= line with specified arguments
-q, --quiet don't ask any questions/confirmation
--noinstall don't automatically run mkofboot
-h, --help display this help and exit
-V, --version output version information and exit
[root@server1 ~]#


correct me if i am wrong.

i do not want to take risk of mess up everything by installing the grub-install rpm.

please advise

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Stuart Browne
Honored Contributor

Re: Software RAID: Unable to boot from Second Disk

Ah, boot loader I've never used before!

http://www.linux-sxs.org/storage/raid_setup.html

In particular the section near 'Example yaboot.conf:'.
One long-haired git at your service...