LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-23-2012, 08:53 PM   #1
rabbit2345
Member
 
Registered: Apr 2007
Location: SC
Distribution: Kubuntu 20.04 LTS
Posts: 378

Rep: Reputation: 41
how to find the sector size of a hard drive?


Hi,

So I want to fill a disk up with files that occupy exactly 1 sector on the physical drive in order to find bad sectors. How would I go about finding the size of a single sector, to the byte?

After dd'ing the whole disk with bs=16M, it reported copying about 250GB of data. But dd also reported the number of bytes copied, which doesn't equal 250GB by any definition (1024 or 1000=1K)

In the end I would like to run an md5sum on all the files to find the corrupt sector. Then leave the files hidden so the OS won't use them again. Is this a possible solution, or am I missing something?

thanks,
rabbit2345
 
Old 01-23-2012, 09:03 PM   #2
eeekster
Member
 
Registered: Sep 2011
Posts: 163

Rep: Reputation: Disabled
blktool /dev/sda sector-sz
 
Old 01-23-2012, 09:08 PM   #3
rabbit2345
Member
 
Registered: Apr 2007
Location: SC
Distribution: Kubuntu 20.04 LTS
Posts: 378

Original Poster
Rep: Reputation: 41
Well I feel pretty dumb...
For anyone wondering this, you can use fdisk and it gives you the sector size. I can also verify that blktool works just as well.

But about my HD patching idea, is it a viable solution or are there problems with it?
 
Old 01-23-2012, 09:19 PM   #4
eeekster
Member
 
Registered: Sep 2011
Posts: 163

Rep: Reputation: Disabled
Quote:
Originally Posted by rabbit2345 View Post
In the end I would like to run an md5sum on all the files to find the corrupt sector. Then leave the files hidden so the OS won't use them again. Is this a possible solution, or am I missing something?
Modern drives do that for you. In fact you can scan the entire drive with something like this:

smartctl -t long /dev/sda

Then write to drive and the bad sectors will be relocated from the spares.
 
  


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
How to change USB flash drive sector size ario Linux - Hardware 3 10-06-2011 05:05 PM
[SOLVED] Know if my hard-drive had bad sector qlands Linux - Newbie 8 10-23-2010 01:25 PM
Hard drive sector errors crathm Linux - Newbie 3 12-09-2008 05:59 AM
Repair Hard drive bad sector jselby Linux - Hardware 4 10-25-2005 06:27 PM
Bad Sector Hard Drive tsigane Linux - Hardware 16 08-15-2004 03:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 11:22 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