On Wed, 28 Sep 2011 17:59:49 -0700 Jojy Varghese <jojy.varghese@xxxxxxxxx> wrote: > Thanks Neil. I tried setting my sda7 partition to generate write > errors every 40 bytes(writing 1 byte at a time). I did : md doesn't see byte writes. It sees sectors or more - usually whole pages or groups of pages. > > 1. Create a array with: > mdadm -C /dev/md/me0 -l faulty -n1 /dev/sda7 -C will write a superblock to /dev/sda7 which you don't really want. It doesn't hurt, but I always used -B (--build) to avoid any metadata. > > After this step I can see /dev/md127 and when i do a mdadm -D /dev/md127, i get: > > /dev/md127: > Version : 1.2 > Creation Time : Wed Sep 28 17:35:50 2011 > Raid Level : faulty > Array Size : 969410424 (924.50 GiB 992.68 GB) > Raid Devices : 1 > Total Devices : 1 > Persistence : Superblock is persistent > > Update Time : Wed Sep 28 17:35:50 2011 > State : clean > Active Devices : 1 > Working Devices : 1 > Failed Devices : 0 > Spare Devices : 0 > > Name : eng-dev16.lab.local:me0 (local to host eng-dev16.lab.local) > UUID : 96f4be10:312f9574:f40107aa:d9f278ba > Events : 0 > > Number Major Minor RaidDevice State > 0 8 7 0 active sync /dev/sda7 > > > 2. Set write fault level with: > > mdadm -G /dev/md/me0 --layout=wp40 > > > > After this when i write > 40 bytes into /dev/md127, i dont get any > I/O errors. I am sure i am doing something wrong here. When you write to /dev/md127 it will just go into the page cache and eventually be flushed to the device in one write. Use O_DIRECT or O_SYNC and it will be flushed out more quickly, but always write at least 512 bytes at a time. NeilBrown > > > Any help is much appreciated. > > Thanks > Jojy
Attachment:
signature.asc
Description: PGP signature