Created
August 3, 2012 22:27
-
-
Save tlipinski/3252144 to your computer and use it in GitHub Desktop.
Simple script that checks if SSD drive has TRIM enabled.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
path=$1 | |
drive=$2 | |
name=/_tempfile_ | |
file=$path$name | |
echo Test file: $file | |
seq 1 1000 > $file | |
sync; sleep 2 | |
address=`hdparm --fibmap $file | tail -n 1 | cut -d' ' -f15-17` | |
hdparm --read-sector $address /dev/$drive | tail -n 1 | |
rm $file | |
sync; sleep 2 | |
hdparm --read-sector $address /dev/$drive | tail -n 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sudo ./trimsupport.sh / sda
Output if enabled:
Output if disabled: