Skip to content

Instantly share code, notes, and snippets.

@wildragonx
Forked from ChristianWilkie/speed.sh
Created November 24, 2022 18:39
Show Gist options
  • Save wildragonx/6b19a84d03db500c8809bc550c3ff96c to your computer and use it in GitHub Desktop.
Save wildragonx/6b19a84d03db500c8809bc550c3ff96c to your computer and use it in GitHub Desktop.

Revisions

  1. @ChristianWilkie ChristianWilkie revised this gist Jan 23, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion speed.sh
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ if [ "$EUID" -ne 0 ]
    fi
    echo "=== Performing Write Speed Test ==="
    dd if=/dev/zero of=/tmp/test.tmp bs=500K count=1024 oflag=dsync
    sync; /proc/sys/vm/drop_caches
    sync; echo 3 | tee /proc/sys/vm/drop_caches
    echo "=== Performing Read Speed Test ==="
    dd if=/tmp/test.tmp of=/dev/null bs=500K count=1024
    rm -rf /tmp/test.tmp
  2. @ChristianWilkie ChristianWilkie revised this gist Jan 23, 2021. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions speed.sh
    Original file line number Diff line number Diff line change
    @@ -5,8 +5,10 @@ if [ "$EUID" -ne 0 ]
    then echo "Please run as root"
    exit
    fi

    echo "=== Performing Write Speed Test ==="
    dd if=/dev/zero of=/tmp/test.tmp bs=500K count=1024 oflag=dsync
    sync; echo 3 | tee /proc/sys/vm/drop_caches
    sync; /proc/sys/vm/drop_caches
    echo "=== Performing Read Speed Test ==="
    dd if=/tmp/test.tmp of=/dev/null bs=500K count=1024
    rm -rf /tmp/test.tmp
    echo "=== Speed Test Complete ==="
  3. @ChristianWilkie ChristianWilkie renamed this gist Jan 23, 2021. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. @ChristianWilkie ChristianWilkie created this gist Jan 23, 2021.
    12 changes: 12 additions & 0 deletions raspberry-pi-disk-speed.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    #!/bin/bash
    # Tests Raspberry Pi disk read/write speed

    if [ "$EUID" -ne 0 ]
    then echo "Please run as root"
    exit
    fi

    dd if=/dev/zero of=/tmp/test.tmp bs=500K count=1024 oflag=dsync
    sync; echo 3 | tee /proc/sys/vm/drop_caches
    dd if=/tmp/test.tmp of=/dev/null bs=500K count=1024
    rm -rf /tmp/test.tmp