You can see where badblocks
is currently positioned in the drive by looking at its fdinfo
in proc
, i.e:
root@ubuntu:/home/ubuntu# ps ax | grep badblock
3772 tty1 D+ 12:11 badblocks -v /dev/sdb
5478 tty2 S+ 0:00 grep --color=auto badblock
root@ubuntu:/home/ubuntu# ls -l /proc/3772/fd
total 0
lrwx------ 1 root root 64 Mar 3 00:41 0 -> /dev/tty1
lrwx------ 1 root root 64 Mar 3 00:41 1 -> /dev/tty1
lrwx------ 1 root root 64 Mar 3 00:41 2 -> /dev/tty1
lr-x------ 1 root root 64 Mar 3 00:41 3 -> /dev/sdb
root@ubuntu:/home/ubuntu# cat /proc/3772/fdinfo/3
pos: 1707980816384
flags: 0140000
mnt_id: 24
root@ubuntu:/home/ubuntu# lsblk -bd /dev/sdb
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 0 2000398934016 0 disk
So, this badblocks
run is about 85% done.
@falconer's answer (use iotop
) is a nice way to watch its current rate, but fdinfo
shows you how much progress the program has made.