How to check bad sectors with the badblocks in specific range?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
I have a HDD that has become to RAW and when I checked it with the TestDisk tool
I want to use the "badblocks" tool for scanning the first partition and not the whole disk. Is it possible?
Yes. When you specify the device to badblocks you are actually specifying a partition. Take a look at:
man badblocks
In DESCRIPTION the first line explains that you are specifying something like "/dev/hdc1" which is partition 1 on device hdc.
Hello,
Thank you so much for the reply.
As I said, the disk becomes to RAW and it just showed me one partition and when I used the TestDisk tool, then it showed me the partitions. I want to scan the first partition for the bad sectors and I used the following command:
Code:
$ sudo badblocks -svw -b 4096 /dev/sdc1 5577 1
Is it OK for scanning the first partition for the bad sectors?
Is it OK for scanning the first partition for the bad sectors?
Yes, scan anything you want for bad blocks. Just don't let badblocks try to fix anything until you have a good knowledge of how much is bad and where the bad blocks are located.
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,673
Rep:
@sundialsvcs
Quote:
… and if you should find even one bad block, immediately retire the drive. They’re not expensive anymore. But your data is priceless.
I think I'd have to disagree with you there. Unless hard drive technology has changed dramatically since I gave up swapping dead ones out back in 2015, even a new drive is likely to have bad blocks on it. They're kept in a bad block file on the disk with the block marked as faulty and an alternate vectored address used instead. There used to be a couple of spare cylinders used for the re-vectoring process which, with the increase in size of disks these days, gives quite a large pool of spare blocks. ( I might actually mean spare sectors here, can't remember, getting old! Used to have to change the geometry on Maxstore drives sometimes to make them comply with the one we were replacing otherwise the RAID wouldn't rebuild.) The drive itself sorts out the re-vectoring in most cases without OS intervention.
One bad block does not mean the disk is on the way out... If the number of bad blocks increases over time, a short time that is, THEN it should be backed up and replaced. Keep monitoring if you're worried.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.