Help with ES v3 Raid1 (Mirror)

Léveillé, Marc Marc.Leveille at nrc-cnrc.gc.ca
Thu Feb 2 16:41:10 UTC 2006


Thanks this solved things. Here is my recap. It seems that I was chasing "witch came first, the chicken or the egg". I will try to explain as best as I can.

When running the procedure in previous posts, it would get me to work only after creating the /dev/md0 device, witch I could mount and use till I re-booted. 

Now, the interesting part. 
while trying to run mdadm --detail --scan > /etc/mdadm.conf would fail because mdadm was not started. So no config file no start. I rebuilt the device, but before re-booting I ran the command and it populated the mdadm.conf file except for my DEVICE /dev/sdb1 /dev/sdc1 Line. I guess that after building md0 with mdadm, it actually starts mdadm. This explains why it only worked after a new build of md0. So now I have the mdadm.conf file and entered the following into rc.local 

mdadm --assemble --scan /dev/md0
mount -t ext3 /dev/md0 /home/apps

I then got some errors at boot up because I had not set /dev/md0 in fstab to be noauto.

All is well now. Thanks to Cleber and Eric to have the patients to stick with me on this long one, but not all is lost as I have learned a lot through this whole thing. Even after 20 years in computers (only 3 with Linux) we learn new stuff.

Again many thanks

Marc



-----Original Message-----
From: redhat-list-bounces at redhat.com [mailto:redhat-list-bounces at redhat.com] On Behalf Of Eric Sisler
Sent: Thursday, February 02, 2006 9:41 AM
To: General Red Hat Linux discussion list
Subject: Re: Help with ES v3 Raid1 (Mirror)

On Wed, 2006-02-01 at 11:58, Marc Leveille wrote:

> I have tried this all morning without success. I also tried making the
> raid device using sdb1 and sdc1 as oppesed to sdb and sdc. Here is what
> I am doing in exact steps because sometimes one little thing can mess
> things up.
> 
> 1- Fdisk sdb and create a primary partition with full size of drive and
> set type to FD (Linux Raid). write and exit
> 2- same as step 1 but for sdc.
> 3- run the command to make raid device. "mdadm --create /dev/md0
> --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1
> 4- mkfs.ext3 /dev/md0 (completes with noe errors)
> 5- e2fsck -f /dev/md0 (works with no errors)
> 6- add line in fstab
> /dev/md0   /home/apps  ext3    defaults  1 2
> 
> reboot and get
>    FSCK.ext3 /dev/mdo the superblock could not be read or does not
> describe a correct EXT2 Filesystem.......bla bla and asks to run E2FSCK
> -B 8193 

Back to my earlier question: are you running a 2.4.x or 2.6.x kernel? 
AFAIK, the 2.4.x kernels do *NOT* include a startup script using the
mdadm method, only the raidtools method.  If you are running a 2.4.x
series kernel you'll have start the RAID array and mount the filesystem
later in the boot.  Something like the following added to rc.local
should work:

#
# Start the software RAID array and mount the filesystem
#
mdadm --assemble --scan /dev/md0
mount -t ext3 /dev/md0 /home/apps

I think the --scan option requires a valid /etc/mdadm.conf file, which
should look something like this:
DEVICE /dev/sda1 /dev/sdb1
 
ARRAY /dev/md0 level=raid1 num-devices=2
      UUID=d2105e8e:6e0520b4:40e78ca7:365146a6
      devices=/dev/sda1,/dev/sdb1

You'll need to change the devices & UUID as appropirate.  You can get
the UUID via "mdadm --detail /dev/md0".  The drawback to this method is
you can't use the /etc/fstab entry because the RAID device hasn't been
started yet.

If you're running a 2.4.x kernel you can use the raidtools method to
automatically start the RAID device during boot, which means you can
leave the /etc/fstab entry.  An /etc/raidtab entry for the same device
would look something like:

raiddev                /dev/md0
raid-level             1
nr-raid-disks         2
nr-spare-disks        0
 
device                 /dev/sda1
raid-disk              0
 
device                 /dev/sdb1
raid-disk              1

During boot, /etc/raidtab will be read and the RAID device started and
the entry in /etc/fstab should work.

Both raidtools & mdadm manipulate the same RAID devices, raidtools is
the standard for 2.4.x kernels, mdadm the standard for 2.6.x kernels.

-Eric

-- 

Eric Sisler <esisler at westminster.lib.co.us>
Library Applications Specialist
Westminster Public Library
Westminster, CO USA

Linux - Don't fear the Penguin.
Want to know what we use Linux for?
Visit http://wallace.westminster.lib.co.us/linux

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list




More information about the redhat-list mailing list