tytso / e2fsprogs

Ext2/3/4 file system utilities
http://ext4.wiki.kernel.org
373 stars 219 forks source link

badblocks: improved status output when bad block is found #151

Closed LaurentChardon closed 1 year ago

LaurentChardon commented 1 year ago

When badblocks finds a bad block and the -vv option is used, the output is garbled. This fixes it.

The following is the output from a test with bad blocks 1024 and 2048.

Before:

$ sudo misc/badblocks -vv /dev/sda1
Checking blocks 0 to 204799
Checking for bad blocks (read-only test): 102450% done, 0:00 elapsed. (0/0/0 errors)
204800% done, 0:00 elapsed. (1/0/0 errors)
done                                                 
Pass completed, 2 bad blocks found. (2/0/0 errors)

After:

$ sudo misc/badblocks -vv /dev/sda1
Checking blocks 0 to 204799
Checking for bad blocks (read-only test): 1024                                                                                                                           
2048                                                                                                                           
done                                                 
Pass completed, 2 bad blocks found. (2/0/0 errors)

Signed-off-by: Laurent Chardon laurent.chardon@gmail.com

LaurentChardon commented 1 year ago

I'll change a couple of things and make a new PR