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.

Writing CDs with cdrecord and making images with genisoimage is no problem.

I want to write DVDs in a similar manner, first creating an image, then burning it to disk. This is quite beneficial, since I can inspect the image before burning it to disk.

Now, all I've seen, is how to use the growisofs command to burn something to DVD, but all how-to's were using ISO9660 for DVDs. But I want to burn UDF images. Before I can burn them, I need to make them, but how do I create UDF images?

Also, If you could explain, or link on how to burn BluRay, that would be great, too.

All tools must be command line, as I need to work with it, where GUI is no option.

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

For video data

You can use the -dvd-video option to genisoimage/mkisofs to enable the creation of UDF structures required for video playback. Normally this is done in one operation with growisofs (which calls genisoimage itself), e.g.

$ growisofs -dvd-compat -Z /dev/dvd -dvd-video /path/to/dir

however you could use genisoimage by itself to create an image locally, e.g.

$ genisoimage -o test.iso -dvd-video /path/to/dir

Note that in both cases it is up to you to ensure that the directory structure under /path/to/dir is correct for a DVD filesystem, i.e. it includes the VIDEO_TS and AUDIO_TS directories. Using a DVD authoring tool such as dvdauthor will create the required content.

For general data

In the case of writing arbitrary data to a UDF filesystem, the -dvd-video option of genisoimage is not useful. In this case, the mkudffs tool from the udftools package can be used, along with a loopback device to generate a local image.

First, you need to generate a blank file to contain the image. Here the size is given as 650 MB to match a standard CD, this will obviously need to be larger for a DVD/Blu-Ray. See this wikipedia article for the exact sizes of DVD media.

$ truncate -s 650M /tmp/cdimage.udf

Now invoke mkudffs to generate a UDF filesystem in this blank image:

$ mkudffs --media-type=dvd /tmp/cdimage.udf

See mkudffs(1) for other possible media types. Both truncate and mkudffs will create sparse files if your filesystem supports them; so the image won't occupy the full size unless you fill it.

Then you can mount your image locally to copy data to it

$ sudo mkdir /media/udfimage
$ sudo mount -t udf -o loop,rw /tmp/cdimage.udf /media/udfimage

After the data has been copied to the image, the process is followed in reverse to unmount the image and detach the loopback device:

$ sudo umount /dev/loop0
share|improve this answer
OK, but I want to use UDF just for general data, not just for video. Since UDF is a filesystem, it can be used on CDROM as well. –  polemon Jul 29 '11 at 10:48
Nice! And I believe, I burn that image to DVD just as I burn ISO images to CDROM, right? With BluRay this procedure is the same, I'm guessing? –  polemon Jul 29 '11 at 16:26
I just noticed, you can use mkudffs directly on a file: mkudffs --media-type=dvd test.udf –  polemon Jul 30 '11 at 5:07
@polemon - yes, you just burn the image as normal. I haven't tried Blu-ray myself, but I imagine the process is very similar. And good find with mkudffs, I had no idea you could use it directly on the blank file and this makes the process a lot easier. –  OrbWeaver Jul 30 '11 at 8:47
Doesn't work on Ubuntu 11.04! I can follow the "general data" recipe to the point where I can mount the *udf file. However, I can not write in the udfimage directory. The error I get is "Read-only file system" (even though mount lists it as rw) –  Oleg2718281828 Oct 15 '12 at 6:45
show 5 more comments

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.