Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
12
rated 0 times [  12] [ 0]  / answers: 1 / hits: 9227  / 2 Years ago, wed, may 25, 2022, 7:53:40

I know how to to check / repair my hard drive but I don't know a way how to see the number of bad sectors on my hard drive.



P.S. It looks like my hard drive will die soon :-(


More From » hard-drive

 Answers
2

There are two ways to detect bad sectors in Linux: you can use the disk utility (gui), or you can use the badblocks command to check your hard disk for bad sectors:



sudo badblocks -v /dev/{device}


That should answer the question but for anyone else interested in how to mark them it can be done with 2 simple commands...



You add the bad blocks to a file...



sudo badblocks /dev/sdb > {/dir/to/filename}


and then tell fsck to mark these as unusable with ...



sudo fsck -l {/dir/to/filename} /dev/{device}

[#40391] Thursday, May 26, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ciousuntru

Total Points: 352
Total Questions: 124
Total Answers: 95

Location: Grenada
Member since Tue, Oct 12, 2021
3 Years ago
;