X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: Date: Wed, 8 Oct 2008 11:36:17 -0400 From: "Andrew Medico" To: cygwin AT cygwin DOT com Subject: dd fails with iflag=direct MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com I'm running into a problem with dd's "iflag=direct" option in Cygwin. When I combine it it with "conv=sync,noerror", dd successfully reads all of the data from the device but once it gets to the end of the device it starts reporting I/O errors and never terminates: $ dd if=/dev/sdd of=/dev/null conv=sync,noerror iflag=direct dd: reading `/dev/sdd': Input/Output error 1952767+0 records in 1952767+0 records out 999816704 bytes (1.0 GB) copied, 1678.11 s, 596 kB/s dd: `/dev/sdd': cannot seek: Invalid argument dd: reading `/dev/sdd': Input/Output error 1952767+1 records in 1952768+0 records out 999817216 bytes (1.0 GB) copied, 1680.11 s, 595 kB/s dd: reading `/dev/sdd': Input/Output error 1952767+2 records in 1952769+0 records out 999817728 bytes (1.0 GB) copied, 1682.11 s, 594 kB/s (etc.) This is with Cygwin 1.5.25 on Windows XP Pro SP2, 32-bit. The devices I've tested against are IDE hard drives and USB flash drives, all with 512-byte sectors. I have tried various block sizes (512, 32768, 65536) and the result is the same. The same dd commands with the same drives on a Linux machine work as expected (no errors, successful termination). One detail I've noticed is that this seems to happen only when reading entire drives. Reading individual partitions on the same drives completes without error. -- Andrew Medico -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/