Answers
Got a burning question about open source or the kernel? Whatever your level, email it to lxf.answers@futurenet.com
Neil Bothwick
spends most of his time correcting the editor.
Q
Piping DVDs
I would like to do be able to build DVD-R images with
genisoimage
on one computer and burn them with
wodim
on another computer, a “burnerpc”. I build a ~/DATA.iso genisoimage. When I copy it to the burnerpc with
scp
and then go there via ssh then I can burn it with $ wodim -v -eject speed=8 dev=/dev/sr0 / DATA.iso
I would like to do this on the fly. Is there a way (maybe with a pipe) to burn it from my home PC via ssh ?
Ingo Rodowsky
A It’s possible to do what you want, although you have to be sure the bandwidth between the two machines is sufficient to keep up the flow of data required by the burner. Otherwise you risk buffer underruns and coasters. A decent wired network should handle this with no problems, but using a wireless connection is more risky. It’s not just the lower bandwidth of wireless, but that it’s shared and outside of your control. All it takes is for someone else in the household to start streaming video and your data rate will slow. This can even be caused by non-Wi-Fi devices (nearby microwaves) causing interference on the channel. I wouldn’t consider doing this if the two computers are remote from one another, using an internet connection.
The ssh command can accept input from a pipe. It then passes that to whatever program you’re running on the remote computer. As with many commands, if wodim is passed an input file name of -, it will read from standard input, so you could do something as simple as
$ cat DATA.iso | ssh burnerpc wodim --your-options -
This would be a good starting point from which to test, but you may have to add extra options to avoid buffer underruns. Reducing the write speed is one such option, but probably one you would prefer to avoid if possible. You can cope with short-term reductions in the data rate by increasing wodim’s buffer size, the amount of data to hold before starting to write. This is done by adding the fs option to your command, say fs=128m . This is probably the most important setting because a larger buffer enables the burner computer to better cope with transient interruptions to the flow of data.
If one of the computers involved is fairly low powered, it may be worth using a different cipher with SSH. All SSH traffic is encrypted, but if you’re sticking to your local network, you could try a less-secure, but also less processor-intensive, cipher to improve throughput. Check the SSH man page to see which ciphers are available on both systems if this may be an issue.