Burning BDs on GNU/Linux
We’ll need a few things:
- udftools (for mkudffs)
- dvd+rw-tools
Consult your system’s package manager.
First, make sure your BD drive is detected by your system. Mine happens to live at
orc@fuyuki ~ $ ls -lah /dev/dvd*
lrwxrwxrwx 1 root root 3 Dec 29 17:51 /dev/dvd -> sr0
lrwxrwxrwx 1 root root 3 Dec 29 17:51 /dev/dvdrw -> sr0If there’s a problem, tailing dmesg is your best bet for getting pointed in the right direction.
We need to allocate the space we’re going to use for our image. First, check the size of the media:
orc@fuyuki ~ $ dvd+rw-mediainfo /dev/sr0
...
Track Size: 12219392*2KBSome quick math gives us a capacity of 24438784KB.
The quick and dirty way is with truncate:
truncate --size=24438784KB ./image.udfdd also works, if you want to specifically get random data rather than whatever was on disk:
dd if=/dev/urandom of=./image.udf bs=1M count=23866Once the space is allocated, we can create our UDF filesystem:
mkudffs --lvid="VOLUME_NAME" --utf8 ./image.udfIn my case, I wanted UDF because ISO9660 has a ~4.2GB filesize limit and I didn’t want to bother splitting the big encrypted disk image that was to be the main contents of the BD. ISO has better compatability with older devices.
Mount it, add data, unmount. Make sure the permissions look good.
sudo mount -o loop,rw ./image.udf /mnt
cp -a /some/files /mnt
umount /mntNow, we can write our image to the BD. This will take a while (my 25GB burns each took about an hour and a half at 2x).
growisofs -dvd-compat -Z /dev/sr0=archive.udfIt’s worth noting that growisofs doesn’t like being run by sudo, so drop down to a root shell or take advantage of -c.
That’s it! Obviously, make sure your disk is readable once the write finishes.