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: Accessing ram drive as raw disk volume fails?


On Dec  1 02:31, Dave Korn wrote:
> On 30 November 2006 19:56, Igor Peshansky wrote:
> > On Thu, 30 Nov 2006, Dave Korn wrote:
> > 
> >>     Hi all,
> >> 
> >>   I'm trying to use dd to dump stuff to a usb flash drive (i.e. mass
> >> [...]
>   It was.  The strace showed:
> 
>    91   15071 [main] dd 3468 fhandler_base::read: returning 100, binary mode
>    29   15100 [main] dd 3468 readv: 100 = readv (0, 0x22EE30, 1), errno 0
>    31   15131 [main] dd 3468 writev: writev (1, 0x22EE20, 1)
>    29   15160 [main] dd 3468 fhandler_base::write: binary write
>    53   15213 [main] dd 3468 fhandler_dev_raw::write_file: 0 (err 87) =
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
			       Tsk, tsk, tsk.  You're using an old
			       Cygwin version.

> WriteFile (1756, 268607488, write 100, written 0, 0)
>    34   15247 [main] dd 3468 fhandler_dev_floppy::is_eom: end of medium
> 
> which is "ERROR_INVALID_PARAMETER 87 The parameter is incorrect."
> 
>   Looking at a comment in fhandler_dev_floppy::ioctl, it looks to me like the
> issue is that writes to a raw block device have to be integer multiples of the
> blocksize:
> 
>     case RDSETBLK:
>       /* Just check the restriction that blocksize must be a multiple
> 	 of the sector size of the underlying volume sector size,
> 	 then fall through to fhandler_dev_raw::ioctl. */
> 
> which I imagine I'll find documented even in MSDN somewhere if I look hard
> enough.  So, the answers are:
> 
> >> Is this expected behaviour under cygwin?  
> 
>   Yes, as indeed under windows in general.
> 
> >> What does "no space left on
> >> device" even mean for a raw disk volume as opposed to a logical volume /
> >> partition?
> 
>   It means 'invalid parameter' in this particular instance. 

The reason you're seeing this is that ERROR_INVALID_PARAMETER is
explicitely treated as EOM, see fhandler_floppy.cc, right at the start.
There was a time way back when I did that with a purpose.  The problem
is, I don't know what this purpose was.  I *think* it had something
to do with some device drivers (floppy?!?) actually returning
ERROR_INVALID_PARAMETER when hitting EOM on reading or writing but
I'm not sure anymore.

If you have fun and a chance to test on various different raw disk
devices, I'd be glad to see a patch which handles EOM better, maybe
even differently on reading and writing.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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