This is the mail archive of the cygwin 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]
Other format: [Raw text]

Re: impossible to restore MBR using dd


On May  3 18:06, Eric Blake wrote:
> The limitation here is not in dd, but in cygwin-1.5.16's use of the underlying
> Window's features to access raw devices.  Just because Linux has chosen
> to allow a non-block access of a block-special device (implemented as a block
> read, edit, block write sequence), it does not mean that Windows has to do
> likewise.  Perhaps cygwin 1.5.17 can be patched to do a read-write sequence
> on block-special raw devices when write(2) is unaligned or not a full block, at
> which point dd would automatically work in the way you desire.  And if you
> really want that feature, consider patching cygwin yourself.  Also, from your
> original description, it sounds like write(2) was failing with ENOSPC when
> Windows rejected the non-aligned write, although the better error to comply
> with POSIX would have been ENXIO for a request outside of the device's
> capabilities.  I'd have to see an strace output to be sure (but right now I'm
> not brave enough to risk overwriting my own MBR as an experiment to generate
> such an strace output).

I like the read/write idea and I'd be happy to see a patch for this.

If you want to debug this, why not just write to /dev/fd0?  The floppy
isn't handled any different in writing to raw devices.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin@cygwin.com
Red Hat, Inc.

--
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/


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