nvme_storage_benchmark.sh
Bash script using fio to measure read/write throughput of the NVMe SSD inserted into the board's M.2 slot.
Hardware: M.2 NVMe SSD installed in Xerxes Nano PCIe Gen 3 M.2 port. Software: Linux (Ubuntu/JetPack), fio tool. Execution: sudo chmod +x benchmark.sh && sudo ./benchmark.sh. Warning: Tests overwrite data on the target disk.
nvme_storage_benchmark.sh
#!/bin/bash
# Script de benchmark pour le stockage NVMe sur Xerxes Nano
# Nécessite l'installation de 'fio' (sudo apt install fio)
TARGET_DEVICE="/dev/nvme0n1" # À adapter selon 'lsblk'
TEST_FILE="testfile"
SIZE="1G"
if [ ! -b "$TARGET_DEVICE" ]; then
echo "Erreur : Périphérique $TARGET_DEVICE non trouvé. Utilisez 'lsblk' pour identifier le disque."
exit 1
fi
echo "Démarrage du benchmark de lecture séquentielle..."
fio --name=seqread --rw=read --bs=1M --size=$SIZE --runtime=30 --time_based --direct=1 --filename=$TARGET_DEVICE
echo "Démarrage du benchmark d'écriture séquentielle..."
fio --name=seqwrite --rw=write --bs=1M --size=$SIZE --runtime=30 --time_based --direct=1 --filename=$TARGET_DEVICE
echo "Démarrage du benchmark aléatoire 4K..."
fio --name=rand4k --rw=randrw --bs=4k --size=$SIZE --runtime=30 --time_based --direct=1 --filename=$TARGET_DEVICE
echo "Benchmark terminé."