Created
January 24, 2014 13:16
-
-
Save pmalek/8597009 to your computer and use it in GitHub Desktop.
Show LBAs, MBs and GBs written to disk
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
#!/bin/bash | |
scale=3 | |
lbas=$(sudo smartctl --all /dev/sda | grep Total_LBAs_Written | awk '{print $(NF)}') | |
mbs=$(( $lbas / 2048 )) | |
# gbs=$(( $mbs / 1024.0 )) | |
gbs=$(bc -l <<< "scale=3 ; $mbs / 1024.0") | |
echo "LBAs written: $lbas" | |
echo "MBs written: $mbs" | |
echo "GBs written: $gbs" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment