# Harddrive's commandline tests

### Test Write Speed

```
sync; dd if=/dev/zero of=tempfile bs=1M count=1024; sync
```

### Test Read Speed

```
dd if=tempfile of=/dev/null bs=1M count=1024
```

Clear Cache and read speed from hdd:

```
sudo /sbin/sysctl -w vm.drop_caches=3;dd if=tempfile of=/dev/null bs=1M count=1024
```

### Using hdparm

Install:
```
sudo apt-get update; \
sudo apt-get upgrade -y; \
sudo apt-get install -y hdparm
```

Run (replace PWD with sudo password):
```
echo PWD | sudo -S hdparm -Tt /dev/sda
```