Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Fixing bad sectors on a Linux drive

Fixing bad sectors on a Linux drive

Fixing bad sectors on a Linux drive

I have a question about a Linux (EXT3) drive that we are using in a 3rd party embedded application, concerning how the 'bad sector' table is stored.

1) I remove the HD from the embedded Linux hardware, remove the Linux partition, run chkdsk and repair bad sectors. I do this because I have no way of checking or repairing bad sectors in the embedded OS.

2) When I reinstall the HDD into the embedded OS hardware and it reformats (quick-type) to ext3, is the bad sector table "lost"? I.e., is that 'bad sector' table somehow preserved even after the HDD format?

I am not familiar with this topic, so apologies for any confusing descriptions.


RE: Fixing bad sectors on a Linux drive

So far as I know, DOS does not use a special table to mark bad sectors.  It uses a special entry in its FAT; for 16 bit FATs, hex FFF7 says the associated cluster contains at least one bad sector.  Erase the FAT, and you don't know where the bad sectors are.

Perhaps you need to implement a slow Linux format, or reformat the drives slowly on a Linux box.

Mike Halloran
Pembroke Pines, FL, USA

RE: Fixing bad sectors on a Linux drive


During the "typical" linux installation you can check for
bad sectors during the format of the drive.  I assume
that if you do the following:

I use Red Hat.  YMMV.  But I *DO* know that you have the
option for checking for bad sectors during the format

1. Try a "fresh" install of the linux with the typical
   partitions.  Doing it this way, you should be able
   to do the bad sector checking by checking the prompting.
   Partition the drive as you wish it to be for the
   target system.

2. Mount the drive as a second drive (i.e. /dev/hdb with
   the appropriate jumpers set for secondary drive, etc.)

3. Erase all of the files on the freshly formatted/
   installed drive.

This should leave you an ext3 filesystem format without
any data on it.  You can then transfer the oem software
to this "empty" drive.  Don't forget to load the boot
image on it!

4. Rejumper the "new" HD and install in the target system.

I'm *SURE* that there is a way to easily format the
HD drive, however, I can't give you a high degree of
certianty on HOW.  I usually find that sparing out the
bad sectors during installation is sufficient for my
needs.  Sorry this is a kludgy way of doing it, but it's
got a high degree of success.

Best of luck!


   Rich S.

RE: Fixing bad sectors on a Linux drive


RE: Fixing bad sectors on a Linux drive

Maybe man badblocks would help.

If not, you might try posting this at www.tek-tips.com in the Linux forum.  

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Design for Additive Manufacturing (DfAM)
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close