[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: COMMAND SEQUENCE ERROR when reading from pipe or stdin



On Wed, 23 Feb 2005 16:16:48 +1100, Mitch Davis wrote
>
> James Finnall <james@finnall.net> wrote:
> >
> > I use the program sdd to write directly to the drive.  I have used this 
> > method a great deal under kernel 2.4 with a kernel patch.  But I have only 
> > tested my own system at this point on 2.6.10 and no kernel patch.
> >
> > /bin/tar -cz some_files  | /usr/local/bin/sdd of=/dev/raw/raw1 obs=32k
> >
> > Please note that it uses the raw device and sets the output buffer size to 
> > 32k.  The raw device needs to bound the drive to be used like this:
> >
> > raw /dev/raw/raw1 /dev/dvd_drive_to_use
> 
> That's a sweet idea, I'd like to try it.  I got sdd 1.52 and compiled
> it.  The problem is, FC3 no longer has (or needs) the "raw" command:
> 
>   http://www.edhanced.com/ask-mred/?q=node/view/82
> 
> Instead, apps should call open() with the O_DIRECT flag, which
> sdd doesn't use.  I had a look at the sdd source with a view to
> adding a flag to use O_DIRECT, but the prototype for the
> getallargs() fn has (literally) 57 arguments.  I'm not sure I
> want to mess with it.  
> 
> Jörg, if you're reading this, would you consider a version of
> sdd which has an option to cause open() to use the O_DIRECT flag?
> 
> An alternative might be for me to apply the following patch to
> dd, which adds support for open() with O_DIRECT:
> 
>   http://marc.theaimsgroup.com/?l=linux-kernel&m=108135935629589
> 
> Has anyone tried this?
> 
> Things are certainly not going to work with dd as things stand:
> 
> [root@homer /]# dd if=/home/050221-sys.tar.gz of=/dev/hdc obs=32k
> dd: opening `/dev/hdc': Read-only file system

I just followed my advice and tried applying that patch to
GNU dd.  It works no better:

[root@homer /home/mjd/rpms]# dvd+rw-format -blank /dev/hdc
* DVD±RW/-RAM format utility by <appro@fy.chalmers.se>, version 4.10.
* 4.7GB DVD-RW media in Sequential mode detected.
* blanking -

[root@homer /home/mjd/rpms]# dd if=/home/050221-sys.tar.gz of=/dev/hdc obs=32k 
conv=direct
dd: opening `/dev/hdc': Read-only file system

[root@homer /home/mjd/rpms]# strace dd if=/home/050221-sys.tar.gz of=/dev/hdc 
obs=32k conv=direct

<blah blah>

open("/home/050221-sys.tar.gz", O_RDONLY|O_LARGEFILE) = 0
close(1)                                = 0
open("/dev/hdc", O_WRONLY|O_CREAT|O_TRUNC|O_DIRECT|O_LARGEFILE, 0666) = -1 
EROFS (Read-only file system)

So I'm fresh out of ideas: FC3 no longer supports the raw command,
sdd doesn't support O_DIRECT (and by the looks of this it wouldn't
help) and I still can't stream to a DVD-R by any means.

In a discussion with Andy Polyakov, Rich Turner said:

> my first command:
> # tar cvf - /tmp | growisofs -Z /dev/scd0=/dev/fd/0
> works great, exactly what i hoped for.

That's what I wish I could do.  What causes the growisofs
COMMAND SEQUENCE ERROR when reading from a pipe or stdin?

Many thanks,

Mitch.



Reply to: