LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-17-2011, 10:17 AM   #1
Hwyman
LQ Newbie
 
Registered: Oct 2011
Posts: 2

Rep: Reputation: Disabled
Question GRUB + Adding spare to software RAID-1 on CentOS 5.7


Hi!

I originally had a software RAID-1 setup with two disk. Unfortunately, I discovered (too late) that GRUB was not configured properly and was only booting off of the first disk, hd0 (i.e. /dev/sda). Guess which disk failed on me?

I fixed the above mess, and now I want to add a third drive, /dev/sdc, to my working software RAID-1 as a spare. Please give me a sanity check on this as well as telling me if I added extra steps that are not needed:

First I copied the partition table to my new drive:
sfdisk -d /dev/sda | sfdisk /dev/sdc

This gave me /dev/sdc1 as type fd (Linux raid autodetect).

I then added /dev/sdc1 to my raid:
mdadm --add /dev/md0 /dev/sdc1

I look at /proc/mdstat and see sdc1[2](S) meaning that the spare has been added.

Finally, I create a new /etc/mdadm.conf using:
mdadm --examine --scan > /etc/mdadm.conf

Now to deal with GRUB. I want to be able to boot off of any of the three disks that are now in my software RAID-1. After editting, the top of my /boot/grub/menu.1st file has:
default=0
fallback=1 2
timeout=5

I also added a third kernel stanza by copying the previous stanza and changing the root line to read:
root (hd2,0)

Finally, I generated a new ramdisk using:
mkinitrd /boot/initrd-`uname -r`.img `uname -r`

Before adding the spare, I installed the GRUB bootloader on the first and second drives, hd0 and hd1 respectively.

Do I need to install the bootloader on the spare as well or will that be copied if the spare is activated and the array is rebuilt? Is there anything else I need to do?

Thanks!
 
Old 10-17-2011, 11:29 AM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
You need to copy/install the bootloader to the spare; the RAID portion of the drive is only the FD partition, while the bootloader is (typically) in the MBR.
 
Old 10-17-2011, 03:32 PM   #3
Hwyman
LQ Newbie
 
Registered: Oct 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
I see. I wasn't sure if the mechanism that brings the two disks into sync in a mirrored array would handle the MBR. I discovered that the device had to be formatted before it could successfully run the setup command under the GRUB shell. In order to format, I had to remove the device from the array (no need to fail the device first since it was a spare) first.

Every thing seems to be fine now. Hopefully the array will gracefully survive the next drive failure.

Thanks for the help!
 
Old 10-17-2011, 04:12 PM   #4
hen770
Member
 
Registered: Oct 2010
Distribution: Arch
Posts: 136

Rep: Reputation: 7
Way you need the new ramdisk?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to spin-off software raid spare disks n0bster Linux - Server 1 06-25-2010 12:59 PM
Adding an old software-RAID array to a software-RAID installation.. Boot problems GarethM Linux - Hardware 2 05-05-2008 03:16 PM
Adding a new RAID HardDisk in a already running CentOS 4.0 romeo_tango Linux - Hardware 5 12-07-2006 04:08 AM
Software RAID 1 setup on CentOS using Grub boot loader kumarsundaram Linux - Software 1 11-30-2005 12:57 PM
How do I add a spare to existing software RAID 5 ? philforrest Linux - Software 1 12-28-2003 09:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration