Difference between revisions of "Optical disc drive"

From ArchWiki
Jump to: navigation, search
(Added a note about a growisofs bug, which is now mentioned in " Install burning utilities". One should know about it before trouble arises.)
m (Creating an ISO image from a CD, DVD, or BD: style)
 
(208 intermediate revisions by 55 users not shown)
Line 1: Line 1:
 +
[[Category:Multimedia]]
 
[[Category:Optical]]
 
[[Category:Optical]]
[[Category:Audio/Video]]
+
[[es:Optical disc drive]]
[[it:Optical Disc Drive]]
+
[[it:Optical disc drive]]
[[zh-CN:Optical Disc Drive]]
+
[[ja:光学ディスクドライブ]]
{{Article summary start}}
+
[[ru:Optical disc drive]]
{{Article summary text|This document outlines various methods of burning, playing and ripping CD/DVDs.}}
+
[[zh-hans:Optical disc drive]]
{{Article summary heading|Related Playing}}
+
{{Related articles start}}
{{Article summary wiki|Codecs}}
+
{{Related|Codecs}}
{{Article summary wiki|MPlayer}}
+
{{Related|MPlayer}}
{{Article summary heading|Related Ripping}}
+
{{Related|dvdbackup}}
{{Article summary wiki|dvdbackup}}
+
{{Related|MEncoder}}
{{Article summary wiki|MEncoder}}
+
{{Related|Blu-ray}}
{{Article summary wiki|ScriptForDvdBackup}}
+
{{Related articles end}}
{{Article summary end}}
 
