Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instructions for write-once media #37

Open
callegar opened this issue Dec 13, 2019 · 14 comments
Open

Instructions for write-once media #37

callegar opened this issue Dec 13, 2019 · 14 comments

Comments

@callegar
Copy link

callegar commented Dec 13, 2019

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

@pali
Copy link
Owner

pali commented Dec 13, 2019

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

This looks like /dev/pktcdvd0 does not exist...

@pali
Copy link
Owner

pali commented Dec 13, 2019

Also, you cannot write to (or modify) read-only media by their definition.

@pali
Copy link
Owner

pali commented Dec 13, 2019

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.

@callegar
Copy link
Author

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

@callegar callegar changed the title Instructions for read only media Instructions for write-once media Dec 13, 2019
@pali
Copy link
Owner

pali commented Dec 13, 2019

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.

@callegar
Copy link
Author

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.

@pali
Copy link
Owner

pali commented Jan 20, 2020

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.

@callegar
Copy link
Author

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.

@pali
Copy link
Owner

pali commented Jan 21, 2020

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).

@pali
Copy link
Owner

pali commented Oct 22, 2020

Another option for preparing initial filesystem is via genisoimage, but IIRC it supports only UDF 1.02.

@Cuteistfox
Copy link

what about VAT suport

@pali
Copy link
Owner

pali commented Jun 17, 2023

VAT is what is used for UDF write-once media.

@Cuteistfox
Copy link

well it is udftools

@pali
Copy link
Owner

pali commented Jun 17, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants