Skip to content

Instantly share code, notes, and snippets.

View roarc0's full-sized avatar
🐧

Alessandro Rosetti roarc0

🐧
  • CWire
  • Italy
  • 10:52 (UTC +02:00)
View GitHub Profile
@roarc0
roarc0 / badb.sh
Last active December 8, 2017 10:52
badblocks helper script
#!/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 ))