LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 12-29-2021, 10:51 AM   #1
n00b_noob
Member
 
Registered: Sep 2020
Posts: 436

Rep: Reputation: Disabled
Post How to check bad sectors with the badblocks in specific range?


Hello,
I have a HDD that has become to RAW and when I checked it with the TestDisk tool, then it showed me following information:
Code:
Disk /dev/sdc1 - 1000 GB / 931 GiB - CHS 15200 255 63
     Partition               Start        End    Size in sectors
>* HPFS - NTFS              1 122 58  5577  58 49   89574400
 P HPFS - NTFS           5577  58 50 10357 206 25   76800000
 P HPFS - NTFS          10357 206 26 15200   2 34   77789952
I want to use the "badblocks" tool for scanning the first partition and not the whole disk. Is it possible?


Thank you.
 
Old 12-29-2021, 11:12 AM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,340

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by n00b_noob View Post
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.
 
Old 12-30-2021, 10:15 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,671
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
… and if you should find even one bad block, immediately retire the drive. They’re not expensive anymore. But your data is priceless.
 
Old 01-01-2022, 01:10 AM   #4
n00b_noob
Member
 
Registered: Sep 2020
Posts: 436

Original Poster
Rep: Reputation: Disabled
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?
 
Old 01-02-2022, 03:22 PM   #5
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,340

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by n00b_noob View Post
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.
 
Old 01-03-2022, 07:54 AM   #6
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,673

Rep: Reputation: 487Reputation: 487Reputation: 487Reputation: 487Reputation: 487
@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.

My

Play Bonny!

 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How can disk reporting badblocks>0 suddenly become badblocks==0? kaza Linux - Hardware 2 04-09-2019 06:45 PM
LXer: Check Hard drive for bad sectors or bad blocks in linux LXer Syndicated Linux News 0 08-11-2014 08:00 AM
LXer: Check Hard drive for bad sectors or bad blocks in linux LXer Syndicated Linux News 0 08-10-2014 12:21 AM
How to check that my script can check if it has a specific range of charcters. shirlcurl20 Linux - Newbie 2 11-16-2010 11:15 PM
re-allocated sectors count shows 2 bad sectors, in Ubuntu 10.04 disk utility james2b Linux - Hardware 4 10-12-2010 11:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration