You are not logged in.

#1 2011-02-06 15:24:38

chris_debian
Member
From: Wiltshire, UK
Registered: 2009-02-24
Posts: 284

[SOLVED] Completly format a second HDD, and mark bad sectors.

Hi, all!

I couldn't see a more appropriate place to post this, as it didn't seem right to put it in 'Kernel/ Hardware'. My apologies if it is in the wrong place.


I have a second hard disk drive in my PC and when I use it, it occasionally gives 'bad sector' errors. The hard drive is not currently used, but until I buy a replacement, I was wondering whether it is possible to do a 'deep' format of the disk, which would mark bad sectors. These sectors could then be ignored by future installations.

Is this possible?

Would I have to do it as part of normal partitioning, ie, when setting-up ext4 partitions, etc?

I'd prefer to mark the sectors at a deeper evel, so I don't have to think about it when I do future installs on that disk.

Any help/ advice appreciated.

Chris.

Last edited by chris_debian (2011-02-06 16:15:56)


Reasons why you may want to try GNU/Linux:

www.whylinuxisbetter.net/

Offline

#2 2011-02-06 15:29:26

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED] Completly format a second HDD, and mark bad sectors.

The 'badblocks' program can be used in conjunction with mkfs to create a filesystem that ignores unusable portions of the disk.

Offline

#3 2011-02-06 15:30:00

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

Re: [SOLVED] Completly format a second HDD, and mark bad sectors.

I think you can use "hdparm -D" to do that (see man hdparm) but I have never actually tried it to see how it works.


Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#4 2011-02-06 15:47:18

chris_debian
Member
From: Wiltshire, UK
Registered: 2009-02-24
Posts: 284

Re: [SOLVED] Completly format a second HDD, and mark bad sectors.

Thanks,guys; I'lllookinto both. I must admit, I've not heard of the 'badblocks' application.

Cheers,

Chris.


Reasons why you may want to try GNU/Linux:

www.whylinuxisbetter.net/

Offline

#5 2011-02-06 16:05:35

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] Completly format a second HDD, and mark bad sectors.

If the disk you are planning to use already has bad sectors visible to the user then you better get rid of it. Modern hard disks automatically reallocate bad sectors when they are found, if too many bad sectors have been found and there are no more spare sectors to reallocate the bad ones then it's way past time to replace the disk.

That said, you can always tell mkfs.whatever to search for and avoid damaged sectors (mkfs.whatever will call badblocks to search for and report the damaged sectors). You will be gambling with your data though, because it is quite probable that more bad sectors will develop over time.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#6 2011-02-06 16:15:03

chris_debian
Member
From: Wiltshire, UK
Registered: 2009-02-24
Posts: 284

Re: [SOLVED] Completly format a second HDD, and mark bad sectors.

Good point, maybe I should just look to getting a new one.

I'll mark this as solved.

Chris.


Reasons why you may want to try GNU/Linux:

www.whylinuxisbetter.net/

Offline

#7 2011-02-06 16:18:08

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: [SOLVED] Completly format a second HDD, and mark bad sectors.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#8 2011-02-06 16:26:40

chris_debian
Member
From: Wiltshire, UK
Registered: 2009-02-24
Posts: 284

Re: [SOLVED] Completly format a second HDD, and mark bad sectors.


Reasons why you may want to try GNU/Linux:

www.whylinuxisbetter.net/

Offline

Board footer

Powered by FluxBB