linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: Mapping physical disk block to logical block to selectively repair w/o forcing rescan
@ 2008-04-15 20:47 David Lethe
  2008-04-15 22:14 ` Janek Kozicki
  2008-04-16  0:35 ` Dan Williams
  0 siblings, 2 replies; 8+ messages in thread
From: David Lethe @ 2008-04-15 20:47 UTC (permalink / raw)
  To: linux-raid

I have some code that does some background media scanning that results in a list of physical disks and block numbers that are known bad. I want to repair the logical (md) block(s) that they correspond to (assuming not RAID0, of course) without a draconian full repair/rescan.  As such, I need a physical to logical mapping technique.  It doesn't appear that there is a built-in mechanism in mdadm or by echoing a command to the /proc/mdstat, or anything else to force the md subsystem to repair the (parity protected) logical block associated with the physical disk and block that is known bad.  

(raid5extend.c has a phys2log function that seems to take everything into consideration, and RAID1 is a non-issue,  but as long as I am going to do this, then might as well cover all the bases and make sure it is done right) 

Has anybody written a script or something, or is there a technique I have missed that will provide block-level mapping?  I don't want to muck with modifying the md driver ... a shell script would be fine as this would be a rare occurrence, and since the disk will take billions of clock cycles to remap a bad sector, then an inefficient mapping script will hardly be noticeable.   

Also, assuming I have to write such a script and now know that block X on /dev/mdY needs to be repaired, then is there any risk of data corruption if I simply issue a read  dd if=/dev/md$Y of=/dev/null count=1 skip=$X to force the md driver to repair the stripe? 
(Actually, count should be increased large enough to force a non-cached read, and I think block number might need to be examined to make sure that it is not associated with a block that contains parity information, otherwise, the md engine might not detect the problem and force parity rebuild).

Any advice, comments, code will be appreciated.  

David @ santools ^ com
  

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-04-16 14:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-15 20:47 Mapping physical disk block to logical block to selectively repair w/o forcing rescan David Lethe
2008-04-15 22:14 ` Janek Kozicki
2008-04-16  0:35 ` Dan Williams
2008-04-16  0:37   ` Dan Williams
2008-04-16  2:47     ` David Lethe
2008-04-16  6:04       ` Dan Williams
2008-04-16 13:58       ` Bill Davidsen
2008-04-16 14:32         ` David Lethe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).