Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
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

2 Answers 2

up vote 2 down vote accepted

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?

share|improve this answer
Thank you, sshfs worked so I'll just run with that. –  Stefan Midjich Oct 28 '11 at 11:15
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

share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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