I'm trying to do something tricky, I want to burn a directory structure onto a CD from a pipe stream. The reason is that it is coming from the network and I don't want it written on the hard drive of the cd-burning machine.

I am unsure of how (or if possible) to pipe the output of tar (for example) into genisoimage or mkisofs. I noticed a stream option in genisoimage, but when I tried doing

tar -cvf - /home/myuser | genisoimage --stream-media-size 200 -o test.iso

I only got a test.iso which contained a stream.img (as specified in genisoimage(1)) which itself was the original tar-archive. This will not do, it needs to be a directory structure on the CD.

I know that cdrskin (cli tool for burning) can take data from stdin and burn it.

So how can I pipe data into genisoimage, have it create a directory structure of that data for the ISO and then have it pipe that data back out to cdrskin to burn? I know also that genisoimage pipes the iso data to stdout by default so my only issue appears to be getting a stream of a directory structure piped into genisoimage and having that directory structure maintained in the ISO data.

The tags on this post are terrible because I couldn't find genisoimage, cdrskin, not even stdin.

Edit: This is not about data security, it's about lack of disk space. I don't care if the data is buffered on the HDD but I can't write the full ISO. And of course genisoimage is just a suggestion, I'm open to any other method of creating the ISO data. For your information it's intended for blu ray discs.

  • blast_hardcheese in ##linux on freenode suggested sshfs, this was a brilliant idea! Since I don't really care about performance, only that it gets done right. I'm still welcome to other suggestions though. – Stefan Midjich Oct 28 '11 at 9:12

I'm guessing the reason you're not just specifying the directory on the disk is because you're piping this over the network. I'm also assuming you're using ssh for this, so my question is: Why not sshfs?

  • Oh and I went with growisofs instead, it does everything for me and does not write the iso on the HDD but sends it straight to the DVD burner. Just FYI for anyone else reading this thread after. – Stefan Midjich Oct 28 '11 at 11:39

and I don't want it written on the hard drive of the cd-burning machine.

It's pretty much impossible to prevent this. Even stdio piping may write to the disk. And even if you avoided using pipes altogether (e.g. by writing a shared memory segment) it may still get paged.

In the absence of any buffering you're likely to run into problems with over/underruns even with a fast network and a slow write speed.

Just copy the file then shred it - or use encryption at source/on the buffer filesystem

  • This is not about security, it's about lack of disk space. I understand it will be buffered, that's not the issue, it can buffer away, but I don't have the space to write the full ISO on the HDDs. I should have added this in the initial question. – Stefan Midjich Oct 28 '11 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.