9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] sd(3) and concurrent readers/writers?
@ 2009-09-12 18:08 sqweek
  2009-09-12 18:23 ` erik quanstrom
  2009-09-13 14:44 ` erik quanstrom
  0 siblings, 2 replies; 4+ messages in thread
From: sqweek @ 2009-09-12 18:08 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

 I have a fairly simple task - I'm trying to mirror a disk. So I run
the obvious:

dd -if /dev/sdE0/data -of /dev/sdF0/data -bs 1048576

 That's sitting there on it's merry way, and I get curious as to how
much progress it has made. I think about acid briefly but I don't have
much experience with it, and figure I can get the answer without
touching the procs:

fn chk {
    for(i in sdE0 sdF0) dd -if /dev/$i/data -bs 1048576 -iseek $1
-count 1 |md5sum
}

 With this crude tool I can easily find a block that differs between
the disks and binary search to gauge how far through the process is.
 However, something seems a little fragile. If I keep running chk
eventually the dd falls over with an error of some sort. It just gave
me "write: " (that's an empty error string by the looks of it) 3 times
in a row, and the fourth time around dd didn't report an error itself
but I get this in kmesg:

atagenioretry: disabling dma
sdE0: retry: dma 00000000 rwm 0000

 Now it's got itself into a state where even without the dd going, if
I turn dma on for sdE0 and run chk it disables dma again. Hm, in fact
some time before getting the kmesg, reads to sdE0/data started
returning 0 bytes regardless of offset.

 System details: SIL3112 sata controller... is there an easy way to
tell if I'm in AHCI mode or not? can't see anything obvious in the
bios. During boot I get these relevant looking lines:

dev A0 port 170 config 85C0 capabilities 0F00 mwdma 0007 udma 0407
dev A0 port 9400 config 0C5A capabilities 2F00 mwdma 0007 udma 207F
  LLBA sectors 586072368
dev A0 port 9C00 config 0C5A capabilities 2F00 mwdma 0007 udma 207F
  LLBA sectors 586072368

-sqweek



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

end of thread, other threads:[~2009-09-14 18:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-12 18:08 [9fans] sd(3) and concurrent readers/writers? sqweek
2009-09-12 18:23 ` erik quanstrom
2009-09-13 14:44 ` erik quanstrom
2009-09-14 18:43   ` sqweek

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).