Mail Archives: cygwin/2006/11/30/21:31:45
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 -