Summary:
RAID5 over loopback devices fails with random virtual
disk corruption.
[If you're wondering why I was doing this - it was
to test the general stability of Linux-RAID + SMP
without actually buying another bunch of SCSI disks ...]
Setup:
kernel 2.2.1 + RAID0145 1999 01 28 patches
SMP (2 * 350 MHz Pentium II)
Create four 1 gig files on a local IDE drive as follows:
dd if=/dev/zero of=vdisk.0 count=1024 bs=1024k
cp vdisk.0 vdisk.1
cp vdisk.1 vdisk.2
cp vdisk.2 vdisk.3
Create loopback devices:
/sbin/losetup /dev/loop0 vdisk.0
/sbin/losetup /dev/loop1 vdisk.1
/sbin/losetup /dev/loop2 vdisk.2
/sbin/losetup /dev/loop3 vdisk.3
Create RAID5 device:
cat > raidtab
# Test RAID / loopback device.
raiddev /dev/md0
raid-level 5
nr-raid-disks 3
nr-spare-disks 1
parity-algorithm left-symmetric
chunk-size 32
device /dev/loop0
raid-disk 0
device /dev/loop1
raid-disk 1
device /dev/loop2
raid-disk 2
device /dev/loop3
spare-disk 0
/sbin/mkraid -c raidtab /dev/md0
Create filesystem:
/sbin/mkfs.ext2 /dev/md0
Mount filesystem:
mkdir raid; mount /dev/md0 raid
Use stress test script (attached):
./stress.sh -n 16 -c /usr/doc/LDP /mountpoint/raid
[ Note: If you're not using RedHat, then substitute
another content directory with about 10 MB of random
files in it. ]
Wait 20 minutes or so.
Examine error messages showing disk corruption at
your pleasure :-) Two small samples attached.
Rich.
--
Bibliotech Ltd., 631-633 Fulham Rd., London SW6 5UQ. +44 171 460 4646
http://www.bibliotech.co.uk Home page: http://www.annexia.demon.co.uk
Home email: [EMAIL PROTECTED] Work: [EMAIL PROTECTED]
Original message content Copyright © 1999 Richard Jones
stress.sh
Feb 15 11:40:20 queen kernel: EXT2-fs warning (device 09:00): empty_dir: bad directory
(dir #190465) - no data block
Feb 15 11:40:20 queen kernel: EXT2-fs warning (device 09:00): ext2_rmdir: empty
directory has nlink!=2 (0)
Feb 15 11:40:20 queen kernel: EXT2-fs warning (device 09:00): ext2_free_blocks: bit
already cleared for block 762124
Feb 15 11:40:20 queen kernel: EXT2-fs warning (device 09:00): ext2_free_blocks: bit
already cleared for block 763457
[ repeated a number of times ]
Feb 15 11:52:24 queen kernel: EXT2-fs warning (device 09:00): ext2_free_blocks: bit
already cleared for block 270605
Feb 15 11:52:24 queen last message repeated 11 times
Feb 15 11:52:25 queen kernel: EXT2-fs error (device 09:00): ext2_free_blocks: Freeing
blocks not in datazone - block = 772419082, count = 1
Feb 15 11:52:25 queen last message repeated 2 times
Feb 15 11:52:25 queen kernel: EXT2-fs error (device 09:00): ext2_free_blocks: Freeing
blocks not in datazone - block = 1007300106, count = 1
Feb 15 11:52:25 queen kernel: EXT2-fs error (device 09:00): ext2_free_blocks: Freeing
blocks not in datazone - block = 1163022383, count = 1
Feb 15 11:52:25 queen kernel: EXT2-fs error (device 09:00): ext2_free_blocks: Freeing
blocks not in datazone - block = 1413758014, count = 1
Feb 15 11:52:25 queen kernel: EXT2-fs error (device 09:00): ext2_free_blocks: Freeing
blocks not in datazone - block = 541146174, count = 1
Feb 15 11:52:25 queen kernel: EXT2-fs error (device 09:00): ext2_free_blocks: Freeing
blocks not in datazone - block = 1162690894, count = 1
Feb 15 11:52:25 queen kernel: EXT2-fs error (device 09:00): ext2_free_blocks: Freeing
blocks not in datazone - block = 959980093, count = 1
Feb 15 11:52:25 queen kernel: EXT2-fs error (device 09:00): ext2_free_blocks: Freeing
blocks not in datazone - block = 775823921, count = 1
[ repeated a very large number of times ]