delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/12/01/04:36:59

X-Spam-Check-By: sourceware.org
Date: Fri, 1 Dec 2006 10:36:26 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Accessing ram drive as raw disk volume fails?
Message-ID: <20061201093626.GJ8792@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <Pine DOT GSO DOT 4 DOT 63 DOT 0611301450070 DOT 25485 AT access1 DOT cims DOT nyu DOT edu> <055901c714f0$cd8d13f0$a501a8c0 AT CAM DOT ARTIMI DOT COM>
Mime-Version: 1.0
In-Reply-To: <055901c714f0$cd8d13f0$a501a8c0@CAM.ARTIMI.COM>
User-Agent: Mutt/1.4.2.2i
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019