/usr/lib/zfs-linux/zpool.d/media is in zfsutils-linux 0.7.5-1ubuntu15.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #!/bin/sh
#
# Print out the type of device
#
if [ "$1" = "-h" ] ; then
echo "Show whether a vdev is a file, hdd, or ssd."
exit
fi
if [ -b "$VDEV_UPATH" ]; then
device=$(basename "$VDEV_UPATH")
val=$(cat "/sys/block/$device/queue/rotational" 2>/dev/null)
if [ "$val" = "0" ]; then
MEDIA="ssd"
fi
if [ "$val" = "1" ]; then
MEDIA="hdd"
fi
else
if [ -f "$VDEV_UPATH" ]; then
MEDIA="file"
fi
fi
echo "media=$MEDIA"
|