blob: b20110c33ce9f886d9ddc3d095a199901f929f36 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#!/bin/sh
# testzed: A useful utility for testing ZFS ZED configurations.
if [ "$(id -u)" -ne 0 ]; then
echo "script requires root privileges" >&2
exit 1
fi
FILE=/tmp/sparse_file
POOL="test"
# Create throwaway pool.
dd if=/dev/zero of=$FILE bs=1 count=0 seek=512M
zpool create $POOL $FILE
# Scrub the pool (which will finish instantly) to send out a notification.
# Ensure that ZED is configured with the option `ZED_NOTIFY_VERBOSE=1` to
# receive an email even if no errors occurred.
zpool scrub $POOL
# Clean up after ourselves.
zpool export $POOL
rm $FILE
|