Dblstorctl
Overview
The 'dblstorctl' utility is designed to interface with and test our DoubleStore format from POSIX compliant systems. This has been tested to run on our boards, OSX, and common Linux distributions.
Usage
Usage: dblstorctl [OPTION] ... Technologic Systems DoubleStore image manipulation. General options: -p, --primary=FILE Use FILE as primary store -F, --fallback=FILE Use FILE as fallback store -e, --resilver Force a resilvering of the dataset -Z, --size=SZ Set dataset size to SZ (2.0G, 50M, etc) -I, --init Initialize and zero the dataset -s, --stresstest Start a stress test -S, --savebadblocks Save bad blocks to files in the CWD -n, --random=SEED Do random seeks for tests -d, --nbdserver=NBDSPEC Run NBD userspace block driver server -R, --read=N Read N blocks to stdout -W, --write=N Write N blocks -i, --writeimg=FILE Use FILE as file to write -t, --writetest Run write speed test -r, --readtest Run read speed test -a, --read-ahead Turn on 128kbyte read-ahead -c, --write-combine Enables combining small writes together -P, --printmbr Print MBR and partition table -M, --setmbr Write MBR from environment variables -f, --foreground Run NBD server in foreground -z, --blocksize=SZ Use SZ bytes each read/write call -k, --seek=SECTOR Seek to 512b sector number SECTOR -I, --bind=IPADDR Bind NBD server to IPADDR -m, --dmesg Print latest debug messages -T, --dmesg-follow Follow/tail debug messages -Q, --stats Print stats and status When running a NBD server, NBDSPEC is a comma separated list of devices and partitions for the NBD servers starting at port 7550. e.g. "lun0:part1,lun0:disc" corresponds to 2 NBD servers, one at port 7550 serving the first partition of the dataset, and the other at TCP port 7551 serving the whole disc device of the dataset.
Getting Started
This utility has 3 main functions.
- Stress testing cards
- Diagnosing Conflicts and Failures between stores
- Mounting and accessing doublestore partitions from other POSIX operating systems (Linux, OSX, BSD, etc)
Building and Installing dblstorctl
Download the dblstorctl.c from our FTP. To build this install the GNU build tools on your operating system so you have gcc. On our Debian SBCs, this is provided by the 'build-essential' package in apt-get.
gcc dblstorctl.c -o dblstorctl
# Copy this to somewhere in your $PATH. This example works on most common Linux systems
cp dblstorctl /usr/local/bin/
Stress Testing Cards
The 4GB SDHC Sandisk cards we ship with have been thoroughly tested with DoubleStore. If you order your own SD cards from another distributor we recommend expending several cards from each batch to verify stability of the media. This way you can estimate a predictable lifetime of your product.
To stress test a card insert the SD card into your PC and run these commands. After you insert the card type 'dmesg' which on most Linux systems will print the block device such as /dev/sd? or /dev/mmcblk?. In my example this is /dev/sdf.
dblstorctl --primary=/dev/sdf --stresstest --foreground
Once you have a good idea of how long your cards last, you can test future batches to verify lifetime. For example if you found your cards make it consistently to 6TB you can test future cards to that specification. For example:
export STRESSTEST_LENGTH="6T"
dblstorctl --primary=/dev/sdf --stresstest
You can run the stresstest for a number of bytes (b), kilobytes (k), megabytes (m), gigabytes (g), or terabytes (t). You can also test by minutes (m), hours (h), days (d), or weeks (w).