On Fri, 2 Jul 2010 23:18:54 +0200 Janek Kozicki <janek_listy@xxxxx> wrote: > I need to overwrite the bad sector with zeros. There isn't really a need to overwrite the whole drive for that -- you can either get that block's address from the LBA number in dmesg errors, or by running a read-only badblocks test. Then make sure it is really the sector you want (try reading it with dd -- it will fail with an I/O Error), and overwrite using dd if=/dev/zero of=/dev/hda seek=NNNNNNNNN bs=512 count=1 Several times if needed, checking if the drive has remapped the sector already (instantly, or after some repeats it should become readable). > I have a free hdc3, which I am going to use for that: > > # dd bs=512 if=/dev/hda3 of=/dev/hdc3 conv=noerror,sync > > The noerror tells dd to continue, even if it cannot read, and sync > tells to write zeros on hdc3 in that place (at least I hope that I > got the manpage right). There is the dd_rescue program, made specifically for that purpose: http://www.garloff.de/kurt/linux/ddrescue/ > Then I will have an almost exact copy of bad hda3 on hdc3. > <...> maybe I could just --add hdc3 in place of hda3 ? Yes, you could, and that would be the most logical thing to do (as hda might continue failing and developing more bad sectors). -- With respect, Roman
Attachment:
signature.asc
Description: PGP signature