Hello group,
I am trying to understand software RAID-1. In order to learn
a bit I am experimenting with Software RAID on a Linux box.
The hardware I use is a PII 300 MMX with 64 MB memory.
Two identical IDE Hard drives Fujitsu MPC3043AT 4.3 GB
The OS is RedHat5.2 And the kernel is 2.2.3 patched with
raid0145-19990309-2.2.3 and the raidtools-0.90-2 are installed.
I had RAID-1 running (and still am :) using the /etc/raidtab below.
My /etc/raidtab file
# raid-1 configuration
raiddev /dev/md0
raid-level 1
nr-raid-disks 2
nr-spare-disks 0
chunk-size 4
persistent-superblock 1
device /dev/hda12 #200MB
raid-disk 0
device /dev/hdc3 #200MB
raid-disk 1
After done some writing, raidstop, mount hda12, etc... etc raidstart
test test...... I wondered what would happen
if I halted my system, removed the IDE connector from drive hdc and the
restart the system.
Well everything worked fine.. I ended up with an degraded RAID system
but my data on the RAID device was
still there as it was suppose to be.
Then I halted my system again and I put the IDE connector back. After
starting the system again I got the
following messages from the kernel:
autodetecting RAID arrays
(read) hda12's sb offset: 200704 [events: 00000014]
(read) hdc3's sb offset: 204480 [events: 0000000c]
autorun ...
considering hdc3 ...
adding hdc3 ...
adding hda12 ...
created md0
bind<hda12,1>
bind<hdc3,2>
running: <hdc3><hda12>
now!
hdc3's event counter: 0000000c
hda12's event counter: 00000014
md: superblock update time inconsistency -- using the most recent one
freshest: hda12
md: kicking non-fresh hdc3 from array!
unbind<hdc3,1>
export_rdev(hdc3)
md0: max total readahead window set to 128k
md0: 1 data-disks, max readahead per data-disk: 128k
raid1: device hda12 operational as mirror 0
raid1: md0, not all disks are operational -- trying to recover array
raid1: raid set md0 active with 1 out of 2 mirrors
md: updating md0 RAID superblock on device
hda12 [events: 00000015](write) hda12's sb offset: 200704
md: recovery thread got woken up ...
md0: no spare disk to reconstruct array! -- continuing in degraded mode
md: recovery thread finished ...
To make an end to this long story....how do I get my hdc3 device back in
the
RAID array. The HOWTO said: mkraid "config_file_here" -f
--only-superblock
only this option does not seem to work. Neither does ckraid.....only the
man
page is present. I also tried dd if=dev/hda12 of=dev/hdc3 this restores
the
data on the partition but does not restore my array because of the
superblock.
How can I get hdc3 back in the RAID array without loosing my data on
hda12 ?
Thanks in advance,
And sorry for the long message.
- Alex
PS I got my workstation living in the present again ;)