how to corrupt disk data for zfs testings

Status
Not open for further replies.

berrywipe

Dabbler
Joined
Mar 11, 2012
Messages
19
hi all...
I have a 3 disks raidz1 array with useless data. I'd like to test zfs recovery capabitlities by simulating silent corruption on one disk.
Of course I can mount the disk in another system (another pc or just a bootable cd), but if I could do it from freenas it would be quicker.
I have tried something like this:
Code:
[root@freenas] ~# dd if=/dev/random of=/dev/ada1 bs=4k count=100

but this was the result:
Code:
dd: /dev/ada1: Operation not permitted


any way to bypass this? Another method for writing raw data on disks would be welcome as well.
 

StephenFry

Contributor
Joined
Apr 9, 2012
Messages
171
Using SARDU, I made a multi-boot USB stick with UltimateBootCD, Hiren's BootCD, etc. I then used a diskeditor I found on one of these "CDs" to muck around on a drive.
 

berrywipe

Dabbler
Joined
Mar 11, 2012
Messages
19
Yeah ultimate boot cd is exactly what I had tried when I was talking about "bootable CDs".
The reasons because of which I'd have liked an even faster method is that when accessing raw data o a disk you have to guess which sectors are actually in use by the raid, so it may take some tries.
Anyway I managed to hit some data sectors just yesterday and scrubbing worked like a charm, recovering 6 corrupted sectors spread over the disk.
Another time I corrupted sectors containing basic disk infos and the database was marked as degadated.
Off course resilvering fixed that.
ZFS rocks!
 
Status
Not open for further replies.
Top