At 16:15 2002/07/19 -0400, you wrote:

>Does anyone know if there is a way to check my RAID config to see if the
>RAID 1 setup is set correctly?

Yes, just run "cat /proc/mdstat" and it will tell you what all your 
software RAID (I assume that we're talking about software RAID here, 
otherwise consult the manual for your RAID controller) devices are doing. 
e.g. for a RAID-5 array on one of my systems I see:

$ cat /proc/mdstat
Personalities : [raid5]
read_ahead 1024 sectors
md0 : active raid5 sde1[1] sdd1[2] sdc1[0]
       132369600 blocks level 5, 4k chunk, algorithm 0 [3/3] [UUU]

unused devices: <none>
$

I'm sure this is documented somewhere, but basically this is telling me 
that three partitions are in use on three SCSI drives (the odd ordering is 
a result of a few raidhotadd operations on this machine), and I believe 
that the [UUU] indicates that they are all up to date (when one of the 
discs failed a while back this box showed [U_U]). If the devices were not 
in sync then the mdstat output would include an indication of how close to 
being in sync they were and how much longer it expected to take (sorry, no 
example of this).


>   Also is there a way to view the
>contents/file names of both mirrored hard drives independently in a RAID 1
>config?

Yes, it's not even very hard. Last time I looked for RAID-1 (only) you 
could mdstop the array (after un-mounting it) and then just mount the 
component partitions (read only) using the underlying filesystem. e.g. if 
your RAID device is /dev/md0 made up of /dev/sda1 and /dev/sdb1 and it 
contains an ext2 filesystem then you should be able to do:

# Make sure the array isn't mounted
umount /dev/md0

# Stop the MD device
mdstop /dev/md0

# Make a couple of mountpoints
cd /mnt
mkdir parta partb

# Mount the component devces
mount -t ext2 -oro /dev/sda1 parta
mount -t ext2 -oro /dev/sdb1 partb

# Recursively check for file differences
diff -NPrq


A more generic solution (it works with RAID levels 1, 4, and 5) would be to 
generate checksums for all the files on your RAID array and then use 
raidhotremove to remove one of your raid discs from the array and see if 
the checksums still match. If they do then raidhotadd the disc you removed, 
wait for the array to sync up again (you can check if it's in sync by 
reading /proc/mdstat), raidhotremove the other drive and test the checksums 
again. If the checksums all match up then your RAID device is not 
corrupted. Of course if you remove and then add your only non-corrupted 
copy your reconstruction would actually give you two copies of the corrupt 
version rather than the "clean" version. Normally you should only see data 
differences between the devices if you have a hardware problem which is 
both serious (resulting in data corruption on the disc) and very subtle 
(unless you're running old (pre UDMA) IDE interfaces which don't do error 
checking). I have never actually seen this happen or even heard of a case, 
so I can't really comment on how common it is or what you should do if it 
happens to you except from the obvious suggestion that you should replace 
the hardware involved post-haste.




_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to