2002-09-13 23:36:41

by Leif Sawyer

[permalink] [raw]
Subject: Raid 1 Issues

I'm running 2.4.18, and trying to use Raid-1.

I created /etc/raidtab according to the instructions.
raiddev /dev/md0
raid-level 1
nr-raid-disks 2
nr-spare-disks 0
device /dev/hdc2
raid-disk 0
device /dev/hdb2
raid-disk 1

Next, I performed a raidsetup on my new disk (/dev/hdc2), and restarted. I
was
able to mount my new md0 with a single disk.

I then migrated all my data onto that new md0 and removed the old disk
(/dev/hdbX)
from /etc/fstab. I changed fstab to mount /dev/md0 as /usr and shutdown.

I removed the old /dev/hdb, and installed the new drive, a duplicate model
of /dev/hdc,
and restarted. I have no problems accessing /usr at this point, mounted
from /dev/md0.

I partitioned /dev/hdb to be exactly like /dev/hdc, and formatted it as
ext3.
I then used raidhotadd /dev/md0 /dev/hdb2 to try and add the new partition
to
my mirror.

"cat /proc/mdstat" shows the the devices connected, but not attached:

Personalities : [raid1]
read_ahead 1024 sectors
md0 : active raid1 ide/host0/bus0/target1/lun0/part2[1]
ide/host0/bus1/target0/lun0/part2[0]
77914752 blocks [1/1] [U]
unused devices: <none>


I waited for a while, installed some software, and then looked at
/proc/interrupts:
root@hedwig:~> cat /proc/interrupts
CPU0
0: 14635352 XT-PIC timer
14: 581245 XT-PIC ide0
15: 1341378 XT-PIC ide1

I have 2 disks on ide0,( / and /dev/hdb2), 2 disks on ide1 (/dev/hdc2 and
/dev/cdrom)

The difference in interrupts is really significant when moving data around.
ide0 doesn't
increment at the rate that ide1 does (nowhere close!) when accessing
/dev/md0 (mounted on /usr)

if I raidhotremove /dev/md0 /dev/hdb2, and then mount /dev/hdb2, there is
nothing on the
disk.

I've consulted the how-to without any success.

Thanks for any help or suggestions.


2002-09-17 01:33:09

by NeilBrown

[permalink] [raw]
Subject: Re: Raid 1 Issues

On Friday September 13, [email protected] wrote:
> I'm running 2.4.18, and trying to use Raid-1.
>
> I created /etc/raidtab according to the instructions.
> raiddev /dev/md0
> raid-level 1
> nr-raid-disks 2
> nr-spare-disks 0
> device /dev/hdc2
> raid-disk 0
> device /dev/hdb2
> raid-disk 1
>
SNIP
> "cat /proc/mdstat" shows the the devices connected, but not attached:
>
> Personalities : [raid1]
> read_ahead 1024 sectors
> md0 : active raid1 ide/host0/bus0/target1/lun0/part2[1]
> ide/host0/bus1/target0/lun0/part2[0]
> 77914752 blocks [1/1] [U]
> unused devices: <none>
>

There is an inconsistancy here. Your raidtab says "nr-raid-disks 2",
but mdstat shows there is only 1 raid-disk in the array.

You will need to recreate the array using "mkraid -R /dev/md0"
with a raidtab of
> raiddev /dev/md0
> raid-level 1
> nr-raid-disks 2
> device /dev/hdc2
> raid-disk 0
> device /dev/hdb2
> failed-disk 1

or with
mdadm -C /dev/md0 --level=1 -n 2 /dev/hdc2 missing

Then "raidhotadd /dev/md0 /dev/hdb2" or "mdadm /dev/md0 -a /dev/hdb2"
should add the other drive in.
Ofcourse you will need to unmount /usr and "raidstop -a" or "mdadm -Ss"
first.


mdadm is available at
http://www.cse.unsw.edu.au/~neilb/source/mdadm/

NeilBrown