Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

We could create ISO-9660 DVDs by piping mkisofs into cdrecord.

For UDF, the procedure seems to be convoluted and slow. It creates a temporary blank 4GB file, then writes data into it, and only then burns it.

Is there a fast way to burn data DVD-Rs in the UDF format?

share|improve this question

2 Answers 2

up vote 3 down vote accepted
+25

Yes, there is a faster way to write in UDF filesystem in CD/DVD. It called packet writing, introduced with UDF version 1.50.

In short, packet writing it is a way to write to CD/DVD or other media in a manner similar to reading, writing, deleting from a normal folder. This method supports both CD/DVD write-once media as well as Rewritable media. Obviously, you won't get back the free space if you delete something from write-once media like CD-R, DVD+R, DVD-R etc.

The packet writing with UDF filesystem should be supported in kernel level and the support is default since kernel 2.6.10. For more information about kernel support in debian systems, look at this page.

The detailed procedure was described in this page under the section Formatting and using a UDF DVD-RW or CD-RW for packet writing. Don't be confused with the step 3 (which creates an empty session) with the creation of a large file with UDF filesystem. That process was listed just after this one, which is not packet writing.

Update: For convenience of the viewer, I'm quoting the procedure section here.

Formatting and using a UDF DVD-RW or CD-RW for packet writing
-------------------------------------------------------------

The commands differ depending on whether you are using DVD or CD
media.

1) Edit /etc/default/udftools and add your drive for packet writing.
For example, if your CD/DVD writer is /dev/hdc and you want it
available as the default /dev/pktcdvd/0, then use the setting
"DEVICES=/dev/hdc". Execute "/etc/init.d/udftools start" afterwards to
register the device.

If the device name /dev/hdc differs on your system, adjust the
following commands as appropriate.

2) Prepare the medium in restricted overwrite mode:

DVD-RW: dvd+rw-format -force /dev/hdc
 CD-RW: Do nothing, skip this step!

3) Write an empty session spanning the whole medium. It seems that
without this step, any attempt to create the UDF filesystem will fail.

DVD-RW: growisofs -Z /dev/hdc=/dev/zero
 CD-RW: cdrwtool -d /dev/hdc -q

4) Format the packet device in UDF format.

DVD-RW: mkudffs --udfrev=0x0150 --spartable=2 --media-type=dvdrw /dev/pktcdvd/0
 CD-RW: mkudffs --udfrev=0x0150 --spartable=2 --media-type=cdrw /dev/pktcdvd/0

The parameters require some more explanation: For --udfrev, use either
0x0150 for UDF version 1.50, or 0x0201 for UDF version 2.01. The
version decision has mostly to do with compatibility:
  - Windows 98/ME can read up to v1.02
  - Windows 2000, Mac OS 9, Linux 2.4 can read up to v1.50
  - Windows 2003/XP can read up to v2.01
  - Linux 2.6 can read up to v2.60
For normal data, UDF 1.50 is OK. UDF 2.00 and 2.01 introduce
additional functionality for streaming audio/video.

Possible values for --media-type are: hd dvdram dvdrw worm mo cdrw cdr.
Use the one appropriate for your medium/device.

5) Mount the disc. The "noatime" option is important: It will reduce
the amount of writes to the device and thus increase its lifetime. You
may first have to create the mount directory using "mkdir
/media/dvd0":

  mount -t udf -o rw,noatime /dev/pktcdvd/0 /media/dvd0

The "sync" mount option might also be useful, but will typically cause
an increased number of write accesses to the medium. From now on, the
root user can access the filesystem under /media/dvd0 using read and
write operations.

6) If regular users should also have write access, modify the
permissions as follows _while the filesystem is mounted_:

  chgrp plugdev /media/dvd0       # Set group ownership to "plugdev"
  chmod g+rwx /media/dvd0         # Give full read/write access to group

Now all users who should have access to the disc need to be added to
the "plugdev" group using "adduser <username> plugdev".

To also allow these users to mount and unmount/eject the medium, you
can use either of these two routes:

 - Install the "pmount" package and add the device to the list of
   allowed devices using "echo /dev/pktcdvd/0 >>/etc/pmount.allow".
   All members of the group "plugdev" will then be able to mount the
   disc using "pmount /dev/pktcdvd/0 dvd0" and unmount it using
   "pumount /media/dvd0".

 - Add a line like the following to /etc/fstab:
   /dev/pktcdvd/0 /media/dvd0 udf rw,noatime,users,noauto 0 0
   This will enable _all_ users to mount the disc using
   "mount /media/dvd0" and unmount it with
   "umount /media/dvd0". However, with the permissions from step 5)
   above, only the members of group "plugdev" ought to be able to
   write to it. 
share|improve this answer
    
Sorry, was away from civilization when you answered my question. –  Oleg2718281828 Dec 12 '12 at 3:28

There is no quick and ultra straightforward way on the command line to generate a UDF disk; the commands described in your linked article are the usual methods. You would usually install the udftools package and anything else you need with

sudo apt-get install udftools libudf0 

and then go through the process as noted here. There is no simpler way of doing it at present. (It is important to note that the libudf0 library is also necessary for handling UDF filesystems.)

However, the gui program k3b also has some UDF support (as the screenshot shows), so that is probably the 'easiest' way to go for some of your projects. There is not really a lot of choice where UDF is concerned, but I think k3b will probably be useful, even though it is not a command-line program.

enter image description here

share|improve this answer

Your Answer

 
discard

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.