udftools
udftools copied to clipboard
Instructions for write-once media
Howto mentions the possibility of using packet writing on write once media (CD/DVD +R or -R). However, it is unclear how this should be done:
-
is the
dvd+rw-format
command used? How? The--force
option seems incorrect being meant to wipe, which does not seem to make sense on this media. Furthermore, the tool webpage states that only "RW" media needs to be formatted. -
is the
growisofs -Z /dev/hdc=/dev/zero
needed? Seems strange, as pre-writing an image on a write-once media would make it unusable for any further recording.
Without these two commands, mkudffs --media-type dvdr /dev/pktcdvd0
returns mkudffs: Error: Cannot create new image file '/dev/pktcdvd0': block-count was not specified
Without these two commands,
mkudffs --media-type dvdr /dev/pktcdvd0
returnsmkudffs: Error: Cannot create new image file '/dev/pktcdvd0': block-count was not specified
This looks like /dev/pktcdvd0
does not exist...
Also, you cannot write to (or modify) read-only media by their definition.
Also note that CD-R, DVD+R, DVD-R and BD-R are write-once media (R means recordable). CD-ROM, DVD-ROM and BD-ROM are read-only media which are not possible to modify in any way.
Indeed, I was mentioning write-once (DVD+R in my case).
Also, I have just noticed that I had a (probably stale) /dev/pktcdvd0
file, while the real entry is /dev/pktcdvd/pktcdvd0
.
With this, and mkudffs --media-type dvdr /dev/pktcdvd/pktcdvd0
the disk spins but I get mkudffs: Error: Cannot open device '/dev/pktcdvd/pktcdvd0': Input/output error
Looking into pktcdvd.ko source code and it looks like that packet writing it possible only for CD-RW, DVD+RW, DVD-RW and DVD-RAM medias, see: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/block/pktcdvd.c?h=v5.4#n1768
So I think you cannot use standard write() syscall on DVD+R media via pktcdvd.
Last time I tested scenario: created cdr and dvdr images by mkudffs and then burned them to real cdr and dvdr discs via wodim and it worked. Burning process does not use write() syscall but rather ioctl(), so pktcdvd layer does not used.
I guess that this was expected to work at some time (possibly long ago) because the udftools howto explicitly says: Packet writing is possible both with write-once media (CD-R, DVD+R, DVD-R) and rewritable media (CD-RW, DVD+RW, DVD-RW). Obviously, with write-once media the free space on the filesystem will not increase if you delete files.
I looked at code and there was no support for CD-R directly in kernel/VFS. You always had to use some burner/packetwriting SW in userspace to write new data to CD-R disc. udftools has wrudf utility which has some limited support for packet writing also for CD-R (and maybe also for DVD+-R). So that howto probably refers to wrudf, not in-kernel support. Kernel had and has only support for -RW and -RAM media.
Thanks. I had a look at wrudf. My question is how to "prepare" the initial udf filesystem for the medium, since it does not seem to have a command for that.
wrudf is mostly in unmaintained state, so expect problems. You would have to figure out if it works and how. If you need empty CD-R UDF image, you can create it by mkudffs (it has option -m cdr) and then burn via some burning application (use packet writing and do close media).
Another option for preparing initial filesystem is via genisoimage
, but IIRC it supports only UDF 1.02.
what about VAT suport
VAT is what is used for UDF write-once media.
well it is udftools
I do not understand for what you are asking. VAT is used for UDF write-once media. So if you create image for CD-R, DVD-R or BD-R media via mkudffs then mkudffs automatically create VAT in these images.