{{Accuracy|This page is marked for possible improvement of content|Talk:Optical_Disc_Drive#How_to_contribute_as_upstream_developer_.3F}}
 
From [[wikipedia:Optical disc drive|wikipedia]]
 
  
:''In computing, an optical disc drive (ODD) is a disk drive that uses laser light or electromagnetic waves within or near the visible light spectrum as part of the process of reading or writing data to or from optical discs. Some drives can only read from discs, but recent drives are commonly both readers and recorders, also called burners or writers. Compact discs, DVDs, and Blu-ray discs are common types of optical media which can be read and recorded by such drives. Optical drive is the generic name; drives are usually described as "CD" "DVD", or "Blu-ray", followed by "drive", "writer", etc.''
+
From [[Wikipedia:Optical disc drive|Wikipedia]]:
 +
 
 +
:In computing, an optical disc drive (ODD) is a disk drive that uses laser light or electromagnetic waves within or near the visible light spectrum as part of the process of reading or writing data to or from optical discs. Some drives can only read from discs, but recent drives are commonly both readers and recorders, also called burners or writers. Compact discs, DVDs, and Blu-ray discs are common types of optical media which can be read and recorded by such drives. Optical drive is the generic name; drives are usually described as "CD" "DVD", or "Blu-ray", followed by "drive", "writer", etc.
  
 
== Burning ==
 
== Burning ==
  
The burning process of optical disc drives consists of creating or obtaining an image and writing it to an optical medium. The image may in principle be any data file. If you want to mount the resulting medium, then it is usually an ISO 9660 filesystem image file. Audio and multi-media CDs are often burned from a BIN file, under control of a TOC file or a CUE file which tell the desired track layout.
+
{{Warning|The quality of optical drives and the discs themselves varies greatly. Generally, using a slow burn speed is recommended for reliable burns. If you are experiencing unexpected behaviour from the disc, try burning at the lowest speed supported by your burner.}}
  
=== Install burning utilities ===
+
The burning process of optical disc drives consists of creating or obtaining an image and writing it to an optical medium. The image may in principle be any data file. If you want to mount the resulting medium, then it is usually an ISO 9660 file system image file. Audio and multi-media CDs are often burned from a ''.bin'' file, under control of a ''.toc'' file or a ''.cue'' file which tell the desired track layout.
  
If you want to use programs with graphical user interface, then follow
+
=== Install burning utilities ===
[https://wiki.archlinux.org/index.php/Optical_Disc_Drive#Burning_CD.2FDVD_with_a_GUI this link to the list of GUI programs].
 
  
The programs listed here are the back ends which are used by most free GUI programs for CD, DVD, and BD. They are command line oriented. GUI users might get to them when it comes to troubleshooting or to scripting of burn activities.
+
If you want to use programs with graphical user interface, then follow [[#Burning CD/DVD/BD with a GUI]].
  
You need at least one program for creation of filesystem images and one program that is able to burn data onto your desired media type.
+
The programs listed here are command line oriented. They are the back ends which are used by most free GUI programs for CD, DVD, and BD. GUI users might get to them when it comes to troubleshooting or to scripting of burn activities.
 +
 
 +
You need at least one program for creation of file system images and one program that is able to burn data onto your desired media type.
  
 
Available programs for ISO 9660 image creation are:
 
Available programs for ISO 9660 image creation are:
  
* {{ic|genisoimage}} from package {{Pkg|cdrkit}}
+
* ''mkisofs'' from {{Pkg|cdrtools}}
* {{ic|mkisofs}} from package {{Pkg|cdrtools}}
+
* ''xorriso'' and ''xorrisofs'' from {{Pkg|libisoburn}}
* {{ic|xorriso}} and {{ic|xorrisofs}} from package {{Pkg|libisoburn}}
 
  
The traditional choice is {{ic|genisoimage}}.
+
The traditional choice is ''mkisofs''.
  
 
Available programs for burning to media are:
 
Available programs for burning to media are:
  
* {{ic|cdrdao}} from package {{Pkg|cdrdao}} (CD only, TOC/CUE/BIN only)
+
* ''cdrdao'' from {{Pkg|cdrdao}} (CD only, TOC/CUE/BIN only)
* {{ic|cdrecord}} from package {{Pkg|cdrtools}}
+
* ''cdrecord'' from {{Pkg|cdrtools}}
* {{ic|cdrskin}} from package {{Pkg|libburn}}
+
* ''cdrskin'' from {{Pkg|libburn}}
* {{ic|growisofs}} from package {{Pkg|dvd+rw-tools}} (DVD and BD only)
+
* ''growisofs'' from {{Pkg|dvd+rw-tools}} (DVD and BD only)
* {{ic|wodim}} from package {{Pkg|cdrkit}} (CD only, DVD deprecated)
+
* ''xorriso'' and ''xorrecord'' from {{Pkg|libisoburn}}
* {{ic|xorriso}} and {{ic|xorrecord}} from package {{Pkg|libisoburn}}
 
  
The traditional choices are {{ic|wodim}} for CD and {{ic|growisofs}} for DVD and Blu-ray Disk. For growisofs and BD-R see the bug workaround below.
+
The traditional choices are ''cdrecord'' for CD and ''growisofs'' for DVD and Blu-ray Disk. For writing TOC/CUE/BIN files to CD, install {{Pkg|cdrdao}}.
For writing TOC/CUE/BIN files to CD, install {{ic|cdrdao}}.
 
  
 
The free GUI programs for CD, DVD, and BD burning depend on at least one of the above packages.
 
The free GUI programs for CD, DVD, and BD burning depend on at least one of the above packages.
  
The programs {{ic|genisoimage}}, {{ic|mkisofs}}, and {{ic|xorrisofs}} all three support the genisoimage options which are shown in this document.
+
''xorrisofs'' supports the ''mkisofs'' options which are shown in this document.
  
The programs {{ic|cdrecord}}, {{ic|cdrskin}}, and {{ic|wodim}} all three support the shown wodim options. Program {{ic|xorrecord}} supports those which do not deal with audio CD.
+
''cdrskin'' supports the shown ''cdrecord'' options; ''xorrecord'' also supports those which do not deal with audio CD.
  
{{Note|
+
=== Making an ISO image from existing files on hard disk ===
The installed files of packages {{Pkg|cdrkit}} and {{Pkg|cdrtools}} are in conflict.
 
If you want to install cdrtools, make sure that you build a package using [[makepkg]] and install with pacman. Pacman wrappers may resolve to cdrkit instead.
 
}}
 
  
=== Learning the name of your optical drive ===
+
The simplest way to create an ISO image is to first copy the needed files to one directory, for example: {{ic|./for_iso}}.
  
For the remainder of this section the name of your recording device is assumed to be {{ic|/dev/cdrw}}.
+
Then generate the image file with ''mkisofs'':
  
Check this by
+
$ mkisofs -V "''ARCHIVE_2013_07_27''" -J -r -o ''isoimage.iso'' ''./for_iso''
  
$ wodim dev=/dev/cdrw -checkdrive
+
Each of those options are explained in the following sections.
  
which should report "Vendor_info" and "Identification" of the drive.
+
==== Basic options ====
The next guess could be {{ic|/dev/sr0}}.
 
  
If no drive is found, check whether any {{ic|/dev/sr*}} exist and whether they offer rw-permission to you or your group.
+
;{{ic|-V}}: Specifies the name (that is assigned to) of the file system. The ISO 9660 standard specs impose the limitations of 32-character string length, as well as limiting the characters allowed to sets of: "A" to "Z", "0" to "9", and "_". This volume label will probably show up as mount point if the medium is mounted automatically.
If no {{ic|/dev/sr*}} exists then try
+
;{{ic|-J}}: Enables [[Wikipedia:Joliet (file system)|Joliet]] extension, which allocates special space to store file names in Unicode (up to 64 UTF-16 characters for each file).
 +
;{{ic|-joliet-long}}: Increases maximum length of file names from 64 to 103 UTF-16 characters in Joliet table. Non-compliant to Joliet specs and not commonly supported.
 +
;{{ic|-r}}: Enables [[Wikipedia:Rock Ridge|Rock Ridge]] extension, which adds POSIX file system semantics to an image, including support of long 255-character filenames and Unix-style file permissions.
 +
;{{ic|-o}}: Sets the file path for the resulting ISO image.
  
{{ic|1= $ modprobe sr_mod}}
+
==== graft-points ====
  
=== Erasing CD-RW ===
+
It is also possible to let ''mkisofs'' to collect files and directories from various paths
  
CD-RW media usually need to be erased before you can write new data on it. To blank CD-RW medium use this command:
+
$ mkisofs -V "''BACKUP_2013_07_27''" -J -r -o ''backup_2013_07_27.iso'' \
 +
  -graft-points \
 +
  ''/photos=/home/user/photos \
 +
  /mail=/home/user/mail \
 +
  /photos/holidays=/home/user/holidays/photos''
  
$ wodim -v dev=/dev/cdrw -blank=fast
+
;{{ic|-graft-points}}: Enables the recognition of ''pathspecs'' which consist of a target address in the ISO file system (e.g. {{ic|/photos}}) and a source address on hard disk (e.g. {{ic|/home/user/photos}}). Both are separated by a "=" character.
  
As you might have guessed, this blanks your medium really fast, but you can also use some other options, just replace the word ''fast'' with one of the following:
+
So this example puts the disk directory {{ic|/home/user/photos}}, {{ic|/home/user/mail}} and {{ic|/home/user/holidays/photos}}, respectively in the ISO image as {{ic|/photos}}, {{ic|/mail}} and {{ic|/photos/holidays}}.
  
;all: blank the entire disk
+
Programs ''mkisofs'' and ''xorrisofs'' accept the same options. For secure backups, consider using ''xorrisofs'' with option {{ic|--for_backup}}, which records eventual ACLs and stores an MD5 checksum for each data file.
;disc: blank the entire disk
 
;disk: blank the entire disk
 
;fast: minimally blank the entire disk (PMA, TOC, pregap)
 
;minimal: minimally blank the entire disk (PMA, TOC, pregap)
 
;track: blank a track
 
;unreserve: unreserve a track
 
;trtail: blank a track tail
 
;unclose: unclose last session
 
;session: blank last session
 
  
=== Burning an ISO image ===
+
See the manuals of the ISO 9660 programs for more info about their options:
 +
* [http://cdrtools.sourceforge.net/private/man/cdrecord/index.html mkisofs]
 +
* [https://www.gnu.org/software/xorriso/man_1_xorrisofs.html xorrisofs]
  
To burn an ISO image run:
+
=== Mounting an ISO image ===
 +
You can mount an ISO image if you want to browse its files.
 +
To mount the ISO image, we can use:
 +
# mount -t iso9660 -o ro,loop ''/path/to/file.iso'' ''/mount-point''
  
$ cdrecord -v dev=/dev/sr0 isoimage.iso
+
Do not forget to unmount the image when your inspection of the image is done:
  
=== Verify the burnt ISO image ===
+
# umount /mount-point
  
You can verify the integrity of the burnt CD to make sure it contains no errors. Always eject the CD and reinsert it before verifying.
+
See also [[Mounting images as user]] for mounting without root privileges.
  
First calculate the md5sum of the original ISO image:
+
=== Converting img/ccd to an ISO image ===
  
{{hc|$ md5sum isoimage.iso|
+
To convert an {{ic|img}}/{{ic|ccd}} image, you can use {{Pkg|ccd2iso}}:
e5643e18e05f5646046bb2e4236986d8 isoimage.iso
 
}}
 
  
If the CD was burnt in DAO (Disc At Once) mode by passing the -dao option to cdrecord you can calculate the md5sum of the burnt CD as follows:
+
$ ccd2iso ''~/image.img'' ''~/image.iso''
  
{{hc|$ md5sum /dev/sr0|
+
=== Learning the name of your optical drive ===
e5643e18e05f5646046bb2e4236986d8 /dev/sr0
 
}}
 
  
If the CD was burnt in TAO (Track At Once) mode it can be verified with dd and md5sum. You need to know the number of sectors to check. You can calculate this by dividing the size of the ISO file by 2048, but for your convenience this is included in the output of cdrecord:
+
For the remainder of this section the name of your recording device is assumed to be {{ic|/dev/sr0}}.
  
Track 01: Total bytes read/written: 90095616/90095616 (43992 sectors).
+
Check this by
  
Then check if this matches the md5sum of the burnt image, replacing "count" with the number of sectors:
+
$ cdrecord dev=''/dev/sr0'' -checkdrive
  
{{hc|<nowiki>$ dd if=/dev/sr0 bs=2048 count=43992 | md5sum</nowiki>|
+
which should report {{ic|Vendor_info}} and {{ic|Identification}} fields of the drive.
43992+0 records in
 
43992+0 records out
 
90095616 bytes (90 MB) copied, 0.359539 s, 251 MB/s
 
e5643e18e05f5646046bb2e4236986d8  -
 
}}
 
  
=== Burning an audio CD ===
+
If no drive is found, check whether any {{ic|/dev/sr*}} exist and whether they offer read/write permission ({{ic|wr-}}) to you or your group.
 +
If no {{ic|/dev/sr*}} exists then try [[Kernel_modules|loading]] module {{ic|sr_mod}} manually.
  
Create your audio tracks and store them as uncompressed, 16-bit stereo WAV files. To convert MP3 to WAV, ensure {{Pkg|lame}} is installed, {{ic|cd}} to the directoy with your MP3 files, and run:
+
=== Reading the volume label of a CD or DVD ===
  
$ for i in *.mp3; do lame --decode "$i" "$(basename "$i" .mp3)".wav; done
+
If you want to get the name/label of the media, use ''dd'':
  
In case you get an error when trying to burn WAV files converted with lame try decoding with {{Pkg|mpg123}}:
+
$ dd if=''/dev/sr0'' bs=1 skip=32808 count=32
  
$ for i in *.mp3; do mpg123 --rate 44100 --stereo --buffer 3072 --resync -w $(basename $i .mp3).wav $i; done
+
=== Creating an ISO image from a CD, DVD, or BD ===
  
Name the audio files in a manner that will cause them to be listed in the desired track order when listed alphabetically, such as {{ic|01.wav}}, {{ic|02.wav}}, {{ic|03.wav}}, etc.
+
In order to only copy actual data from the disc and not the empty blocks filling it up, first retrieve its block/sector count and size (2048 most of the time):
Use the following command to simulate burning the wav files as an audio CD:
 
  
$ wodim -dummy -v -pad speed=1 dev=/dev/cdrw -dao -swab *.wav
+
{{hc|$ isosize -x /dev/sr0|
 +
sector count: 2041796, sector size: 2048
 +
}}
  
In case you detect errors or empty tracks like:
+
or alternatively:
  
Track 01: audio    0 MB (00:00.00) no preemp pad
+
{{hc|$ isoinfo -d -i /dev/sr0 {{!}} grep -i -E 'block size{{!}}volume size'|
 +
Logical block size is: 2048
 +
Volume size is: 2041796
 +
}}
  
try another decoder (e.g. mpg123) or try using cdrecord from the {{Pkg|cdrtools}} package.
+
{{Note|Do not forget to replace {{ic|/dev/sr0}} with your optical drive device name.}}
  
Note that {{Pkg|cdrkit}} also contains a cdrecord command but it is just a softlink to ''wodim''.
+
Then use [[dd]] to copy the data using the obtained values:
If anything worked you can remove the dummy flag to really burn the CD
 
  
To test the new audio CD, use [[MPlayer]]:
+
$ dd if=/dev/sr0 of=discmage.iso bs=''sector_size'' count=''sector_count'' status=progress
  
$ mplayer cdda://
+
{{Tip|If the medium is damaged, it is preferable to use a dedicated utility such as {{Pkg|ddrescue}}. See [[Disk cloning#Using ddrescue]].}}
  
=== Burning a bin/cue ===
+
If the original medium was bootable, then the copy will be a bootable image. You may use it as a pseudo CD for a virtual machine or burn it onto an optical media which should then become bootable. [https://askubuntu.com/questions/147800/ripping-dvd-to-iso-accurately#874945]
  
To burn a bin/cue image run:
+
=== Erasing CD-RW and DVD-RW ===
  
$ cdrdao write --device /dev/cdrw image.cue
+
Used CD-RW media need to be erased before you can write over the previously recorded data. This is done by
  
=== Making an ISO image from an existing CD ===
+
$ cdrecord -v dev=''/dev/sr0'' blank=fast
  
To copy an existing CD just type:
+
There are two options for blanking: {{ic|1=blank=fast}} and {{ic|1=blank=full}}. Full blanking lasts as long as a full write run. It overwrites the payload data on the CD. Nevertheless this should not be considered as securely making those data unreadable. For that purpose, several full write runs with random data are advised.
  
$ readom -v dev=/dev/cdrw f=isoimage.iso
+
Alternative commands are:
  
{{Note|If you get "Error trying to open /dev/cdrw exclusively (Device or resource busy)...", unmount the CD with
+
$ cdrskin -v dev=''/dev/sr0'' blank=fast
  # umount /dev/cdrw
+
  $ xorriso -outdev ''/dev/sr0'' -blank as_needed
Replace /dev/cdrw with /dev/cdrom if it's a CDRom.}}
 
  
You do not want to use dd or cat as they provide no error checking, but for reference here are those commands:
+
To erase the DVD-RW use the ''dvd+rw-format'' utility from {{Pkg|dvd+rw-tools}}:
  
  $ dd if=/dev/cdrw of=/home/user/isoimage.iso
+
  $ dvd+rw-format -blank=fast ''/dev/sr0''
  
or with cat:
+
Alternative commands are:
  
  $ cat /dev/cdrw > isoimage.iso
+
  $ cdrecord -v dev=''/dev/sr0'' blank=fast
 +
$ cdrskin -v dev=''/dev/sr0'' blank=deformat_sequential_quickest
 +
$ xorriso -outdev ''/dev/sr0'' -blank deformat_quickest
  
Or use the {{ic|readcd}} program (which is now a symlink to readom), also in the {{ic|cdrkit}} package:
+
Such fastly blanked DVD-RW are not suitable for multi-session and cannot take input streams of unpredicted length. For that purpose one has to use one of:
  
  $ readcd -v dev=/dev/cdrw -f isoimage.iso
+
  $ cdrecord -v dev=''/dev/sr0'' blank=all
 +
$ dvd+rw-format -blank=full ''/dev/sr0''
 +
$ cdrskin -v dev=''/dev/sr0'' blank=as_needed
 +
$ xorriso -outdev ''/dev/sr0'' -blank as_needed
  
If the original CD was bootable it will be a bootable image.
+
The other media types are either write-once (CD-R, DVD-R, DVD+R, BD-R) or are overwritable without the need for erasing (DVD-RAM, DVD+RW, BD-RE).
  
==== TOC/CUE/BIN for mixed-mode disks ====
+
=== Formatting DVD-RW ===
  
ISO images only store a single data track. If you want to create an image of a mixed-mode disk (data track with multiple audio tracks) then you need to make a TOC/BIN pair:
+
Formatted DVD-RW media can be overwritten without previous erasure. So consider to apply once in their life time
  
  $ cdrdao read-cd --read-raw --datafile IMAGE.bin --driver generic-mmc:0x20000 --device /dev/cdrom IMAGE.toc
+
  $ dvd+rw-format -force ''/dev/sr0''
 +
$ cdrskin -v dev=''/dev/sr0'' blank=format_if_needed
 +
$ xorriso -outdev ''/dev/sr0'' -format as_needed
  
Some software only likes CUE/BIN pair, you can make a CUE sheet with {{ic|toc2cue}} (part of {{ic|cdrdao}}):
+
Unlike DVD-RAM, DVD+RW, and BD-RE, formatted DVD-RW cannot be used as (slow) hard disk directly, but rather need the mediation of driver pktcdvd. See man pktsetup.
  
$ toc2cue IMAGE.toc IMAGE.cue
+
=== Formatting BD-RE and BD-R ===
  
=== Making an ISO image from existing files on hard disk ===
+
BD-RE need formatting before first use. This is done automatically by the burn programs when they detect the unformatted state. Nevertheless the size of the payload area can be influenced by expert versions of the format commands shown above for DVD-RW.
  
To make an iso image just copy the needed files to one folder, then do:
+
BD-R can be used unformatted or formatted. Unformatted they are written with full nominal speed and offer maximum storage capacity. Formatted they get checkread during write operations and bad blocks get replaced by blocks from the Spare Area. This reduces write speed to a half or less of nominal speed. The default sized Spare Area reduces the storage capacity by 768 MiB.
  
$ mkisofs -V volume_name -J -r -o isoimage.iso ~/folder
+
growisofs formats BD-R by default. The others do not. growisofs can be kept from formatting. cdrskin and xorriso can write with full nominal speed on formatted BD-RE or BD-R:
  
=== Mounting an ISO image ===
+
  $ growisofs -use-the-force-luke=spare:none ...growisofs.or.mkisofs.options...
 +
  $ cdrskin stream_recording=on ...cdrecord.options...
 +
  $ xorriso -stream_recording on ...xorriso.commands...
  
To test if the ISO image is proper, you can mount it (as root):
+
=== Burning an ISO image to CD, DVD, or BD ===
  
# mount -t iso9660 -o ro,loop=/dev/loop0 cd_image /cdrom
+
To burn a readily prepared ISO image file {{ic|isoimage.iso}} onto an optical medium, run for CD:
  
You have to first load the loop module:
+
$ cdrecord -v -sao dev=''/dev/sr0'' ''isoimage.iso''
  
# modprobe loop
+
and for DVD or BD:
  
See also [[Mounting images as user]] for doing this without root privileges.
+
$ growisofs -dvd-compat -Z ''/dev/sr0''=''isoimage.iso''
  
=== Converting to an ISO image ===
+
{{Note|1=<br />
 +
* Make sure that the medium is not mounted when you begin to write to it. Mounting may happen automatically if the medium contains a readable file system. In the best case, it will prevent the burn programs from using the burner device. In the worst case, there will be misburns because read operations disturbed the drive. So if in doubt, do: {{bc|# umount /dev/sr0}}
 +
* ''growisofs'' has a [https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=713016 small bug] with blank BD-R media. It issues an error message after the burning is complete. Programs like ''k3b'' then believe the whole burn run failed. To prevent this, either
 +
** format the blank BD-R by {{ic|dvd+rw-format ''/dev/sr0''}} before submitting it to ''growisofs''
 +
** or use ''growisofs'' option {{ic|1= -use-the-force-luke=spare:none}}
 +
}}
  
To convert an {{ic|img}}/{{ic|ccd}} image, you can use {{Pkg|ccd2iso}}:
+
=== Verifying the burnt ISO image ===
  
$ ccd2iso ~/image.img ~/image.iso
+
You can verify the integrity of the burnt medium to make sure it contains no errors. Always eject the medium and reinsert it before verifying. It will guarantee that not any kernel cache will be used to read the data.
  
== DVD burning ==
+
First calculate the MD5 checksum of the original ISO image:
{{Merge|#CD burning|This section is candidate to be merged with [[#CD burning]] soon.|Talk:Optical_Disc_Drive#How_to_contribute_as_upstream_developer_.3F}}
 
  
Writing (or "burning") DVDs requires a different approach than burning CDs. DVDs offer much higher capacities, and the standard CD writing tools will not suffice.
+
{{hc|$ md5sum isoimage.iso|
 +
e5643e18e05f5646046bb2e4236986d8 isoimage.iso
 +
}}
  
This guide covers a narrow scope for now: writing data onto DVDs using the command line.
+
Next calculate the MD5 checksum of the ISO file system on the medium.
 +
Although some media types deliver exactly the same amount of data as have been submitted to the burn program, many others append trailing garbage when being read. So you should restrict reading to the size of the ISO image file.
  
=== Required packages ===
+
$ blocks=$(expr $(du -b isoimage.iso | awk '{print $1}') / 2048)
  
# You still need the standard CD writing tools known as {{Pkg|cdrtools}} (which can be replaced by {{Pkg|cdrkit}}, if desired).
+
{{hc|<nowiki>$ dd if=/dev/sr0 bs=2048 count=$blocks | md5sum</nowiki>|
# You also need the new DVD writing tools known as {{Pkg|dvd+rw-tools}} found in the [[Official Repositories|official repositories]].
+
43992+0 records in
 +
43992+0 records out
 +
90095616 bytes (90 MB) copied, 0.359539 s, 251 MB/s
 +
e5643e18e05f5646046bb2e4236986d8  -
 +
}}
  
{{Note|1= <br>
+
Both runs should yield the same MD5 checksum (here: {{ic|e5643e18e05f5646046bb2e4236986d8}}). If they do not, you will probably also get an I/O error message from the {{ic|dd}} run. {{ic|dmesg}} might then tell about SCSI errors and block numbers, if you are interested.
* Do not install the package known as {{Pkg|dvdrtools}}. It conflicts with {{Pkg|cdrtools}}, and {{Pkg|dvd+rw-tools}} is the superior DVD writing package.
 
* {{Pkg|cdrtools}} provides all the functionality of {{Pkg|dvd+rw-tools}}, as growisofs depends on mkisofs. Also the development of {{ic|dvd+rw-tools}} seems to be stalled for the past 5 years (the last release was in [http://fy.chalmers.se/~appro/linux/DVD+RW/tools/?M=D 2008])}}
 
  
{{Tip|If you wish to use a graphical front-end, install {{Pkg|k3b}} or {{Pkg|brasero}}, and you need to read no further.}}
+
=== ISO 9660 and burning on-the-fly ===
  
=== Procedure ===
+
It is not necessary to store an emerging ISO file system on hard disk before writing it to optical media. Only very old CD drives at very old computers could suffer failed burns due to empty drive buffer.
  
This guide will use the command {{ic|growisofs}} from the {{Pkg|dvd+rw-tools}} package. If you have ever written CDs from the command line before, you will know the process of first creating an iso9660 file ({{ic|mkisofs}}), and then burning it to CD ({{ic|cdrecord}}). {{ic|growisofs}} merges these steps, so you do not need extra storage space for the ISO file anymore. Another advantage is that multisession writing has been simplified.
+
If you omit option {{ic|-o}} from ''mkisofs'' then it writes the ISO image to standard output. This can be piped into the standard input of burn programs.
  
{{Note|
+
$ mkisofs -V "ARCHIVE_2013_07_27" -J -r ./for_iso | \
{{ic|growisofs}} has a small bug with blank BD-R media. It issues an error message after the burning is complete. Programs like {{ic|k3b}} then believe the whole burn run failed.
+
  cdrecord -v dev=/dev/sr0 -waiti -
To prevent this, either
 
* format the blank BD-R by {{ic|dvd+rw-format /dev/cdrw}} before submitting it to growisofs
 
* or use growisofs option {{ic|1= -use-the-force-luke=spare:none}}
 
}}
 
  
==== Overview ====
+
Option {{ic|-waiti}} is not really needed here. It prevents ''cdrecord'' from writing to the medium before ''mkisofs'' starts its output. This would allow ''mkisofs'' to read the medium without disturbing an already started burn run. See next section about multi-session.
  
Essentially, writing a '''new''' DVD follows this procedure:
+
On DVD and BD, you may let ''growisofs'' operate ''mkisofs'' for you and burn its output on-the-fly
  
  $ growisofs -Z /dev/sr0 -r -J ''/path/to/files''
+
  $ growisofs -Z ''/dev/sr0'' -V "''ARCHIVE_2013_07_27''" -r -J ''./for_iso''
  
where {{ic|/dev/sr0}} is your DVD writer device.
+
=== Multi-session ===
  
To '''continue''' a DVD (write an additional session), you use:
+
ISO 9660 multi-session means that a medium with readable file system is still writable at its first unused block address, and that a new ISO directory tree gets written to this unused part. The new tree is accompanied by the content blocks of newly added or overwritten data files. The blocks of data files, which shall stay as in the old ISO tree, will not be written again.
  
$ growisofs -M /dev/sr0 -r -J ''/path/to/files''
+
Linux and many other operating systems will mount the directory tree in the last session on the medium. This youngest tree will normally show the files of the older sessions, too.
  
To burn an ISO '''image''' to disc, use:
+
==== Multi-session by cdrecord ====
  
$ growisofs -dvd-compat -Z /dev/sr0=''/path/to/iso''
+
CD-R and CD-RW stay writable (aka "appendable") if cdrecord option {{ic|-multi}} was used
  
To create a video DVD, use the following:
+
$ cdrecord -v -multi dev=''/dev/sr0'' ''isoimage.iso''
  
$ growisofs -Z /dev/sr0 -dvd-video ''/path/to/video''
+
Then the medium can be inquired for the parameters of the next session
  
; {{ic|-Z}}: start at the beginning of the DVD using the following device
+
$ m=$(cdrecord dev=''/dev/sr0'' -msinfo)
; {{ic|-M}}: start after the last session on the disc using the following device
 
; {{ic|-r}}: [[Wikipedia:Rock Ridge|Rock Ridge]] support with sane permission settings (recommended, extended Unix info)
 
; {{ic|-J}}: [[Wikipedia:Joliet (file system)|Joliet]] support (recommended, extended info for Windows NT and Windows 95)
 
  
{{Note|{{ic|-r}} will choose different permissions than the real ones; to use the exact permissions use {{ic|-R}} instead. See the man page of {{ic|mkisofs}} for more information.}}
+
By help of these parameters and of the readable medium in the drive you can produce the add-on ISO session
  
{{Note|
+
$ mkisofs -M ''/dev/sr0'' -C "$m" \
{{ic|growisofs}} has a small bug with blank BD-R media. It issues an error message after the burning is complete. Programs like {{ic|k3b}} then believe the whole burn run failed.
+
    -V "''ARCHIVE_2013_07_28''" -J -r -o ''session2.iso'' ''./more_for_iso''
To prevent this, either
 
* format the blank BD-R by {{ic|dvd+rw-format /dev/cdrw}} before submitting it to growisofs
 
* or use growisofs option {{ic|1= -use-the-force-luke=spare:none}}
 
}}
 
  
{{Tip|1=If you want to copy an existing DVD, one way that works is to make an ISO using {{ic|readcd}}:
+
Finally append the session to the medium and keep it appendable again
$ readcd -v dev=/dev/sr0 -f image.iso
 
  
as for [[#CD burning|CD burning]], then use the {{ic|growisofs}} example above to burn the ISO to a new blank disc.}}
+
$ cdrecord -v -multi dev=''/dev/sr0'' ''session2.iso''
  
==== Example ====
+
Programs ''cdrskin'' and ''xorrecord'' do this too with DVD-R, DVD+R, BD-R and unformatted DVD-RW. Program ''cdrecord'' does multi-session with at least DVD-R and DVD-RW. They all do with CD-R and CD-RW, of course.
  
Although the above might suffice for you, some users require extra settings to successfully write DVDs.
+
Most re-usable media types do not record a session history that would be recognizable for a mounting kernel. But with ISO 9660 it is possible to achieve the multi-session effect even on those media.
  
A simple DVD writing template:
+
''growisofs'' and ''xorriso'' can do this and hide most of the complexity.
  
$ growisofs -Z /dev/cdrw -v -l -dry-run -iso-level 3 -R -J -speed=2 -joliet-long -graft-points /files/=/path/to/files/
+
==== Multi-session by growisofs ====
  
; {{ic|-Z}}: as seen above, this starts a new DVD; to continue a multisession DVD, use {{ic|-M}}
+
By default, ''growisofs'' uses ''mkisofs'' as a backend for creating ISO images  forwards most of its program arguments to . See above examples of ''mkisofs''. It bans option {{ic|-o}} and deprecates option {{ic|-C}}. By default it uses the ''mkisofs''. You may specify to use one of the others compatible backend program by setting environment variable {{ic|MKISOFS}}:
; {{ic|-v}}: increase verbosity level (more output)
 
; {{ic|-l}}: breaks DOS compatibility but allows for longer filenames
 
; {{ic|-dry-run}}: simulate writing (remove this flag if you are sure that everything is set up correctly)
 
; {{ic|-iso-level 3}}: defines how strict you want to adhere to the iso9660 standard ({{ic|-iso-level 1}} is very strict while {{ic|-iso-level 4}} is very loose)
 
; {{ic|-R}}: see above
 
; {{ic|-J}}: see above
 
; {{ic|1=-speed=2}}: start burning at 2X speed
 
; {{ic|-joliet-long}}: allows longer Joliet file names
 
  
The final part needs more explanation:
+
$ export MKISOFS="xorrisofs"
  
-graft-points /files/=/path/to/files/
+
The wish to begin with a new ISO file system on the optical medium is expressed by option {{ic|-Z}}
  
This specifies that files will be stored in the subdirectory {{ic|/files}} rather than the DVD root. See the {{ic|mkisofs}} manual for details.
+
$ growisofs -Z ''/dev/sr0'' -V "''ARCHIVE_2013_07_27''" -r -J ''./for_iso''
  
{{Note|{{ic|growisofs}} is basically just a front-end to {{ic|mkisofs}}. That means that any option for {{ic|mkisofs}} also works with {{ic|growisofs}}. See the {{ic|mkisofs}} man page for details.}}
+
The wish to append more files as new session to an existing ISO file system is expressed by option {{ic|-M}}
  
=== Re-writable DVDs ===
+
$ growisofs -M ''/dev/sr0'' -V "''ARCHIVE_2013_07_28''" -r -J ''./more_for_iso''
  
The process for burning re-writable discs is almost the same as for normal DVDs. However, keep in mind that virgin DVD+RW media needs to be initially formatted ("blanked") prior to usage. Blanking can be done using the program {{ic|dvd+rw-format}} like this:
+
For details see the {{man|1|growisofs}} manual and the manuals of ''mkisofs'' and ''xorrisofs''.
  
$ dvd+rw-format /dev/cdrw
+
==== Multi-session by xorriso ====
  
where {{ic|/dev/cdrw}} is your DVD writer device.
+
''xorriso'' learns the wish to begin with a new ISO file system from the blank state of the medium. So it is appropriate to blank it if it contains data. The command {{ic|-blank as_needed}} applies to all kinds of re-usable media and even to ISO images in data files on hard disk. It does not cause error if applied to a blank write-once medium.
  
== Burning CD/DVD with a GUI ==
+
$ xorriso -outdev ''/dev/sr0'' -blank as_needed \
 +
          -volid "''ARCHIVE_2013_07_27''" -joliet on -add ''./for_iso'' --
  
{{Wikipedia|Comparison of disc authoring software|Wikipedia - Comparison of disc authoring software}}
+
On non-blank writable media ''xorriso'' appends the newly given disk files if command {{ic|-dev}} is used rather than {{ic|-outdev}}. Of course, no command {{ic|-blank}} should be given here
There are several applications available to burn CDs in a graphical environment.
 
  
* {{App|[[Wikipedia:AcetoneISO|AcetoneISO]]|All in one ISO tool (supports BIN, MDF, NRG, IMG, DAA, DMG, CDI, B5I, BWI, PDI and ISO)|http://sourceforge.net/projects/acetoneiso|{{Pkg|acetoneiso2}}}}
+
$ xorriso -dev ''/dev/sr0'' \
* {{App|BashBurn|Lightweight terminal based menu frontend for CD/DVD burning tools|http://bashburn.dose.se/|{{Pkg|bashburn}}}}
+
          -volid "''ARCHIVE_2013_07_28''" -joliet on -add ''./more_for_iso'' --
* {{App|[[Wikipedia:Brasero (software)|Brasero]]|Disc burning application for the GNOME desktop that is designed to be as simple as possible. Part of {{Grp|gnome-extra}}|http://projects.gnome.org/brasero/|{{Pkg|brasero}}}}
 
* {{App|cdw|Ncurses frontend to cdrecord, mkisofs, growisofs, dvd+rw-mediainfo, dvd+rw-format, xorriso|http://cdw.sourceforge.net/|{{AUR|cdw}}}}
 
* {{App|[[Wikipedia:GnomeBaker|GnomeBaker]]|Full featured CD/DVD burning application for the GNOME desktop|http://gnomebaker.sourceforge.net/|{{AUR|gnomebaker}}}}
 
* {{App|Graveman|GTK-based CD/DVD burning application. It requires configuration to point to correct devices|http://graveman.tuxfamily.org/|{{AUR|graveman}}}}
 
* {{App|[[Wikipedia:ISO_Master|isomaster]]|ISO image editor|http://littlesvr.ca/isomaster|{{AUR|isomaster}}}}
 
* {{App|[[Wikipedia:K3b|K3b]]|Feature-rich and easy to handle CD burning application based on Kdelibs|http://www.k3b.org/|{{Pkg|k3b}}}}
 
* {{App|Silicon empire|Qt-based set of tools to manage and organize your optical discs like CDs, DVDs and Blu-rays|http://getsilicon.org/|{{AUR|silicon-empire}}}}
 
* {{App|[[Wikipedia:X-CD-Roast|X-CD-Roast]]|Lightweight cdrtools front-end for CD and DVD writing|http://www.xcdroast.org/|{{AUR|xcdroast}}}}
 
* {{App|Xfburn|Simple frontend to the libburnia libraries with support for CD/DVD(-RW), ISO images and BurnFree|http://goodies.xfce.org/projects/applications/xfburn|{{Pkg|xfburn}}}}
 
  
=== Nero Linux ===
+
For details see the [https://www.gnu.org/software/xorriso/man_1_xorriso.html manual page] and especially its [https://www.gnu.org/software/xorriso/man_1_xorriso.html#EXAMPLES examples]
  
Nero Linux is a commercial burning suite from makers of Nero for Windows - Nero AG. The biggest advantage of Nero linux is its interface which similar to window version. Hence, users migrating from windows might find it easy to operate. The Linux version now includes Nero Express, a wizard which takes users through the process of burning CDs and DVDs step-by-step, which users will be familiar with from the Windows version. Also new in version 4 is Blu-ray Disc defect management, integration of Isolinux for creating bootable media and support for Musepack and AIFF audio formats...
+
=== BD Defect Management ===
  
Nero Linux 4 retails at £17.99 with a free trial version also available.
+
BD-RE and formatted BD-R media are normally written with enabled Defect Management. This feature reads the written blocks while they are still stored in the drive buffer. In case of poor read quality the blocks get written again or redirected to the ''Spare Area'' where the data get stored in replacement blocks.
  
* [http://www.nero.com/enu/linux4.html Nero Linux 4]
+
This checkreading reduces write speed to at most half of the nominal speed of drive and BD medium. Sometimes it is even worse. Heavy use of the Spare Area causes long delays during read operations. So Defect Management is not always desirable.
* {{AUR|nerolinux}} [[AUR]] package
 
  
==== Features ====
+
''cdrecord'' does not format BD-R. It has no means to prevent Defect Management on BD-RE media, though.
  
* Easy, wizard-style user interface for guided burning with Nero Linux Express 4
+
''growisofs'' formats BD-R by default. The Defect Management can be prevented by option {{ic|1= -use-the-force-luke=spare:none}}. It has no means to prevent Defect Management on BD-RE media, though.
* Full Blu-ray Burning Support
 
* Supports Burning of Audio CD (CD-DA), ISO 9660 (Joliet support), CD-Text, ISOLINUX Bootable, Multi-session Discs, DVD-Video and miniDVD, DVD double layer support.
 
* Advanced burning with Nero Burning ROM and command line client
 
  
{{Note|For Nero Linux you need to load {{ic|sg}} module at boot time. Put a namesake file in {{ic|/etc/modules-load.d}}:
+
''cdrskin'', ''xorriso'' and ''xorrecord'' do not format BD-R by default. They do with {{ic|1= cdrskin blank=format_if_needed}}, resp. {{ic|1= xorriso -format as_needed}}, resp. {{ic|1= xorrecord blank=format_overwrite}}. These three programs can disable Defect Management with BD-RE and already formatted BD-R by {{ic|1= cdrskin stream_recording=on}}, resp. {{ic|1= xorriso -stream_recording on}}, resp. {{ic|1= xorrecord stream_recording=on}}.
{{hc|/etc/modules-load.d/sg.config|
 
sg
 
}}
 
Some updates ago the sg module wasn't auto loaded any more and Nero needs it.}}
 
  
== DVD playing ==
+
=== Burning an audio CD ===
  
[[Wikipedia:DVD|DVD]], also known as Digital Versatile Disc or Digital Video Disc, is an optical disc storage media format used for video and data storage.
+
Create your audio tracks and store them as uncompressed, 16-bit, stereo WAV files. To convert MP3 to WAV, ensure {{Pkg|lame}} is installed, ''cd'' to the directory with your MP3 files, and run:
  
=== Requirements===
+
$ for i in *.mp3; do lame --decode "$i" "$(basename "$i" .mp3)".wav; done
  
If you wish to play encrypted DVDs, you must install the libdvd* packages:
+
In case you get an error when trying to burn WAV files converted with LAME, try decoding with {{Pkg|mpg123}}:
  
* {{Pkg|libdvdread}}
+
$ for i in *.mp3; do mpg123 --rate 44100 --stereo --buffer 3072 --resync -w $(basename $i .mp3).wav $i; done
* {{Pkg|libdvdcss}}
 
* {{Pkg|libdvdnav}}
 
  
Additionally, you must install player software. Popular DVD players are [[MPlayer]], [[Wikipedia:Xine|xine]] and [[Wikipedia:VLC|VLC]].  
+
To convert AAC to WAV ensure {{Pkg|faad2}} is installed and run:
 +
$ for i in *.m4a; do faad $i; done
  
{{Tip|Users may need to belong to the {{ic|optical}} [[Users and Groups|group]] to be able to access the DVD drive. To add {{ic|USERNAME}} to the {{ic|optical}} group, run the following:
+
Name the audio files in a manner that will cause them to be listed in the desired track order when listed alphabetically, such as {{ic|01.wav}}, {{ic|02.wav}}, {{ic|03.wav}}, etc. Use the following command to simulate burning the WAV files as an audio CD:
# gpasswd -a USERNAME optical
 
Do not forget to log the user out and back in for the changes to take effect. You can see your user's current groups with {{ic|groups}} command.}}
 
  
=== DVD players ===
+
$ cdrecord '''-dummy''' -v -pad speed=1 dev=''/dev/sr0'' -dao -swab *.wav
  
See also: [[List_of_Applications/Multimedia#Video_players|Multimedia/Video Players]]
+
If everything worked, you can remove the {{ic|dummy}} flag to actually burn the CD.
  
==== MPlayer ====
+
To test the new audio CD, use [[MPlayer]]:
  
[[MPlayer]] is efficient and supports a wide variety of media formats (i.e. almost everything). To play a DVD with MPlayer:
+
$ mplayer cdda://
  
$ mplayer dvd://N
+
=== Burning a BIN/CUE ===
  
...where {{ic|N}} is the desired chapter number. Start at 1 and work up if unsure.
+
To burn a BIN/CUE image run:
  
Mplayer checks {{ic|/dev/dvd}} by default. Tell it to use {{ic|/dev/sr0}} with the {{ic|dvd-device}} option at the command line, or the {{ic|dvd-device}} variable in {{ic|~/.mplayer/config}}.
+
$ cdrdao write --device ''/dev/sr0'' ''image.cue''
  
To play a DVD image file:
+
==== TOC/CUE/BIN for mixed-mode disks ====
  
$ mplayer -dvd-device movie.iso dvd://N
+
ISO images only store a single data track. If you want to create an image of a mixed-mode disk (data track with multiple audio tracks) then you need to make a TOC/BIN pair:
  
To enable the DVD menu use (NOTE: you use arrow keys to navigate and the {{Keypress|Enter}} key to choose):
+
$ cdrdao read-cd --read-raw --datafile ''image.bin'' --driver generic-mmc:0x20000 --device ''/dev/cdrom'' ''image.toc''
  
$ mplayer dvdnav://
+
Some software only likes CUE/BIN pair, you can make a CUE sheet with ''toc2cue'' (part of {{Pkg|cdrdao}}):
  
To enable mouse support in DVD menus use:
+
$ toc2cue ''image.toc'' ''image.cue''
  
$ mplayer -mouse-movements dvdnav://
+
=== Burn backend problems ===
  
To find the audio language, start MPlayer with the {{ic|-v}} switch to output audio IDs. An audio track is selected with {{ic|-aid <audio_id>}}. Set a default audio language by editing {{ic|~/.mplayer/config}} and adding the line {{ic|1=alang=en}} for English.  
+
If you're experiencing problems, you may ask for advise at mailing list [mailto:cdwrite@other.debian.org cdwrite@other.debian.org], or try to write to the one of support mail addresses if some are listed near the end of the program's man page.
  
With MPlayer, the DVD could be set to a low volume. To increase the maximum volume to 400%, use {{ic|1=softvol=yes}} and {{ic|1=softvol-max=400}}. The startup volume defaults to 100% of software volume and the global mixer levels will remain untouched. Using the 9 and 0 keys, volume can be adjusted between 0 and 400 percent.
+
Tell the command lines you tried, the medium type (e.g. CD-R, DVD+RW, ...), and the symptoms of failure (program messages, disappointed user expectation, ...). You will possibly get asked to obtain the newest release or development version of the affected program and to make test runs. But the answer might as well be, that your drive dislikes the particular medium.
  
  alang=en
+
=== Burning CD/DVD/BD with a GUI ===
  softvol=yes
 
  softvol-max=400
 
  
[http://www.mplayerhq.hu/ MPlayer home page]
+
There are several applications available to burn CDs in a graphical environment.
  
==== VLC ====
+
See also [[Wikipedia:Comparison of disc authoring software]].
  
{{Pkg|vlc}} is a portable, capable, open source media player written in Qt ([http://www.videolan.org/vlc VLC home page]).
+
* {{App|[[Wikipedia:AcetoneISO|AcetoneISO]]|All-in-one ISO tool (supports BIN, MDF, NRG, IMG, DAA, DMG, CDI, B5I, BWI, PDI and ISO).|http://sourceforge.net/projects/acetoneiso|{{Pkg|acetoneiso2}}}}
 +
* {{App|BashBurn|Lightweight terminal based menu frontend for CD/DVD burning tools.|http://bashburn.dose.se/|{{Pkg|bashburn}}}}
 +
* {{App|[[Wikipedia:Brasero (software)|Brasero]]|Disc burning application for the GNOME desktop that is designed to be as simple as possible. Part of {{Grp|gnome-extra}}.|https://wiki.gnome.org/Apps/Brasero|{{Pkg|brasero}}}}
 +
* {{App|cdw|Ncurses frontend to ''cdrecord'', ''mkisofs'', ''growisofs'', ''dvd+rw-mediainfo'', ''dvd+rw-format'' and ''xorriso''.|http://cdw.sourceforge.net/|{{AUR|cdw}}}}
 +
* {{App|[[Wikipedia:GnomeBaker|GnomeBaker]]|Full featured CD/DVD burning application for the GNOME desktop.|http://gnomebaker.sourceforge.net/|{{AUR|gnomebaker}}}}
 +
* {{App|Graveman|GTK-based CD/DVD burning application. It requires configuration to point to correct devices.|http://graveman.tuxfamily.org/|{{AUR|graveman}}}}
 +
* {{App|[[Wikipedia:ISO_Master|isomaster]]|ISO image editor.|http://littlesvr.ca/isomaster|{{AUR|isomaster}}}}
 +
* {{App|[[Wikipedia:K3b|K3b]]|Feature-rich and easy to handle CD burning and ripping application based on KDElibs.|http://www.k3b.org/|{{Pkg|k3b}}}}
 +
* {{App|[[Wikipedia:X-CD-Roast|X-CD-Roast]]|Lightweight ''cdrtools'' front-end for CD and DVD writing.|http://www.xcdroast.org/|{{AUR|xcdroast}}}}
 +
* {{App|[[Wikipedia:Xfce#Xfburn|Xfburn]]|Simple front-end to the libburnia libraries with support for CD/DVD(-RW), ISO images, and BurnFree.|http://goodies.xfce.org/projects/applications/xfburn|{{Pkg|xfburn}}}}
 +
* {{App|xorriso-tcltk|Graphical front-end to ISO and CD/DVD/BD burn tool xorriso|https://www.gnu.org/software/xorriso/xorriso-tcltk-screen.gif|{{Pkg|libisoburn}}}}
  
===== Default in GNOME =====
+
== Playback ==
  
Copy the system desktop file to the local one (local .desktop files supersede the global ones):
+
=== CD ===
  
cp /usr/share/applications/vlc.desktop ~/.local/share/applications/
+
Playback of audio CDs requires the {{Pkg|libcdio}} package.
  
Define its mime types (known playback file type abilities) by doing:
+
=== DVD ===
  
<pre>sed -i 's|^Mimetype.*$|MimeType=video/dv;video/mpeg;video/x-mpeg;video/msvideo;video/quicktime;video/x-anim;video/x-avi;video/x-ms-asf;video/x-ms-wmv;video/x-msvideo;video/x-nsv;video/x-flc;video/x-fli;application/ogg;application/x-ogg;application/x-matroska;audio/x-mp3;audio/x-mpeg;audio/mpeg;audio/x-wav;audio/x-mpegurl;audio/x-scpls;audio/x-m4a;audio/x-ms-asf;audio/x-ms-asx;audio/x-ms-wax;application/vnd.rn-realmedia;audio/x-real-audio;audio/x-pn-realaudio;application/x-flac;audio/x-flac;application/x-shockwave-flash;misc/ultravox;audio/vnd.rn-realaudio;audio/x-pn-aiff;audio/x-pn-au;audio/x-pn-wav;audio/x-pn-windows-acm;image/vnd.rn-realpix;video/vnd.rn-realvideo;audio/x-pn-realaudio-plugin;application/x-extension-mp4;audio/mp4;video/mp4;video/mp4v-es;x-content/video-vcd;x-content/video-svcd;x-content/video-dvd;x-content/audio-cdda;x-content/audio-player;|' ~/.local/share/applications/vlc.desktop</pre>
+
If you wish to play encrypted DVDs, you must install the libdvd* packages:
 +
* {{Pkg|libdvdread}}
 +
* {{Pkg|libdvdcss}}
 +
* {{Pkg|libdvdnav}}
  
Then in '''System Settings > Details >> Default Applications ''' and on the '''Video''' drop-down menu, select '''Open VLC media player'''.}}
+
Additionally, you must install player software. Popular DVD players are [[MPlayer]], [[Wikipedia:Xine|xine]] and [[VLC]]. See the [[List of applications/Multimedia#Video players|video players]] list and the specific instructions for [[MPlayer#DVD playing|MPlayer]].
  
==== xine ====
+
== Ripping ==
  
A lightweight media player supporting DVD menus.
+
[[Wikipedia:Ripping|Ripping]] is the process of copying audio or video content to a hard disk, typically from removable media or media streams.
  
[http://www.xine-project.org/ xine home page]
+
=== CD ===
  
== DVD ripping ==
+
* {{App|[[Wikipedia:ABCDE|Abcde]]|Comprehensive command-line tool for ripping audio CDs.|https://abcde.einval.com/|{{Pkg|abcde}}}}
 +
* {{App|[[Wikipedia:Asunder|Asunder]]|GTK+-based CD ripping program.|http://littlesvr.ca/asunder/|{{Pkg|asunder}}}}
 +
* {{App|[[Wikipedia:cdparanoia|cdparanoia]]|Compact Disc Digital Audio (CDDA) Digital Audio Extraction (DAE) tool.|https://xiph.org/paranoia/index.html|{{Pkg|cdparanoia}}}}
 +
* {{App|Goobox|CD player and ripper for GNOME.|https://people.gnome.org/~paobac/goobox/|{{Pkg|goobox}}}}
 +
* {{App|[[Wikipedia:Grip (software)|Grip]]|Fast and light CD ripper within the GNOME project that resembles [[Wikipedia:Audiograbber|Audiograbber]].|https://sourceforge.net/projects/grip/|{{AUR|grip}}}}.
 +
* {{App|[[Wikipedia:K3b|K3b]]|Feature-rich and easy to handle CD/DVD burning and ripping application based on KDElibs.|http://www.k3b.org/|{{Pkg|k3b}}}}
 +
* {{App|ripperX|GTK+ program to rip CD audio tracks and encode them to the Ogg, MP3, or FLAC formats.|https://sourceforge.net/projects/ripperx/|{{AUR|ripperx}}}}
 +
* {{App|ripright|Minimal CD ripper modeled on autorip.|http://www.mcternan.me.uk/ripright/|{{AUR|ripright}}}}
 +
* {{App|ripit|Command-line ripper that supports MusicBrainz, freeddb and various codecs. |http://www.suwald.com/ripit/news.php|{{AUR|ripit}}}}
 +
* {{App|rubyripper|Audiodisk ripper that tries to deliver a secure rip through multiple rippings of the same track and corrections of any differences.|https://code.google.com/archive/p/rubyripper/|{{AUR|rubyripper}}}}
 +
* {{App|shnsplit|Splits .wav and .flac files according to a CUE sheet and encodes the resulting pieces. A useful companion to ABCDE.|http://www.etree.org/shnutils/shntool/|{{Pkg|shntool}}}}
 +
* {{App|[[Wikipedia:Sound Juicer|Sound Juicer]]|CD ripper for GNOME.|https://wiki.gnome.org/Apps/SoundJuicer|{{Pkg|sound-juicer}}}}
 +
* {{App|soundKonverter|Front-end to various audio converters.|https://www.linux-apps.com/content/show.php?content&#61;29024|{{Pkg|soundkonverter}}}}
 +
* {{App|whipper|CD ripper aiming for accuracy over speed. Uses cdparanoia, MusicBrainz, AccurateRip.|https://github.com/JoeLametta/whipper|{{Pkg|whipper}}}}
  
Ripping is the process of copying audio or video content to a hard disk, typically from removable media or media streams.[http://en.wikipedia.org/wiki/Ripping]
+
=== DVD-Video ===
  
 
Often, the process of ripping a DVD can be broken down into two subtasks:
 
Often, the process of ripping a DVD can be broken down into two subtasks:
# '''Data extraction''' - Copying the audio and/or video data to a hard disk
+
# '''Data extraction''' Copying the audio and/or video data to a hard disk,
# [[Wikipedia:Transcode|Transcoding]] - Converting the extracted data into a suitable format
+
# [[Wikipedia:Transcode|Transcoding]] Converting the extracted data into a suitable format.
  
Some utilities perform both tasks, whilst others focus on one aspect or the other.
+
Some utilities perform both tasks, whilst others focus on one aspect or the other:
  
=== dvdbackup ===
+
* {{App|Avidemux|Multithreaded video transcoder, which offers both a graphical and command-line interface with many preset configurations. Influenced by Handbrake.|http://fixounet.free.fr/avidemux/|{{AUR|avidemux-qt-git}}}}
 +
* {{App|[[dvdbackup]]|Tool for pure data extraction which does not transcode. It is useful for creating ''exact'' copies of encrypted DVDs in conjunction with '''libdvdcss''' or for decrypting video for other utilities unable to read encrypted DVDs.|http://dvdbackup.sourceforge.net/|{{Pkg|dvdbackup}}}}
 +
* {{App|[[FFmpeg]]|Complete and free Internet live audio and video broadcasting solution for Linux/Unix, capable to do a direct rip in any format (audio/video) from a DVD-Video ISO image, just select the input as the ISO image and proceed with the desired options. It also allows to downmixing, shrinking, spliting, selecting streams among other features.|http://ffmpeg.org/|See [[FFmpeg#Package_installation|article]]}}
 +
* {{App|HandBrake|Multithreaded video transcoder, which offers both a graphical and command-line interface with many preset configurations.|https://handbrake.fr/|{{Pkg|handbrake}}}}
 +
* {{App|Hybrid|Multi platform Qt based frontend for a bunch of other tools which can convert nearly every input to x264/Xvid/VP8 + ac3/ogg/mp3/aac/flac inside an mp4/m2ts/mkv/webm/mov/avi container, a Blu-ray or an AVCHD structure.|http://www.selur.de/|{{AUR|hybrid-encoder}}}}
 +
* {{App|[[MEncoder]]|Free command line video decoding, encoding and filtering tool released under the GNU GPL. It is a close sibling to MPlayer and can convert all the formats that MPlayer understands into a variety of compressed and uncompressed formats using different codecs. Wrapper programs like {{AUR|h264enc}} can provide an assistive interface. Many [[MEncoder#GUI frontends|GUI frontends]] are available.|http://www.mplayerhq.hu/|{{Pkg|mencoder}}}}
 +
* {{App|Transcode|Video/DVD ripper and encoder with the CLI.|http://transcoding.org/|{{Pkg|transcode}}}}
  
[[dvdbackup]] is used simply for data extraction, and does not transcode. This tool is useful for creating ''exact'' copies of encrypted DVDs in conjunction with {{Pkg|libdvdcss}} or for decrypting video for other utilities unable to read encrypted DVDs.
+
==== dvd::rip ====
  
=== dvd::rip ===
+
dvd::rip is a front-end to {{Pkg|transcode}}, used to extract DVD's to the hard disk and transcode or extract and transcode on-the-fly.
 
 
dvd::rip is a front-end to {{Pkg|transcode}}, used to extract and transcode on-the-fly.
 
  
 
The following packages should be installed:
 
The following packages should be installed:
* {{Pkg|dvdrip}}: GTK front-end for {{Pkg|transcode}}, which performs the ripping and encoding
+
* {{AUR|dvdrip}}: GTK front-end for {{Pkg|transcode}}, which performs the ripping and encoding
 
* {{Pkg|libdv}}: Software codec for DV video
 
* {{Pkg|libdv}}: Software codec for DV video
* {{Pkg|xvidcore}}: If you want to encode your ripped files as XviD, an open source MPEG-4 video codec (free alternative to DivX)
+
* {{Pkg|xvidcore}}: If you want to encode your ripped files as XviD, an open source MPEG-4 video codec (free alternative to DivX).
* {{AUR|divx4linux}}: If you want to encode your ripped files as DivX (available in the [[AUR]])
+
* {{AUR|subtitleripper}}: If you want to read and process subtitles.
 
 
 
The dvd::rip preferences are mostly well-documented/self-explanatory. If you need help with something, see http://www.exit1.org/dvdrip/doc/gui-gui_pref.cipp.
 
The dvd::rip preferences are mostly well-documented/self-explanatory. If you need help with something, see http://www.exit1.org/dvdrip/doc/gui-gui_pref.cipp.
  
 
Ripping a DVD is often a simple matter of selecting the preferred codec(s), selecting the desired titles, then clicking the "Rip" button.
 
Ripping a DVD is often a simple matter of selecting the preferred codec(s), selecting the desired titles, then clicking the "Rip" button.
  
=== FFmpeg ===
+
=== DVD-Audio ===
  
[[FFmpeg]] is capable to do a direct rip in any format (audio/video) from a DVD-Video .iso image, just select the input as the *.iso image and proceed with the desired options. It also allows to downmixing, shrinking, spliting, selecting streams among other features.
+
* {{App|Python Audio Tools|Includes dvda2track, which is easy to use command line tool to extract DVD-Audio tracks to uncompressed wav files.
 +
|http://audiotools.sourceforge.net/|{{AUR|audiotools-git}}}}
  
=== HandBrake ===
+
== Troubleshooting ==
  
HandBrake is a multithreaded video transcoder, which offers both a graphical and command-line interface with many preset configurations. The package is available in the [[official repositories]]: {{Pkg|handbrake}}.
+
=== Brasero fails to normalize audio CD ===
  
=== MEncoder ===
+
If you try to burn it may stop at the first step called Normalization.
  
[[MEncoder]] is a free command line video decoding, encoding and filtering tool released under the GNU General Public License. It is a close sibling to MPlayer and can convert all the formats that MPlayer understands into a variety of compressed and uncompressed formats using different codecs.  Wrapper programs like {{AUR|h264enc}} and {{AUR|undvd}} can provide an assistive interface.
+
As a workaround you can disable the normalization plugin using the ''Edit > Plugins'' menu
  
=== Hybrid ===
+
=== VLC: Error "... could not open the disc /dev/dvd" ===
  
Hybrid is a multi platform (Linux/Mac OS X/Windows) Qt based frontend for a bunch of other tools which can convert nearly every input to x264/Xvid/VP8 + ac3/ogg/mp3/aac/flac inside an mp4/m2ts/mkv/webm/mov/avi container, a Blu-ray or an AVCHD structure.
+
If you get an error like
  
A package is available in the [[AUR]]: {{AUR|hybrid-encoder}}.
+
vlc dvdread could not open the disc "/dev/dvd"
  
For detailed information visit the [http://www.selur.de/project homepage].
+
it may be because there is no device node {{ic|/dev/dvd}} on your system. Udev no longer creates {{ic|/dev/dvd}} and instead uses {{ic|/dev/sr0}}. To fix this, edit the VLC configuration file ({{ic|~/.config/vlc/vlcrc}}):
  
=== DVD-VR ===
+
# DVD device (string)
 +
dvd=/dev/sr0
  
From [[wikipedia:DVD-VR|Wikipedia - DVD-VR]]:
+
=== DVD drive is noisy ===
:''The DVD-VR standard defines a logical format for video recording on DVD-R, DVD-RW, and DVD-RAM style media, including the dual layer versions of these media. As opposed to media recorded with the DVD+VR recording standard, the resulting media are not DVD-Video compliant, and will not play back in some DVD-Video players. Most DVD video recorders in the market that support DVD-R, DVD-RW, or DVD-RAM media will allow recording to these media in DVD-VR mode, as well as in a DVD-Video compliant mode. It is possible to use the DVD-VR format with DVD+R and DVD+RW media, but no examples are known other than some PC based recording utilities.''
 
  
.VRO files extracted from a DVD-VR can be easily converted and splitted in regular .VOB files using the [http://www.pixelbeat.org/programs/dvd-vr/ DVD-VR] program.
+
If playing DVD videos causes the system to be very loud, it may be because the disk is spinning faster than it needs to. To temporarily change the speed of the drive, run:
  
Install {{AUR|dvd-vr}} from the [[AUR]].
+
# eject -x 12 /dev/dvd
  
== Troubleshooting ==
+
Sometimes:
  
=== K3b locale error ===
+
# hdparm -E12 /dev/dvd
  
When running K3B, if the following message appears:
+
Any speed that is supported by the drive can be used, or 0 for the maximum speed.
  
System locale charset is ANSI_X3.4-1968
+
[http://michal.kosmulski.org/computing/tips/cd-rom-speed.html Setting CD-ROM and DVD-ROM drive speed]
Your system's locale charset (i.e. the charset used to encode file names) is
 
set to ANSI_X3.4-1968. It is highly unlikely that this has been done intentionally.
 
Most likely the locale is not set at all. An invalid setting will result in
 
problems when creating data projects.Solution: To properly set the locale
 
charset make sure the LC_* environment variables are set. Normally the distribution
 
setup tools take care of this.
 
  
It means that your locale is not set well.
+
=== Playback does not work with new computer (new DVD-Drive) ===
  
To fix it,
+
If playback does not work and you have a new computer (new DVD-Drive) the reason might be that the [[Wikipedia:DVD region code|region code]] is not set. You can read and set the region code with the {{AUR|regionset}} package.
  
* Remove {{ic|/etc/locale.gen}}
+
=== None of the above programs are able to rip/encode a DVD to my hard disk! ===
* Re-install {{Pkg|glibc}}
 
* Edit {{ic|/etc/locale.gen}}, uncommenting all lines lines that corresponds to your language AND the {{ic|en_US}} options, for compatibility:
 
 
 
{{bc|
 
en_US.UTF-8 UTF-8
 
en_US ISO-8859-1
 
}}
 
* Re-generate the profiles with {{ic|locale-gen}}:
 
{{hc|# locale-gen|
 
Generating locales...
 
en_US.UTF-8... done
 
en_US.ISO-8859-1... done
 
pt_BR.UTF-8... done
 
pt_BR.ISO-8859-1... done
 
Generation complete.
 
}}
 
  
More info [https://bbs.archlinux.org/viewtopic.php?pid=251512%29; here].
+
Make sure the region of your DVD reader is set correctly; otherwise, you will get loads of inexplicable [[Wikipedia:Content Scramble System|CSS]]-related errors. Use the {{AUR|regionset}} package to do so.
  
=== Brasero fails to find blank discs ===
+
=== GUI program log indicates problems with backend program ===
  
Brasero uses {{Pkg|gvfs}} to manage CD/DVD burning devices.
+
If you use a GUI program and experience problems which the program's log blames on some backend program, then try to reproduce the problem by the logged backend program arguments.
 +
Whether you succeed with reproducing or not, you may report the logged lines and your own findings to the places mentioned in [[#Burn backend problems]] section.
  
=== Brasero fails to normalize audio CD ===
+
==== Special case: medium error / write error ====
  
If you try to burn it may stop at the first step called Normalization.
+
Here are some typical messages about the drive disliking the medium. This can only be solved by using a different drive or a different medium. A different program will hardly help.
  
As a workaround you can disable the normalization plugin using the ''Edit > Plugins'' menu
+
Brasero with backend growisofs:
 +
BraseroGrowisofs stderr: :-[ WRITE@LBA=0h failed with SK=3h/ASC=0Ch/ACQ=00h]: Input/output error
  
=== VLC: Error "... could not open the disc /dev/dvd" ===
+
Brasero with backend libburn:
 +
BraseroLibburn Libburn reported an error SCSI error on write(16976,16): [3 0C 00] Write error
  
If you get the error, "'''vlc dvdread could not open the disc "/dev/dvd"'''" it may be because there is no device node {{ic|/dev/dvd}} on your system.  Udev no longer creates {{ic|/dev/dvd}} and instead uses {{ic|/dev/sr0}}.  To fix this edit the VLC configuration file ({{ic|~/.config/vlc/vlcrc}}):
+
=== AHCI ===
  
{{bc|1=# DVD device (string)                                                         
+
If your new DVD drive is detected but you can't mount disks, check wether your BIOS uses [[AHCI]] and add the module to the kernel image.
dvd=/dev/sr0}}
 
  
===DVD drive is noisy===
+
Edit {{ic|/etc/mkinitcpio.conf}} and add {{ic|ahci}} to the {{ic|MODULES}} variable (see [[mkinitcpio]] for details):
 +
MODULES="ahci"
  
If playing DVD videos causes the system to be very loud, it may be because the disk is spinning faster than it needs to. To temporarily change the speed of the drive, as root, run:
+
Rebuild the kernel image so that it includes the newly added module:
 +
# mkinitcpio -p linux
  
# eject -x 12 /dev/dvd
+
=== BD-R DL 50GB errors on trying to burn second layer ===
  
sometimes:
+
Using ''growisofs'' from {{Pkg|dvd+rw-tools}} for burning 50GB BD-R DL discs might result in a fatal error and damaged media, such as:
  
  # hdparm -E12 /dev/dvd
+
{{hc|$ growisofs -Z /dev/sr0 -J -R -V "label" files|<nowiki>
 +
Executing 'mkisofs -J -R -V label files | builtin_dd of=/dev/sr0 obs=32k seek=0'
 +
I: -input-charset not specified, using utf-8 (detected in locale settings)
 +
  0.03% done, estimate finish Fri Jan 29 19:50:36 2016
 +
  0.05% done, estimate finish Fri Jan 29 19:50:36 2016
 +
  0.08% done, estimate finish Fri Jan 29 19:50:36 2016
 +
/dev/sr0: pre-formatting blank BD-R for 49.8GB...
 +
/dev/sr0: "Current Write Speed" is 8.2x4390KBps.
 +
  0.11% done, estimate finish Sat Jan 30 03:29:13 2016
 +
  0.13% done, estimate finish Sat Jan 30 02:10:01 2016
 +
...
 +
  63.20% done, estimate finish Fri Jan 29 20:43:45 2016
 +
:-[ WRITE@LBA=b6d820h failed with SK=3h/WRITE ERROR]: Input/output error
 +
:-( write failed: Input/output error
 +
/dev/sr0: flushing cache
 +
/dev/sr0: closing track
 +
/dev/sr0: closing session
 +
:-[ CLOSE SESSION failed with SK=5h/INVALID FIELD IN CDB]: Input/output error
 +
/dev/sr0: reloading tray
 +
</nowiki>}}
  
Any speed that is supported by the drive can be used, or 0 for the maximum speed.
+
This happened at the 25GB boundary when starting to write the second layer. Using ''cdrecord'' from {{Pkg|cdrtools}} works with no problems. Tested with a 'HL-DT-ST BD-RE  WH16NS40' LG burner, and Verbatim BD-R DL 6x discs (#96911). {{bug|47797}}
  
[http://hektor.umcs.lublin.pl/~mikosmul/computing/tips/cd-rom-speed.html Setting CD-ROM and DVD-ROM drive speed]
+
=== Disc tray autocloses ===
  
===Playback does not work with new computer (new DVD-Drive)===
+
If after ejecting a cd, either by using the {{ic|eject}} command, or pushing the drive button, the drive disc tray autocloses before being able to remove the disc, try the following command:
  
If playback does not work and you have a new computer (new DVD-Drive) the reason might be that the [[Wikipedia:DVD region code|region code]] is not set. You can read and set the region code with {{AUR|regionset}} from the [[Arch User Repository]].
+
# sysctl -w dev.cdrom.autoclose=0
  
=== None of the above programs are able to rip/encode a DVD to my hard disk! ===
+
If that solves the problem, make the change permanent:
  
Make sure the region of your DVD-reader is set correctly, otherwise you'll get loads of unexplainable CSS-related errors. Use {{AUR|regionset}} to do so.
+
{{hc|/etc/sysctl.d/60-cdrom-autoclose.conf|2=dev.cdrom.autoclose = 0}}
  
 
== See also ==
 
== See also ==
  
* RIAA and actual laws allow backup of physically obtained media under these conditions [https://www.riaa.com/physicalpiracy.php?content_selector=piracy_online_the_law RIAA - the law].
+
* In the United States, backup of physically obtained media is allowed under these conditions: [https://www.riaa.com/resources-learning/about-piracy/ About Piracy - RIAA].
 
* [[Convert any Movie to DVD Video]]
 
* [[Convert any Movie to DVD Video]]
 +
* [http://libburnia-project.org/ Main page of the project Libburnia]

Latest revision as of 13:39, 14 February 2018

From Wikipedia:

In computing, an optical disc drive (ODD) is a disk drive that uses laser light or electromagnetic waves within or near the visible light spectrum as part of the process of reading or writing data to or from optical discs. Some drives can only read from discs, but recent drives are commonly both readers and recorders, also called burners or writers. Compact discs, DVDs, and Blu-ray discs are common types of optical media which can be read and recorded by such drives. Optical drive is the generic name; drives are usually described as "CD" "DVD", or "Blu-ray", followed by "drive", "writer", etc.

Burning

Warning: The quality of optical drives and the discs themselves varies greatly. Generally, using a slow burn speed is recommended for reliable burns. If you are experiencing unexpected behaviour from the disc, try burning at the lowest speed supported by your burner.

The burning process of optical disc drives consists of creating or obtaining an image and writing it to an optical medium. The image may in principle be any data file. If you want to mount the resulting medium, then it is usually an ISO 9660 file system image file. Audio and multi-media CDs are often burned from a .bin file, under control of a .toc file or a .cue file which tell the desired track layout.

Install burning utilities

If you want to use programs with graphical user interface, then follow #Burning CD/DVD/BD with a GUI.

The programs listed here are command line oriented. They are the back ends which are used by most free GUI programs for CD, DVD, and BD. GUI users might get to them when it comes to troubleshooting or to scripting of burn activities.

You need at least one program for creation of file system images and one program that is able to burn data onto your desired media type.

Available programs for ISO 9660 image creation are:

The traditional choice is mkisofs.

Available programs for burning to media are:

The traditional choices are cdrecord for CD and growisofs for DVD and Blu-ray Disk. For writing TOC/CUE/BIN files to CD, install cdrdao.

The free GUI programs for CD, DVD, and BD burning depend on at least one of the above packages.

xorrisofs supports the mkisofs options which are shown in this document.

cdrskin supports the shown cdrecord options; xorrecord also supports those which do not deal with audio CD.

Making an ISO image from existing files on hard disk

The simplest way to create an ISO image is to first copy the needed files to one directory, for example: ./for_iso.

Then generate the image file with mkisofs:

$ mkisofs -V "ARCHIVE_2013_07_27" -J -r -o isoimage.iso ./for_iso

Each of those options are explained in the following sections.

Basic options

-V
Specifies the name (that is assigned to) of the file system. The ISO 9660 standard specs impose the limitations of 32-character string length, as well as limiting the characters allowed to sets of: "A" to "Z", "0" to "9", and "_". This volume label will probably show up as mount point if the medium is mounted automatically.
-J
Enables Joliet extension, which allocates special space to store file names in Unicode (up to 64 UTF-16 characters for each file).
-joliet-long
Increases maximum length of file names from 64 to 103 UTF-16 characters in Joliet table. Non-compliant to Joliet specs and not commonly supported.
-r
Enables Rock Ridge extension, which adds POSIX file system semantics to an image, including support of long 255-character filenames and Unix-style file permissions.
-o
Sets the file path for the resulting ISO image.

graft-points

It is also possible to let mkisofs to collect files and directories from various paths

$ mkisofs -V "BACKUP_2013_07_27" -J -r -o backup_2013_07_27.iso \
  -graft-points \
  /photos=/home/user/photos \
  /mail=/home/user/mail \
  /photos/holidays=/home/user/holidays/photos
-graft-points
Enables the recognition of pathspecs which consist of a target address in the ISO file system (e.g. /photos) and a source address on hard disk (e.g. /home/user/photos). Both are separated by a "=" character.

So this example puts the disk directory /home/user/photos, /home/user/mail and /home/user/holidays/photos, respectively in the ISO image as /photos, /mail and /photos/holidays.

Programs mkisofs and xorrisofs accept the same options. For secure backups, consider using xorrisofs with option --for_backup, which records eventual ACLs and stores an MD5 checksum for each data file.

See the manuals of the ISO 9660 programs for more info about their options:

Mounting an ISO image

You can mount an ISO image if you want to browse its files. To mount the ISO image, we can use:

# mount -t iso9660 -o ro,loop /path/to/file.iso /mount-point

Do not forget to unmount the image when your inspection of the image is done:

# umount /mount-point

See also Mounting images as user for mounting without root privileges.

Converting img/ccd to an ISO image

To convert an img/ccd image, you can use ccd2iso:

$ ccd2iso ~/image.img ~/image.iso

Learning the name of your optical drive

For the remainder of this section the name of your recording device is assumed to be /dev/sr0.

Check this by

$ cdrecord dev=/dev/sr0 -checkdrive

which should report Vendor_info and Identification fields of the drive.

If no drive is found, check whether any /dev/sr* exist and whether they offer read/write permission (wr-) to you or your group. If no /dev/sr* exists then try loading module sr_mod manually.

Reading the volume label of a CD or DVD

If you want to get the name/label of the media, use dd:

$ dd if=/dev/sr0 bs=1 skip=32808 count=32

Creating an ISO image from a CD, DVD, or BD

In order to only copy actual data from the disc and not the empty blocks filling it up, first retrieve its block/sector count and size (2048 most of the time):

$ isosize -x /dev/sr0
sector count: 2041796, sector size: 2048

or alternatively:

$ isoinfo -d -i /dev/sr0 | grep -i -E 'block size|volume size'
Logical block size is: 2048
Volume size is: 2041796
Note: Do not forget to replace /dev/sr0 with your optical drive device name.

Then use dd to copy the data using the obtained values:

$ dd if=/dev/sr0 of=discmage.iso bs=sector_size count=sector_count status=progress
Tip: If the medium is damaged, it is preferable to use a dedicated utility such as ddrescue. See Disk cloning#Using ddrescue.

If the original medium was bootable, then the copy will be a bootable image. You may use it as a pseudo CD for a virtual machine or burn it onto an optical media which should then become bootable. [1]

Erasing CD-RW and DVD-RW

Used CD-RW media need to be erased before you can write over the previously recorded data. This is done by

$ cdrecord -v dev=/dev/sr0 blank=fast

There are two options for blanking: blank=fast and blank=full. Full blanking lasts as long as a full write run. It overwrites the payload data on the CD. Nevertheless this should not be considered as securely making those data unreadable. For that purpose, several full write runs with random data are advised.

Alternative commands are:

$ cdrskin -v dev=/dev/sr0 blank=fast
$ xorriso -outdev /dev/sr0 -blank as_needed

To erase the DVD-RW use the dvd+rw-format utility from dvd+rw-tools:

$ dvd+rw-format -blank=fast /dev/sr0

Alternative commands are:

$ cdrecord -v dev=/dev/sr0 blank=fast
$ cdrskin -v dev=/dev/sr0 blank=deformat_sequential_quickest
$ xorriso -outdev /dev/sr0 -blank deformat_quickest

Such fastly blanked DVD-RW are not suitable for multi-session and cannot take input streams of unpredicted length. For that purpose one has to use one of:

$ cdrecord -v dev=/dev/sr0 blank=all
$ dvd+rw-format -blank=full /dev/sr0
$ cdrskin -v dev=/dev/sr0 blank=as_needed
$ xorriso -outdev /dev/sr0 -blank as_needed

The other media types are either write-once (CD-R, DVD-R, DVD+R, BD-R) or are overwritable without the need for erasing (DVD-RAM, DVD+RW, BD-RE).

Formatting DVD-RW

Formatted DVD-RW media can be overwritten without previous erasure. So consider to apply once in their life time

$ dvd+rw-format -force /dev/sr0
$ cdrskin -v dev=/dev/sr0 blank=format_if_needed
$ xorriso -outdev /dev/sr0 -format as_needed

Unlike DVD-RAM, DVD+RW, and BD-RE, formatted DVD-RW cannot be used as (slow) hard disk directly, but rather need the mediation of driver pktcdvd. See man pktsetup.

Formatting BD-RE and BD-R

BD-RE need formatting before first use. This is done automatically by the burn programs when they detect the unformatted state. Nevertheless the size of the payload area can be influenced by expert versions of the format commands shown above for DVD-RW.

BD-R can be used unformatted or formatted. Unformatted they are written with full nominal speed and offer maximum storage capacity. Formatted they get checkread during write operations and bad blocks get replaced by blocks from the Spare Area. This reduces write speed to a half or less of nominal speed. The default sized Spare Area reduces the storage capacity by 768 MiB.

growisofs formats BD-R by default. The others do not. growisofs can be kept from formatting. cdrskin and xorriso can write with full nominal speed on formatted BD-RE or BD-R:

 $ growisofs -use-the-force-luke=spare:none ...growisofs.or.mkisofs.options...
 $ cdrskin stream_recording=on ...cdrecord.options...
 $ xorriso -stream_recording on ...xorriso.commands...

Burning an ISO image to CD, DVD, or BD

To burn a readily prepared ISO image file isoimage.iso onto an optical medium, run for CD:

$ cdrecord -v -sao dev=/dev/sr0 isoimage.iso

and for DVD or BD:

$ growisofs -dvd-compat -Z /dev/sr0=isoimage.iso
Note:
  • Make sure that the medium is not mounted when you begin to write to it. Mounting may happen automatically if the medium contains a readable file system. In the best case, it will prevent the burn programs from using the burner device. In the worst case, there will be misburns because read operations disturbed the drive. So if in doubt, do:
    # umount /dev/sr0
  • growisofs has a small bug with blank BD-R media. It issues an error message after the burning is complete. Programs like k3b then believe the whole burn run failed. To prevent this, either
    • format the blank BD-R by dvd+rw-format /dev/sr0 before submitting it to growisofs
    • or use growisofs option -use-the-force-luke=spare:none

Verifying the burnt ISO image

You can verify the integrity of the burnt medium to make sure it contains no errors. Always eject the medium and reinsert it before verifying. It will guarantee that not any kernel cache will be used to read the data.

First calculate the MD5 checksum of the original ISO image:

$ md5sum isoimage.iso
 e5643e18e05f5646046bb2e4236986d8 isoimage.iso

Next calculate the MD5 checksum of the ISO file system on the medium. Although some media types deliver exactly the same amount of data as have been submitted to the burn program, many others append trailing garbage when being read. So you should restrict reading to the size of the ISO image file.

$ blocks=$(expr $(du -b isoimage.iso | awk '{print $1}') / 2048)
$ dd if=/dev/sr0 bs=2048 count=$blocks | md5sum
 43992+0 records in
 43992+0 records out
 90095616 bytes (90 MB) copied, 0.359539 s, 251 MB/s
 e5643e18e05f5646046bb2e4236986d8  -

Both runs should yield the same MD5 checksum (here: e5643e18e05f5646046bb2e4236986d8). If they do not, you will probably also get an I/O error message from the dd run. dmesg might then tell about SCSI errors and block numbers, if you are interested.

ISO 9660 and burning on-the-fly

It is not necessary to store an emerging ISO file system on hard disk before writing it to optical media. Only very old CD drives at very old computers could suffer failed burns due to empty drive buffer.

If you omit option -o from mkisofs then it writes the ISO image to standard output. This can be piped into the standard input of burn programs.

$ mkisofs -V "ARCHIVE_2013_07_27" -J -r ./for_iso | \
  cdrecord -v dev=/dev/sr0 -waiti -

Option -waiti is not really needed here. It prevents cdrecord from writing to the medium before mkisofs starts its output. This would allow mkisofs to read the medium without disturbing an already started burn run. See next section about multi-session.

On DVD and BD, you may let growisofs operate mkisofs for you and burn its output on-the-fly

$ growisofs -Z /dev/sr0 -V "ARCHIVE_2013_07_27" -r -J ./for_iso

Multi-session

ISO 9660 multi-session means that a medium with readable file system is still writable at its first unused block address, and that a new ISO directory tree gets written to this unused part. The new tree is accompanied by the content blocks of newly added or overwritten data files. The blocks of data files, which shall stay as in the old ISO tree, will not be written again.

Linux and many other operating systems will mount the directory tree in the last session on the medium. This youngest tree will normally show the files of the older sessions, too.

Multi-session by cdrecord

CD-R and CD-RW stay writable (aka "appendable") if cdrecord option -multi was used

$ cdrecord -v -multi dev=/dev/sr0 isoimage.iso

Then the medium can be inquired for the parameters of the next session

$ m=$(cdrecord dev=/dev/sr0 -msinfo)

By help of these parameters and of the readable medium in the drive you can produce the add-on ISO session

$ mkisofs -M /dev/sr0 -C "$m" \
   -V "ARCHIVE_2013_07_28" -J -r -o session2.iso ./more_for_iso

Finally append the session to the medium and keep it appendable again

$ cdrecord -v -multi dev=/dev/sr0 session2.iso

Programs cdrskin and xorrecord do this too with DVD-R, DVD+R, BD-R and unformatted DVD-RW. Program cdrecord does multi-session with at least DVD-R and DVD-RW. They all do with CD-R and CD-RW, of course.

Most re-usable media types do not record a session history that would be recognizable for a mounting kernel. But with ISO 9660 it is possible to achieve the multi-session effect even on those media.

growisofs and xorriso can do this and hide most of the complexity.

Multi-session by growisofs

By default, growisofs uses mkisofs as a backend for creating ISO images forwards most of its program arguments to . See above examples of mkisofs. It bans option -o and deprecates option -C. By default it uses the mkisofs. You may specify to use one of the others compatible backend program by setting environment variable MKISOFS:

$ export MKISOFS="xorrisofs"

The wish to begin with a new ISO file system on the optical medium is expressed by option -Z

$ growisofs -Z /dev/sr0 -V "ARCHIVE_2013_07_27" -r -J ./for_iso

The wish to append more files as new session to an existing ISO file system is expressed by option -M

$ growisofs -M /dev/sr0 -V "ARCHIVE_2013_07_28" -r -J ./more_for_iso

For details see the growisofs(1) manual and the manuals of mkisofs and xorrisofs.

Multi-session by xorriso

xorriso learns the wish to begin with a new ISO file system from the blank state of the medium. So it is appropriate to blank it if it contains data. The command -blank as_needed applies to all kinds of re-usable media and even to ISO images in data files on hard disk. It does not cause error if applied to a blank write-once medium.

$ xorriso -outdev /dev/sr0 -blank as_needed \
          -volid "ARCHIVE_2013_07_27" -joliet on -add ./for_iso --

On non-blank writable media xorriso appends the newly given disk files if command -dev is used rather than -outdev. Of course, no command -blank should be given here

$ xorriso -dev /dev/sr0 \
          -volid "ARCHIVE_2013_07_28" -joliet on -add ./more_for_iso --

For details see the manual page and especially its examples

BD Defect Management

BD-RE and formatted BD-R media are normally written with enabled Defect Management. This feature reads the written blocks while they are still stored in the drive buffer. In case of poor read quality the blocks get written again or redirected to the Spare Area where the data get stored in replacement blocks.

This checkreading reduces write speed to at most half of the nominal speed of drive and BD medium. Sometimes it is even worse. Heavy use of the Spare Area causes long delays during read operations. So Defect Management is not always desirable.

cdrecord does not format BD-R. It has no means to prevent Defect Management on BD-RE media, though.

growisofs formats BD-R by default. The Defect Management can be prevented by option -use-the-force-luke=spare:none. It has no means to prevent Defect Management on BD-RE media, though.

cdrskin, xorriso and xorrecord do not format BD-R by default. They do with cdrskin blank=format_if_needed, resp. xorriso -format as_needed, resp. xorrecord blank=format_overwrite. These three programs can disable Defect Management with BD-RE and already formatted BD-R by cdrskin stream_recording=on, resp. xorriso -stream_recording on, resp. xorrecord stream_recording=on.

Burning an audio CD

Create your audio tracks and store them as uncompressed, 16-bit, stereo WAV files. To convert MP3 to WAV, ensure lame is installed, cd to the directory with your MP3 files, and run:

$ for i in *.mp3; do lame --decode "$i" "$(basename "$i" .mp3)".wav; done

In case you get an error when trying to burn WAV files converted with LAME, try decoding with mpg123:

$ for i in *.mp3; do mpg123 --rate 44100 --stereo --buffer 3072 --resync -w $(basename $i .mp3).wav $i; done

To convert AAC to WAV ensure faad2 is installed and run:

$ for i in *.m4a; do faad $i; done

Name the audio files in a manner that will cause them to be listed in the desired track order when listed alphabetically, such as 01.wav, 02.wav, 03.wav, etc. Use the following command to simulate burning the WAV files as an audio CD:

$ cdrecord -dummy -v -pad speed=1 dev=/dev/sr0 -dao -swab *.wav

If everything worked, you can remove the dummy flag to actually burn the CD.

To test the new audio CD, use MPlayer:

$ mplayer cdda://

Burning a BIN/CUE

To burn a BIN/CUE image run:

$ cdrdao write --device /dev/sr0 image.cue

TOC/CUE/BIN for mixed-mode disks

ISO images only store a single data track. If you want to create an image of a mixed-mode disk (data track with multiple audio tracks) then you need to make a TOC/BIN pair:

$ cdrdao read-cd --read-raw --datafile image.bin --driver generic-mmc:0x20000 --device /dev/cdrom image.toc

Some software only likes CUE/BIN pair, you can make a CUE sheet with toc2cue (part of cdrdao):

$ toc2cue image.toc image.cue

Burn backend problems

If you're experiencing problems, you may ask for advise at mailing list cdwrite@other.debian.org, or try to write to the one of support mail addresses if some are listed near the end of the program's man page.

Tell the command lines you tried, the medium type (e.g. CD-R, DVD+RW, ...), and the symptoms of failure (program messages, disappointed user expectation, ...). You will possibly get asked to obtain the newest release or development version of the affected program and to make test runs. But the answer might as well be, that your drive dislikes the particular medium.

Burning CD/DVD/BD with a GUI

There are several applications available to burn CDs in a graphical environment.

See also Wikipedia:Comparison of disc authoring software.

  • AcetoneISO — All-in-one ISO tool (supports BIN, MDF, NRG, IMG, DAA, DMG, CDI, B5I, BWI, PDI and ISO).
http://sourceforge.net/projects/acetoneiso || acetoneiso2
  • BashBurn — Lightweight terminal based menu frontend for CD/DVD burning tools.
http://bashburn.dose.se/ || bashburn
  • Brasero — Disc burning application for the GNOME desktop that is designed to be as simple as possible. Part of gnome-extra.
https://wiki.gnome.org/Apps/Brasero || brasero
  • cdw — Ncurses frontend to cdrecord, mkisofs, growisofs, dvd+rw-mediainfo, dvd+rw-format and xorriso.
http://cdw.sourceforge.net/ || cdwAUR
  • GnomeBaker — Full featured CD/DVD burning application for the GNOME desktop.
http://gnomebaker.sourceforge.net/ || gnomebakerAUR
  • Graveman — GTK-based CD/DVD burning application. It requires configuration to point to correct devices.
http://graveman.tuxfamily.org/ || gravemanAUR
http://littlesvr.ca/isomaster || isomasterAUR
  • K3b — Feature-rich and easy to handle CD burning and ripping application based on KDElibs.
http://www.k3b.org/ || k3b
  • X-CD-Roast — Lightweight cdrtools front-end for CD and DVD writing.
http://www.xcdroast.org/ || xcdroastAUR
  • Xfburn — Simple front-end to the libburnia libraries with support for CD/DVD(-RW), ISO images, and BurnFree.
http://goodies.xfce.org/projects/applications/xfburn || xfburn
  • xorriso-tcltk — Graphical front-end to ISO and CD/DVD/BD burn tool xorriso
https://www.gnu.org/software/xorriso/xorriso-tcltk-screen.gif || libisoburn

Playback

CD

Playback of audio CDs requires the libcdio package.

DVD

If you wish to play encrypted DVDs, you must install the libdvd* packages:

Additionally, you must install player software. Popular DVD players are MPlayer, xine and VLC. See the video players list and the specific instructions for MPlayer.

Ripping

Ripping is the process of copying audio or video content to a hard disk, typically from removable media or media streams.

CD

  • Abcde — Comprehensive command-line tool for ripping audio CDs.
https://abcde.einval.com/ || abcde
  • Asunder — GTK+-based CD ripping program.
http://littlesvr.ca/asunder/ || asunder
  • cdparanoia — Compact Disc Digital Audio (CDDA) Digital Audio Extraction (DAE) tool.
https://xiph.org/paranoia/index.html || cdparanoia
  • Goobox — CD player and ripper for GNOME.
https://people.gnome.org/~paobac/goobox/ || goobox
  • Grip — Fast and light CD ripper within the GNOME project that resembles Audiograbber.
https://sourceforge.net/projects/grip/ || gripAUR.
  • K3b — Feature-rich and easy to handle CD/DVD burning and ripping application based on KDElibs.
http://www.k3b.org/ || k3b
  • ripperX — GTK+ program to rip CD audio tracks and encode them to the Ogg, MP3, or FLAC formats.
https://sourceforge.net/projects/ripperx/ || ripperxAUR
  • ripright — Minimal CD ripper modeled on autorip.
http://www.mcternan.me.uk/ripright/ || riprightAUR
  • ripit — Command-line ripper that supports MusicBrainz, freeddb and various codecs.
http://www.suwald.com/ripit/news.php || ripitAUR
  • rubyripper — Audiodisk ripper that tries to deliver a secure rip through multiple rippings of the same track and corrections of any differences.
https://code.google.com/archive/p/rubyripper/ || rubyripperAUR
  • shnsplit — Splits .wav and .flac files according to a CUE sheet and encodes the resulting pieces. A useful companion to ABCDE.
http://www.etree.org/shnutils/shntool/ || shntool
https://wiki.gnome.org/Apps/SoundJuicer || sound-juicer
  • soundKonverter — Front-end to various audio converters.
https://www.linux-apps.com/content/show.php?content=29024 || soundkonverter
  • whipper — CD ripper aiming for accuracy over speed. Uses cdparanoia, MusicBrainz, AccurateRip.
https://github.com/JoeLametta/whipper || whipper

DVD-Video

Often, the process of ripping a DVD can be broken down into two subtasks:

  1. Data extraction — Copying the audio and/or video data to a hard disk,
  2. Transcoding — Converting the extracted data into a suitable format.

Some utilities perform both tasks, whilst others focus on one aspect or the other:

  • Avidemux — Multithreaded video transcoder, which offers both a graphical and command-line interface with many preset configurations. Influenced by Handbrake.
http://fixounet.free.fr/avidemux/ || avidemux-qt-gitAUR
  • dvdbackup — Tool for pure data extraction which does not transcode. It is useful for creating exact copies of encrypted DVDs in conjunction with libdvdcss or for decrypting video for other utilities unable to read encrypted DVDs.
http://dvdbackup.sourceforge.net/ || dvdbackup
  • FFmpeg — Complete and free Internet live audio and video broadcasting solution for Linux/Unix, capable to do a direct rip in any format (audio/video) from a DVD-Video ISO image, just select the input as the ISO image and proceed with the desired options. It also allows to downmixing, shrinking, spliting, selecting streams among other features.
http://ffmpeg.org/ || See article
  • HandBrake — Multithreaded video transcoder, which offers both a graphical and command-line interface with many preset configurations.
https://handbrake.fr/ || handbrake
  • Hybrid — Multi platform Qt based frontend for a bunch of other tools which can convert nearly every input to x264/Xvid/VP8 + ac3/ogg/mp3/aac/flac inside an mp4/m2ts/mkv/webm/mov/avi container, a Blu-ray or an AVCHD structure.
http://www.selur.de/ || hybrid-encoderAUR
  • MEncoder — Free command line video decoding, encoding and filtering tool released under the GNU GPL. It is a close sibling to MPlayer and can convert all the formats that MPlayer understands into a variety of compressed and uncompressed formats using different codecs. Wrapper programs like h264encAUR can provide an assistive interface. Many GUI frontends are available.
http://www.mplayerhq.hu/ || mencoder
  • Transcode — Video/DVD ripper and encoder with the CLI.
http://transcoding.org/ || transcode

dvd::rip

dvd::rip is a front-end to transcode, used to extract DVD's to the hard disk and transcode or extract and transcode on-the-fly.

The following packages should be installed:

  • dvdripAUR: GTK front-end for transcode, which performs the ripping and encoding
  • libdv: Software codec for DV video
  • xvidcore: If you want to encode your ripped files as XviD, an open source MPEG-4 video codec (free alternative to DivX).
  • subtitleripperAUR: If you want to read and process subtitles.

The dvd::rip preferences are mostly well-documented/self-explanatory. If you need help with something, see http://www.exit1.org/dvdrip/doc/gui-gui_pref.cipp.

Ripping a DVD is often a simple matter of selecting the preferred codec(s), selecting the desired titles, then clicking the "Rip" button.

DVD-Audio

  • Python Audio Tools — Includes dvda2track, which is easy to use command line tool to extract DVD-Audio tracks to uncompressed wav files.
http://audiotools.sourceforge.net/ || audiotools-gitAUR

Troubleshooting

Brasero fails to normalize audio CD

If you try to burn it may stop at the first step called Normalization.

As a workaround you can disable the normalization plugin using the Edit > Plugins menu

VLC: Error "... could not open the disc /dev/dvd"

If you get an error like

vlc dvdread could not open the disc "/dev/dvd"

it may be because there is no device node /dev/dvd on your system. Udev no longer creates /dev/dvd and instead uses /dev/sr0. To fix this, edit the VLC configuration file (~/.config/vlc/vlcrc):

# DVD device (string)
dvd=/dev/sr0

DVD drive is noisy

If playing DVD videos causes the system to be very loud, it may be because the disk is spinning faster than it needs to. To temporarily change the speed of the drive, run:

# eject -x 12 /dev/dvd

Sometimes:

# hdparm -E12 /dev/dvd

Any speed that is supported by the drive can be used, or 0 for the maximum speed.

Setting CD-ROM and DVD-ROM drive speed

Playback does not work with new computer (new DVD-Drive)

If playback does not work and you have a new computer (new DVD-Drive) the reason might be that the region code is not set. You can read and set the region code with the regionsetAUR package.

None of the above programs are able to rip/encode a DVD to my hard disk!

Make sure the region of your DVD reader is set correctly; otherwise, you will get loads of inexplicable CSS-related errors. Use the regionsetAUR package to do so.

GUI program log indicates problems with backend program

If you use a GUI program and experience problems which the program's log blames on some backend program, then try to reproduce the problem by the logged backend program arguments. Whether you succeed with reproducing or not, you may report the logged lines and your own findings to the places mentioned in #Burn backend problems section.

Special case: medium error / write error

Here are some typical messages about the drive disliking the medium. This can only be solved by using a different drive or a different medium. A different program will hardly help.

Brasero with backend growisofs:

BraseroGrowisofs stderr: :-[ WRITE@LBA=0h failed with SK=3h/ASC=0Ch/ACQ=00h]: Input/output error

Brasero with backend libburn:

BraseroLibburn Libburn reported an error SCSI error on write(16976,16): [3 0C 00] Write error

AHCI

If your new DVD drive is detected but you can't mount disks, check wether your BIOS uses AHCI and add the module to the kernel image.

Edit /etc/mkinitcpio.conf and add ahci to the MODULES variable (see mkinitcpio for details):

MODULES="ahci"

Rebuild the kernel image so that it includes the newly added module:

# mkinitcpio -p linux

BD-R DL 50GB errors on trying to burn second layer

Using growisofs from dvd+rw-tools for burning 50GB BD-R DL discs might result in a fatal error and damaged media, such as:

$ growisofs -Z /dev/sr0 -J -R -V "label" files
Executing 'mkisofs -J -R -V label files | builtin_dd of=/dev/sr0 obs=32k seek=0'
I: -input-charset not specified, using utf-8 (detected in locale settings)
  0.03% done, estimate finish Fri Jan 29 19:50:36 2016
  0.05% done, estimate finish Fri Jan 29 19:50:36 2016
  0.08% done, estimate finish Fri Jan 29 19:50:36 2016
/dev/sr0: pre-formatting blank BD-R for 49.8GB...
/dev/sr0: "Current Write Speed" is 8.2x4390KBps.
  0.11% done, estimate finish Sat Jan 30 03:29:13 2016
  0.13% done, estimate finish Sat Jan 30 02:10:01 2016
...
 63.20% done, estimate finish Fri Jan 29 20:43:45 2016
:-[ WRITE@LBA=b6d820h failed with SK=3h/WRITE ERROR]: Input/output error
:-( write failed: Input/output error
/dev/sr0: flushing cache
/dev/sr0: closing track
/dev/sr0: closing session
:-[ CLOSE SESSION failed with SK=5h/INVALID FIELD IN CDB]: Input/output error
/dev/sr0: reloading tray

This happened at the 25GB boundary when starting to write the second layer. Using cdrecord from cdrtools works with no problems. Tested with a 'HL-DT-ST BD-RE WH16NS40' LG burner, and Verbatim BD-R DL 6x discs (#96911). FS#47797

Disc tray autocloses

If after ejecting a cd, either by using the eject command, or pushing the drive button, the drive disc tray autocloses before being able to remove the disc, try the following command:

# sysctl -w dev.cdrom.autoclose=0

If that solves the problem, make the change permanent:

/etc/sysctl.d/60-cdrom-autoclose.conf
dev.cdrom.autoclose = 0

See also