delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/11/30/21:31:45

X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: Accessing ram drive as raw disk volume fails?
Date: Fri, 1 Dec 2006 02:31:27 -0000
Message-ID: <055901c714f0$cd8d13f0$a501a8c0@CAM.ARTIMI.COM>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <Pine.GSO.4.63.0611301450070.25485@access1.cims.nyu.edu>
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 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
>> storage device).  However something tricks it into thinking the device
>> is full (/dev/sdb is the pendrive):
>> 
>> dk AT CHILLI ~
>> $ dd if=/tmp/msd-test-data.cXoEqa2332 of=/dev/sdb bs=100 count=1
>> dd: writing `/dev/sdb': No space left on device
>> 1+0 records in
>> 0+0 records out
>> 
>> dk AT CHILLI ~
>> $

> strace or gdb should be helpful in identifying the Windows error code that
> is mapped by Cygwin to ENOSPC.  From a quick look at the code, this could
> be a general write error, but I haven't spent all that much time looking
> at it.

  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) =
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. 


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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