Skip to content

Instantly share code, notes, and snippets.

@yyolk
Last active December 26, 2015 17:09
Show Gist options
  • Select an option

  • Save yyolk/7184502 to your computer and use it in GitHub Desktop.

Select an option

Save yyolk/7184502 to your computer and use it in GitHub Desktop.
some commands for watching the progress of a reshape / rebuild / scrub etc through `cat /proc/mdstat`

  • 0: watch -t -n60 -d1 "cat /proc/mdstat | egrep -o '[[][\=\.>]*[]]' | tr '>' '|' |tr '.' '-' | tr '[]' '|' |figlet -ctk"
  • 1: watch -d -n60 -t 'cat /proc/mdstat|egrep -o '[0-9\.]+%' |figlet -ctk'
  • 2: watch -t "cat /proc/mdstat | egrep -o '\<[[:digit:]]+K/sec\>' | figlet -ctk"
  • 3: watch -t -n60 -d1 'cat /proc/mdstat'
  • 4: clockywock
  • 5: (bash|htop) #this is just my work area
#match the progress bar
cat /proc/mdstat | egrep -o '[[][\=\.>]*[]]' | figlet -ctkf mini
watch -t "cat /proc/mdstat | egrep -o '[[][\=\.>]*[]]' | figlet -ctk"
# better looking progress bar '>' doesn't show up well when figlet'd
watch -t "cat /proc/mdstat | egrep -o '[[][\=\.>]*[]]' | tr '>' '|' |figlet -ctk"
#match 'XX.X%'
cat /proc/mdstat | egrep -o '[0-9\.]+%'
watch -d -t 'cat /proc/mdstat|egrep -o '[0-9\.]+%' |figlet -f bubble | figlet -ctk'
#match 'XXXK/sec'
cat /proc/mdstat | egrep -o '\<[[:digit:]]+K/sec\>'
#match only the line with stats and remove preceeding whitespace
cat /proc/mdstat | grep % |sed -r 's/^ +//g'
#use toilet
cat /proc/mdstat | egrep -o '[[][\=\.>]*[]]' | tr '>' '|' | sed 's/\[//g' | sed 's/\]//g' |toilet -f smmono9 -F gay -t -W
#widescreen progress bar of `/proc/mdstat`
watch -t -d1 "cat /proc/mdstat | egrep -o '[[][\=\.>]*[]]' | tr '>' '|' |tr '.' '-' | tr '[]' '|' |figlet -ctk"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment