high-speed-storage-benchmark.sh
Bash script using fio to measure sequential throughput and random IOPS on the PCIe Gen5 NVMe storage.
Install 'fio'. Ensure the NVMe SSD is detected (lsblk). The M.2 slot is PCIe Gen5 x4, offering theoretical speeds over 10 GB/s. Beware of data loss on the device.
high-speed-storage-benchmark.sh
#!/bin/bash
# Benchmark de stockage NVMe sur PICO-PTH4
# Le slot M.2 2280 M-Key supporte PCIe Gen5 x4.
# Nécessite 'fio' installé.
DEVICE="/dev/nvme0n1" # Vérifier avec lsblk
if [ ! -e "$DEVICE" ]; then
echo "Erreur: Device $DEVICE introuvable. Vérifiez lsblk."
exit 1
fi
echo "Démarrage du benchmark fio sur $DEVICE..."
# Test d'écriture séquentielle (1MB blocks)
fio --name=seqwrite --rw=write --bs=1m --size=1G --numjobs=1 --iodepth=32 --runtime=60 --time_based --direct=1 --ioengine=libaio --filename=$DEVICE --group_reporting
# Test de lecture séquentielle
fio --name=seqread --rw=read --bs=1m --size=1G --numjobs=1 --iodepth=32 --runtime=60 --time_based --direct=1 --ioengine=libaio --filename=$DEVICE --group_reporting
# Test d'écriture aléatoire 4K (IOPS)
fio --name=randwrite --rw=randwrite --bs=4k --size=1G --numjobs=4 --iodepth=64 --runtime=60 --time_based --direct=1 --ioengine=libaio --filename=$DEVICE --group_reporting
echo "Benchmark terminé."