From ThirdMartini

fsdisk is a linux driver that can be bound to another physical or logical block device and used as a pass through fault injector. It is capable of injecting a variety of recoverable and non recoverable disk errors. It is actively being used to test the quickraid driver.

Contents

[edit] Installation:

  1. Download the tar ball and untar it. ( tar -vxf fsdisk-x.x.tar )
  2. Change to the directory and type in "make"
  3. The make process will generate a driver file ( fsd.o ) and a controll tool ( fsdioctl )
  4. You can load the driver by typing in insmod ./fsd.o

[edit] Usage:

The driver can be configured with several load time parameters

  • fsd_device_major: Allows you to change the major number of the device nodes the driver will create post load. ( default = 201 )
  • fsd_num_disks: The number of devices to export for binding. ( default = 8, max =32 )

Example:

insmod ./fsd.o fsd_device_major=220 fsd_num_disks=12 

[edit] Device Control:

The fsdioctl tool is used to manage device bindings and fault injection configuration. It takes the following options: --bind [target] [fsd device to bind to]:

Bind a physical block target device to an fsd device. Once bound you can do normal block device operations such as read,write, format, etc to the fsd device.

fsdioctl --bind /dev/hdd7 /dev/fsd/fsdisk7 

-unbind [fsd device]

Unbind the specified fsd device. releasing the attached physical block device for other uses.

fsdioctl --unbind /dev/fsdisk7 

--set-error [fsd device] [type] options=[options]:

Set a fault injection mode on the specified fsd device. The following fault injection options are available.

TypeOptionsDescription
noneR|W|RWDisable fault injection for this device for the specified io operations. ( R=read,W=write, RW=read+write)
lbaR|W|RW|,lbaFail only requests to this specific lba
rangeR|W|RW,start,stopFail only requests to any io withing the start,stop range inclusive.
randomR|W|RW,rateFail io requests at random using the specified target rate. rate is specified in terms of % failure rate.

[edit] Example:

Set the read channel to always fail reads for lba=0, and randomly fail writes.

fsdioctl --set-error lba options=R,0
fsdioctl --set-error random=W,80

[edit] Download:

    Filename Version Description
    fsdisk 0.2 Linux Fault Simulating Disk Device
    Personal tools