This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: dd if=/cygdrive/a of=foo.img doesn't work


Bob McGowan wrote:
> First, you need access to the Windows physical device, second it needs
> to be mounted:
> 
>   mount -b //./a: /dev/fd0
> 
> then:
> 
>   dd if=/dev/fd0 of=file
> 
> I'm not sure if the -b option of mount is required, I use it to be
> safe.

It is required. The raw device handler implements only the raw
read/write access which is explicitely binary. The next layer
(read(2)/write(2) calls) uses text and binmode as usual, though.

> I also use -s with mount to make it a system wide mount so other
> users (if any) will see it also.  And I tend to use the dd option bs=18k
> which will do track at a time read/write of a 1.44MB floppy (80
> tracks).  This makes a difference on standard UNIX systems.  I don't
> know if it impacts performance for Cygwin.

It won't noticably. The primary performance factor is the
internally used buffer. Each file descriptor of an raw device has
an internal buffer associated which is by default 60K. I chose
that value to have a large common multiplier for typical cpio and
tar buffering.

To change the performance the application would need to change
that internal buffer after opening the file. There's a ioctl()
call for that. The appropriate header for that ioctl() call is
/usr/include/cygwin/rdevio.h.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                        mailto:cygwin@sources.redhat.com
Red Hat, Inc.
mailto:vinschen@cygnus.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]