Advertisement

05.21.2008 at 09:28PM PDT, ID: 23423263
[x]
Attachment Details

Add RAID1 to Existing CentOS Installation

Asked by josh2780 in Linux Administration, Linux Setup

I have a CentOS 5 server with 2 drives (/dev/sda and /dev/sdb).  It was originally setup without RAID (/dev/sdb was blank).  I've gone through the process of configuring the second drive, setting up the raid, etc.  When I try to boot the RAID, it hangs with the following message:

-----
mount: could not find filestystem '/dev/root'.
Setting up other filesystems
Setting up new root fs
setuproot: moving /dev failed: No such file or directory
no fstab.sys mounting internal defaults
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
Switching to new root and running init
unmounting old /dev/
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: Attempted to kill init
-----

Here's a summary of what I did to setup the RAID:

1) copy the partition table from /dev/sda to the secondary drive /dev/sdb
2) change the partition types to 'Linux raid auto'
3) create RAID 1 arrays (/dev/md1 as boot, md2 as swap, md3 as root)
4) Format filesystems (md1 and md3) and create the swap space (md2)
5) Rebuild initrd image to include raid1 (mkinitrd -v --preload=raid1 /root/initrd-2.6.18-53.1.19.el5.raid1.img 2.6.18-53.1.19.el5)
6) Modify /boot/grub/grub.conf and add the new boot option using the image just created:
title CentOS (2.6.18-53.1.19.el5) RAID1
        root (hd1,0)
        kernel /vmlinuz-2.6.18-53.1.19.el5 ro root=/dev/md3
        initrd /initrd-2.6.18-53.1.19.el5.raid1.img
7) Mount the raid devices (/dev/sda1 (boot) and /dev/sda3 (root))
8) Copy the contents of /dev/sda[1,3] to /dev/md[1,3] which are mounted on /mnt/md[1,3]  (using 'cp -a' to preserve everything)
9) Install grub on /dev/sdb (grub-install /dev/sdb) so that later the second drive can boot in the event the first drive fails.
10) Update /etc/fstab on /dev/md3 to use the raid devices (/dev/md[1,2,3]) instead of /dev/sda[1,2,3]
11) Reboot.  At the grub menu, select the RAID option created earlier.

Any ideas of where to go next?Start Free Trial
[+][-]05.21.2008 at 11:56PM PDT, ID: 21621487

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 05:18AM PDT, ID: 21623025

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 06:21AM PDT, ID: 21623541

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 07:04AM PDT, ID: 21623900

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 09:11AM PDT, ID: 21625125

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Linux Administration, Linux Setup
Sign Up Now!
Solution Provided By: ravenpl
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.22.2008 at 10:45AM PDT, ID: 21625946

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 10:50AM PDT, ID: 21626012

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 10:55AM PDT, ID: 21626052

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628