statistiche web gratis
-Testiamo la velocità dei dischi sul QNAP NAS 4 dischi

Testiamo la velocità dei dischi sul QNAP NAS 4 dischi

Se avete un NAS della QNAP e siete curiosi di sapere a che velocità lavorano i dischi montati sui vari slot, oppure avete dei dubbi o problemi di lentezza ecco un utile script che può fare chiarezza.
Lo script in questione fa un test di scrittura e di copia tra i vari dischi

Utilizzando il comando linux dd su ogni disco crea un file vuoto di 1Gigabyte indicando la velocità in MB/s e quanto tempo ha impiegato e poi prova a fare la copia tra i vari dischi indicando i risultati.

se siete esperti con con l’editor vi potete fare copia e incolla da una shell ssh direttamente su un file dove piu vi piace, io l’ho posizionato sotto /share/HDA_DATA altrimenti potete scaricare lo script direttamente da qui QNAP_disk_speedtest_nolog.sh per quello senza log file oppure da qui QNAP_disk_speedtest.sh per quello che crea anche un file di report nella stessa dir dove lanciate lo script.

Scaricato lo script lo copiate sul nas nella directory /share/HDA_DATA

Aprire una shell in ssh sul QNAP

andare nella dir dove avete messo lo script QNAP_disk_speedtest_nolog.sh

cambiare i ditti del file con chmod 744 QNAP_disk_speedtest_nolog.sh

lanciarlo con ./QNAP_disk_speedtest_nolog.sh

ATTENZIONE: livello di difficoltà medio/alto l’esecuzione di script in generale su linux richiede una certa esperienza con i comandi, per tanto non mi assumo nessuna responsabilità per malfunzionamenti dello script con eventuale perdita di dati sul vostro dispositivo.

Script senza log file:

#!/bin/sh
###################################
# speed disk test for QNAP 4 bays #
#        without log file         #
#         by PeppeBytes           #
#        Oct-08-2015 v 1.0        #
###################################
date
echo ""
echo "Write Test on Disk 1"
start=`date +%s`
dd if=/dev/zero of=/share/HDA_DATA/write_test_file bs=1M count=1024
end=`date +%s`
runtime=$(python -c "print(${end} - ${start})")
matsec=$(python -c "print(1024 / ${runtime})")
echo "1GB in "$runtime"s - "$matsec"MB/s"
echo ""

echo "Write Test on Disk 2"
start=`date +%s`
dd if=/dev/zero of=/share/HDB_DATA/write_test_file bs=1M count=1024
end=`date +%s`
runtime=$(python -c "print(${end} - ${start})")
matsec=$(python -c "print(1024 / ${runtime})")
echo "1GB in "$runtime"s - "$matsec"MB/s"
echo ""

echo "Write Test on Disk 3"
start=`date +%s`
dd if=/dev/zero of=/share/HDC_DATA/write_test_file bs=1M count=1024
end=`date +%s`
runtime=$(python -c "print(${end} - ${start})")
matsec=$(python -c "print(1024 / ${runtime})")
echo "1GB in "$runtime"s - "$matsec"MB/s"
echo ""

echo "Write Test on Disk 4"
start=`date +%s`
dd if=/dev/zero of=/share/HDD_DATA/write_test_file bs=1M count=1024
end=`date +%s`
runtime=$(python -c "print(${end} - ${start})")
matsec=$(python -c "print(1024 / ${runtime})")
echo "1GB in "$runtime"s - "$matsec"MB/s"
echo ""

echo "Copy Test From Disk 1 to Disk 2"
start=`date +%s`
dd if=/share/HDA_DATA/write_test_file of=/share/HDB_DATA/write_test_file bs=1M count=1024
end=`date +%s`
runtime=$(python -c "print(${end} - ${start})")
matsec=$(python -c "print(1024 / ${runtime})")
echo "1GB in "$runtime"s - "$matsec"MB/s"
echo ""

echo "Copy Test From Disk 1 to Disk 3"
start=`date +%s`
dd if=/share/HDA_DATA/write_test_file of=/share/HDC_DATA/write_test_file bs=1M count=1024
end=`date +%s`
runtime=$(python -c "print(${end} - ${start})")
matsec=$(python -c "print(1024 / ${runtime})")
echo "1GB in "$runtime"s - "$matsec"MB/s"
echo ""

echo "Copy Test From Disk 1 to Disk 4"
start=`date +%s`
dd if=/share/HDA_DATA/write_test_file of=/share/HDD_DATA/write_test_file bs=1M count=1024
end=`date +%s`
runtime=$(python -c "print(${end} - ${start})")
matsec=$(python -c "print(1024 / ${runtime})")
echo "1GB in "$runtime"s - "$matsec"MB/s"
echo ""

