I’m running badblocks to check for bad segments on an external drive, and it’s been about an hour and it has not yet finished. Now, I need to go and consider cancelling. Is this somehow risky? Should I avoid this?
Clearly, I will need to start again from scratch; I just want to know if this is somehow risky to abort midway.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
From examining the source code, I find that:
If you didn’t specify -n or -w, badblocks doesn’t write to the disk at all, so you’re safe interrupting it.
If you specified -w, badblocks has already overwritten the filesystem, so it’s much too late to worry about interrupting the process.
If you specified -n, badblocks uses a signal handler to prevent the program from exiting with the disk in an inconsistent state, so it is safe to press ctrl-c.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0