How to use DVD+RW (UDF) both in windows and linux?

I have dvd+rw disk. I would like to create UDF file system on it to use with windows 7 (and newer) and gentoo both. How must I prepare media and what commands should use to mount it in linux?

What I tried:

  1. In Windows:

    format /fs:UDF D:
    

    now windows is able to work with the media. Gentoo can safely read it in ro mode.

    On gentoo (as described in linux Documentation):

    pktsetup 0 /dev/sr0
    mount -t udf -o rw,noatime /dev/pktcdvd/pkcdvd0 /mnt
    cp <some> /mnt
    umount /mnt
    pktsetup -d 0
    

    after that media is broken - windows suggest to format it, gentoo can't locate superblock to mount.

  2. In Windows:

    format /fs:UDF D:
    

    now windows is able to work with the media Gentoo can safely read it in ro mode.

    On gentoo:

    mount -t udf -o rw,noatime /dev/sr0 /mnt
    cp <some> /mnt
    umount /mnt 
    

    after that windows can't read the media, but gentoo is ok.

  3. In gentoo:

    mkudffs /dev/sr0
    mount -t udf -o rw,noatime /dev/sr0 /mnt
    cp <some> /mnt
    umount /mnt
    

    gentoo works fine with media, Windows can read the media, but it can't write or delete files on it.

  4. In gentoo:

    mkudffs -r 0150 --media-type=dvd /dev/sr0
    mount -t udf -o rw,noatime /dev/sr0 /mnt
    

    mounts as readonly

    mount -t udf -o remount,rw /dev/sr0 /mnt
    cp <some> /mnt
    umount /mnt
    

    gentoo works fine with media, Windows can read the media, but it can't write or delete files on it.

  5. In gentoo:

    pktsetup 0 /dev/sr0
    mkudffs /dev/pktcdvd/pktcdvd0
    mount -t udf -o rw,noatime /dev/pktcdvd/pkcdvd0 /mnt
    

    missing partition (can't read superblock) and windows can do nothing with the media.

  6. Also, I tried to use "forget" and "ignore" in uid and gid options of mount, but gentoo's mount had problems with it:

    sudo mount -t udf -o rw,uid=frget,uid=ignore,gid=ignore,gid=forget /dev/sr0 /media/default
    mount: failed to parse mount options
    

As of 2016.11.21, the drivers/block/pktcd driver was marked as deprecated and suggested for removal "after a version or two" Linux kernel version releases. It is 2020.02.02 as of this writing.

Recompile the Linux kernel without "drivers/block/pktcdvd", format/mount the UDF formated DVD+RW disc/media, and you should be able directly write to the UDF mounted disc filesystem using simple cp/mv/rm filesystem commands. Mount with fstab auto noatime,rw or autofs"-fstype=auto,noatime,rw", in the event you have a mix of iso9660 or UDF formatted discs.

This works with my LG WH16NS60 bluray drive.

It maybe easier for you to format the disc with UDF filesystem using MS Windows (tested here using Windows 10), otherwise use udftools mkudffs -l TITLE /dev/sr0 and if necessary, mkudffs -l TITLE --media-type=dvd /YOUR/DEVICE/FILE.

Remember, do not re-format DVD+RW media! Also, using "dvd+rw-format -lead-out" may increase compatibility or slow operations.

Can monitor /var/log/messages for writing/finalizing after each file operation or umount.