Skip to content

Instantly share code, notes, and snippets.

Avatar
🐧

Alessandro Rosetti arosetti

🐧
  • SecurityForge
  • Italy, Viareggio
View GitHub Profile
@arosetti
arosetti / badb.sh
Last active Dec 8, 2017
badblocks helper script
View badb.sh
#!/bin/sh
# ./badb.sh /dev/sdd 0.9
# starts from 90th% block of the device using 4k blocks.
DEV=$(basename $1)
BLOCKS=$(cat /proc/partitions| grep $DEV| awk 'NR==1{ print $3 } ')
SIZE=1024
NB=4
BSIZE=$(( SIZE * NB ))