This repository contains a Bash script designed to automate KX Nano-based performance testing across various Linux filesystems, including ext4, xfs, btrfs, f2fs, and zfs.
🚨 EXTREME CAUTION ADVISED 🚨
This script is DESTRUCTIVE. It will IRREVERSIBLY WIPE ALL DATA on the specified target block device. Double-check the
DEVICEvariable before execution. We are not responsible for any data loss.
The script performs the following actions in a loop for each specified filesystem:
- Wipes any existing filesystem signatures from the target device.
- Creates a new filesystem.
- Mounts the filesystem to a specified mount point.
- Executes KX Nano performance test (
multiproc.sh). - Unmounts the filesystem and cleans up the device to prepare for the next run.
This automated workflow makes it easy to gather comparative performance data across different filesystems on the same hardware.
Before running the script, ensure the following requirements are met:
The script runs a few Linux command (e.g. mount, umount, wipefs) via sudo so the user must be granted sudo privileges.
You must install the necessary userspace tools for all filesystems you intend to test. You can install them on a Debian/Ubuntu system with:
sudo apt-get update
sudo apt-get install -y f2fs-tools xfsprogs btrfs-progs zfsutils-linux(e2fsprogs for ext4 is typically installed by default)
The script is configured using environment variables. You must set these before running the script.
| Variable | Description | Example |
|---|---|---|
DEVICE |
(Required) The target block device to format. BE EXTREMELY CAREFUL. | export DEVICE=/dev/nvme0n1 |
MOUNT_POINT |
(Required) The directory where the filesystems will be mounted. | export MOUNT_POINT=/mnt/fsbenchmark |
-
Navigate to the directory containing the
main.shscript.cd ./scripts/fsBenchmark -
Set the required environment variables
export DEVICE=/dev/sdX # <-- Change this to your actual device! export MOUNT_POINT=/mnt/fsbenchmark
Alternatively, you can edit
.envandsource .env -
Execute the script, providing the path to your desired output directory as the only argument.
./main.sh ./results/fsbenchmark
The script will generate one output file for each filesystem tested. The files will be saved in the directory you provided as a command-line argument.
ext4.psvxfs.psv- etc.
The files are in Pipe-Separated Values (.psv) format, which can be easily imported into data analysis tools or spreadsheets.
To change the list of filesystems to be tested, simply edit the FILESYSTEMS array at the top of the main.sh script:
# Edit this line to add or remove filesystems
readonly FILESYSTEMS=("ext4" "xfs")