echo "Copy Test From Disk 2 to Disk 1"
start=`date +%s`
dd if=/share/HDB_DATA/write_test_file of=/share/HDA_DATA/write_test_file bs=1M count=1024
end=`date +%s`
runtime=$(python -c "print(${end} - ${start})")
matsec=$(python -c "print(1024 / ${runtime})")
echo "1GB in "$runtime"s - "$matsec"MB/s"

rm -f /share/HDA_DATA/write_test_file
rm -f /share/HDB_DATA/write_test_file
rm -f /share/HDC_DATA/write_test_file
rm -f /share/HDD_DATA/write_test_file


Script con report file:

#!/bin/sh
###################################
# speed disk test for QNAP 4 bays #
#         with log file           #
#         by PeppeBytes           #
#        Oct-08-2015 v 1.0        #
###################################
date > test_results.txt
echo "" >> test_results.txt
echo "Write Test on Disk 1" >> test_results.txt
start=`date +%s`
dd if=/dev/zero of=/share/HDA_DATA/write_test_file bs=1M count=1024
end=`date +%s`
runtime=$(python -c "print(${end} - ${start})")
matsec=$(python -c "print(1024 / ${runtime})")
echo "1GB in "$runtime"s - "$matsec"MB/s" >> test_results.txt
echo "" >> test_results.txt

echo "Write Test on Disk 2" >> test_results.txt
start=`date +%s`
dd if=/dev/zero of=/share/HDB_DATA/write_test_file bs=1M count=1024
end=`date +%s`
runtime=$(python -c "print(${end} - ${start})")
matsec=$(python -c "print(1024 / ${runtime})")
echo "1GB in "$runtime"s - "$matsec"MB/s" >> test_results.txt
echo "" >> test_results.txt

echo "Write Test on Disk 3" >> test_results.txt
start=`date +%s`
dd if=/dev/zero of=/share/HDC_DATA/write_test_file bs=1M count=1024
end=`date +%s`
runtime=$(python -c "print(${end} - ${start})")
matsec=$(python -c "print(1024 / ${runtime})")
echo "1GB in "$runtime"s - "$matsec"MB/s" >> test_results.txt
echo "" >> test_results.txt

echo "Write Test on Disk 4" >> test_results.txt
start=`date +%s`
dd if=/dev/zero of=/share/HDD_DATA/write_test_file bs=1M count=1024
end=`date +%s`
runtime=$(python -c "print(${end} - ${start})")
matsec=$(python -c "print(1024 / ${runtime})")
echo "1GB in "$runtime"s - "$matsec"MB/s" >> test_results.txt
echo "" >> test_results.txt

echo "Copy Test From Disk 1 to Disk 2" >> test_results.txt
start=`date +%s`
dd if=/share/HDA_DATA/write_test_file of=/share/HDB_DATA/write_test_file bs=1M count=1024
end=`date +%s`
runtime=$(python -c "print(${end} - ${start})")
matsec=$(python -c "print(1024 / ${runtime})")
echo "1GB in "$runtime"s - "$matsec"MB/s" >> test_results.txt
echo "" >> test_results.txt

echo "Copy Test From Disk 1 to Disk 3" >> test_results.txt
start=`date +%s`
dd if=/share/HDA_DATA/write_test_file of=/share/HDC_DATA/write_test_file bs=1M count=1024
end=`date +%s`
runtime=$(python -c "print(${end} - ${start})")
matsec=$(python -c "print(1024 / ${runtime})")
echo "1GB in "$runtime"s - "$matsec"MB/s" >> test_results.txt
echo "" >> test_results.txt

echo "Copy Test From Disk 1 to Disk 4" >> test_results.txt
start=`date +%s`
dd if=/share/HDA_DATA/write_test_file of=/share/HDD_DATA/write_test_file bs=1M count=1024
end=`date +%s`
runtime=$(python -c "print(${end} - ${start})")
matsec=$(python -c "print(1024 / ${runtime})")
echo "1GB in "$runtime"s - "$matsec"MB/s" >> test_results.txt
echo "" >> test_results.txt

echo "Copy Test From Disk 2 to Disk 1" >> test_results.txt
start=`date +%s`
dd if=/share/HDB_DATA/write_test_file of=/share/HDA_DATA/write_test_file bs=1M count=1024
end=`date +%s`
runtime=$(python -c "print(${end} - ${start})")
matsec=$(python -c "print(1024 / ${runtime})")
echo "1GB in "$runtime"s - "$matsec"MB/s" >> test_results.txt

rm -f /share/HDA_DATA/write_test_file
rm -f /share/HDB_DATA/write_test_file
rm -f /share/HDC_DATA/write_test_file
rm -f /share/HDD_DATA/write_test_file
By |2016-06-01T10:00:42+00:00Maggio 31st, 2016|Categories: Tutorial|0 Comments

About the Author:

Leave A Comment