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:
1 |
#!/bin/sh<br />###################################<br /># speed disk test for QNAP 4 bays #<br /># without log file #<br /># by PeppeBytes #<br /># Oct-08-2015 v 1.0 #<br />###################################<br />date<br />echo ""<br />echo "Write Test on Disk 1"<br />start=`date +%s`<br />dd if=/dev/zero of=/share/HDA_DATA/write_test_file bs=1M count=1024<br />end=`date +%s`<br />runtime=$(python -c "print(${end} - ${start})")<br />matsec=$(python -c "print(1024 / ${runtime})")<br />echo "1GB in "$runtime"s - "$matsec"MB/s"<br />echo ""<br /><br />echo "Write Test on Disk 2"<br />start=`date +%s`<br />dd if=/dev/zero of=/share/HDB_DATA/write_test_file bs=1M count=1024<br />end=`date +%s`<br />runtime=$(python -c "print(${end} - ${start})")<br />matsec=$(python -c "print(1024 / ${runtime})")<br />echo "1GB in "$runtime"s - "$matsec"MB/s"<br />echo ""<br /><br />echo "Write Test on Disk 3"<br />start=`date +%s`<br />dd if=/dev/zero of=/share/HDC_DATA/write_test_file bs=1M count=1024<br />end=`date +%s`<br />runtime=$(python -c "print(${end} - ${start})")<br />matsec=$(python -c "print(1024 / ${runtime})")<br />echo "1GB in "$runtime"s - "$matsec"MB/s"<br />echo ""<br /><br />echo "Write Test on Disk 4"<br />start=`date +%s`<br />dd if=/dev/zero of=/share/HDD_DATA/write_test_file bs=1M count=1024<br />end=`date +%s`<br />runtime=$(python -c "print(${end} - ${start})")<br />matsec=$(python -c "print(1024 / ${runtime})")<br />echo "1GB in "$runtime"s - "$matsec"MB/s"<br />echo ""<br /><br />echo "Copy Test From Disk 1 to Disk 2"<br />start=`date +%s`<br />dd if=/share/HDA_DATA/write_test_file of=/share/HDB_DATA/write_test_file bs=1M count=1024<br />end=`date +%s`<br />runtime=$(python -c "print(${end} - ${start})")<br />matsec=$(python -c "print(1024 / ${runtime})")<br />echo "1GB in "$runtime"s - "$matsec"MB/s"<br />echo ""<br /><br />echo "Copy Test From Disk 1 to Disk 3"<br />start=`date +%s`<br />dd if=/share/HDA_DATA/write_test_file of=/share/HDC_DATA/write_test_file bs=1M count=1024<br />end=`date +%s`<br />runtime=$(python -c "print(${end} - ${start})")<br />matsec=$(python -c "print(1024 / ${runtime})")<br />echo "1GB in "$runtime"s - "$matsec"MB/s"<br />echo ""<br /><br />echo "Copy Test From Disk 1 to Disk 4"<br />start=`date +%s`<br />dd if=/share/HDA_DATA/write_test_file of=/share/HDD_DATA/write_test_file bs=1M count=1024<br />end=`date +%s`<br />runtime=$(python -c "print(${end} - ${start})")<br />matsec=$(python -c "print(1024 / ${runtime})")<br />echo "1GB in "$runtime"s - "$matsec"MB/s"<br />echo ""<br /><br />echo "Copy Test From Disk 2 to Disk 1"<br />start=`date +%s`<br />dd if=/share/HDB_DATA/write_test_file of=/share/HDA_DATA/write_test_file bs=1M count=1024<br />end=`date +%s`<br />runtime=$(python -c "print(${end} - ${start})")<br />matsec=$(python -c "print(1024 / ${runtime})")<br />echo "1GB in "$runtime"s - "$matsec"MB/s"<br /><br />rm -f /share/HDA_DATA/write_test_file<br />rm -f /share/HDB_DATA/write_test_file<br />rm -f /share/HDC_DATA/write_test_file<br />rm -f /share/HDD_DATA/write_test_file<br /><br /><br /> |
Script con report file:
1 |
#!/bin/sh<br />###################################<br /># speed disk test for QNAP 4 bays #<br /># with log file #<br /># by PeppeBytes #<br /># Oct-08-2015 v 1.0 #<br />###################################<br />date > test_results.txt<br />echo "" >> test_results.txt<br />echo "Write Test on Disk 1" >> test_results.txt<br />start=`date +%s`<br />dd if=/dev/zero of=/share/HDA_DATA/write_test_file bs=1M count=1024<br />end=`date +%s`<br />runtime=$(python -c "print(${end} - ${start})")<br />matsec=$(python -c "print(1024 / ${runtime})")<br />echo "1GB in "$runtime"s - "$matsec"MB/s" >> test_results.txt<br />echo "" >> test_results.txt<br /><br />echo "Write Test on Disk 2" >> test_results.txt<br />start=`date +%s`<br />dd if=/dev/zero of=/share/HDB_DATA/write_test_file bs=1M count=1024<br />end=`date +%s`<br />runtime=$(python -c "print(${end} - ${start})")<br />matsec=$(python -c "print(1024 / ${runtime})")<br />echo "1GB in "$runtime"s - "$matsec"MB/s" >> test_results.txt<br />echo "" >> test_results.txt<br /><br />echo "Write Test on Disk 3" >> test_results.txt<br />start=`date +%s`<br />dd if=/dev/zero of=/share/HDC_DATA/write_test_file bs=1M count=1024<br />end=`date +%s`<br />runtime=$(python -c "print(${end} - ${start})")<br />matsec=$(python -c "print(1024 / ${runtime})")<br />echo "1GB in "$runtime"s - "$matsec"MB/s" >> test_results.txt<br />echo "" >> test_results.txt<br /><br />echo "Write Test on Disk 4" >> test_results.txt<br />start=`date +%s`<br />dd if=/dev/zero of=/share/HDD_DATA/write_test_file bs=1M count=1024<br />end=`date +%s`<br />runtime=$(python -c "print(${end} - ${start})")<br />matsec=$(python -c "print(1024 / ${runtime})")<br />echo "1GB in "$runtime"s - "$matsec"MB/s" >> test_results.txt<br />echo "" >> test_results.txt<br /><br />echo "Copy Test From Disk 1 to Disk 2" >> test_results.txt<br />start=`date +%s`<br />dd if=/share/HDA_DATA/write_test_file of=/share/HDB_DATA/write_test_file bs=1M count=1024<br />end=`date +%s`<br />runtime=$(python -c "print(${end} - ${start})")<br />matsec=$(python -c "print(1024 / ${runtime})")<br />echo "1GB in "$runtime"s - "$matsec"MB/s" >> test_results.txt<br />echo "" >> test_results.txt<br /><br />echo "Copy Test From Disk 1 to Disk 3" >> test_results.txt<br />start=`date +%s`<br />dd if=/share/HDA_DATA/write_test_file of=/share/HDC_DATA/write_test_file bs=1M count=1024<br />end=`date +%s`<br />runtime=$(python -c "print(${end} - ${start})")<br />matsec=$(python -c "print(1024 / ${runtime})")<br />echo "1GB in "$runtime"s - "$matsec"MB/s" >> test_results.txt<br />echo "" >> test_results.txt<br /><br />echo "Copy Test From Disk 1 to Disk 4" >> test_results.txt<br />start=`date +%s`<br />dd if=/share/HDA_DATA/write_test_file of=/share/HDD_DATA/write_test_file bs=1M count=1024<br />end=`date +%s`<br />runtime=$(python -c "print(${end} - ${start})")<br />matsec=$(python -c "print(1024 / ${runtime})")<br />echo "1GB in "$runtime"s - "$matsec"MB/s" >> test_results.txt<br />echo "" >> test_results.txt<br /><br />echo "Copy Test From Disk 2 to Disk 1" >> test_results.txt<br />start=`date +%s`<br />dd if=/share/HDB_DATA/write_test_file of=/share/HDA_DATA/write_test_file bs=1M count=1024<br />end=`date +%s`<br />runtime=$(python -c "print(${end} - ${start})")<br />matsec=$(python -c "print(1024 / ${runtime})")<br />echo "1GB in "$runtime"s - "$matsec"MB/s" >> test_results.txt<br /><br />rm -f /share/HDA_DATA/write_test_file<br />rm -f /share/HDB_DATA/write_test_file<br />rm -f /share/HDC_DATA/write_test_file<br />rm -f /share/HDD_DATA/write_test_file |
Scrivi un commento
Devi accedere, per commentare.