Wodim can't open SCSI driver in Debian Jessie?

I'm attempting to write an ISO image to a CD on Debian Jessie. I have the CD in the drive, and it appears that all of the symbolic links are pointing where they should be, and the kernel recognized my CD-RW drive. (Which is connected via IDE by the way)

I installed Wodim from the official Debian repository. With either wodim --devices or wodim -scanbus I receive...

wodim: No such file or directory. 
Cannot open SCSI driver!
For possible targets try 'wodim --devices' or 'wodim -scanbus'.
For possible transport specifiers try 'wodim dev=help'.
For IDE/ATAPI devices configuration, see the file README.ATAPI.setup from
the wodim documentation.

Although I don't think it should make a difference, I'm doing this via remote SSH.

The error says specifically that I need to read README.ATAPI.setup. I would be more than happy to do that if I had any idea where that was. I did a Google search for that file, but only found questions on various forums about issues similar to mine. After finding this question I ran some test commands to see if I had the same problem.

lsmod | grep sr_mod yields...

sr_mod                 21568  0 
cdrom                  46828  1 sr_mod
scsi_mod              164132  4 sg,libata,sd_mod,sr_mod

lsmod | grep sg yields...

sg                     25573  0 
scsi_mod              164132  4 sg,libata,sd_mod,sr_mod

ls -l /dev/sr0 yields...

brw-rw---- 1 root cdrom 11, 0 Mar 12 17:20 /dev/sr0

That article mentioned that /dev/cdrom should link to /dev/sr0. Results of ls -l /dev/cdrom are...

lrwxrwxrwx 1 root root 3 Mar 12 17:20 /dev/cdrom -> sr0

Running any of these commands as root with sudo, or with a root shell do not affect the outcomes of any of these commands. Furthermore telling Wodim what device to use with wodim dev=/dev/sr0 --scanbus yields the same results as not declaring the shell variable.

What's the issue?


That error message produced by wodim usually means that you have a disc in your CD-RW drive and the disc is mounted. Unmount the disc and try running wodim -scanbus again. Wodim displays "No such file or directory" for the following reason. Wodim's -scanbus option works by opening every file that could possibly point to a CD/DVD writer and querying each device to determine if any of the devices are CD/DVD writers. Now, the way wodim works, if it finds no devices, it fails, displaying the error message corresponding to the last error it encountered. On my system, the last device wodim encounters is /dev/scd255, which probably does not exist on your system, so wodim displays the error message corresponding to the last error it encountered, which is "No such file or directory". If you want to see all the error messages as wodim checks every device, you can execute strace wodim -scanbus. On my system with a mounted disc in the drive, it produces:

[many irrelevant and repetitive lines of output deleted]
        ︙
open("/dev/hdy", O_RDWR|O_EXCL|O_NONBLOCK|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/dev/hdz", O_RDWR|O_EXCL|O_NONBLOCK|O_LARGEFILE) = -1 ENOENT (No such file or directory)
uname({sys="Linux", node="ubuntu", ...}) = 0
open("/dev/scd0", O_RDWR|O_EXCL|O_NONBLOCK|O_LARGEFILE) = -1 EBUSY (Device or resource busy)
nanosleep({0, 399999000}, NULL)         = 0
open("/dev/scd0", O_RDWR|O_EXCL|O_NONBLOCK|O_LARGEFILE) = -1 EBUSY (Device or resource busy)
nanosleep({0, 399999000}, NULL)         = 0
open("/dev/scd0", O_RDWR|O_EXCL|O_NONBLOCK|O_LARGEFILE) = -1 EBUSY (Device or resource busy)
nanosleep({0, 399999000}, NULL)         = 0
open("/dev/scd0", O_RDWR|O_EXCL|O_NONBLOCK|O_LARGEFILE) = -1 EBUSY (Device or resource busy)
nanosleep({0, 400000000}, NULL)         = 0
open("/dev/scd0", O_RDWR|O_EXCL|O_NONBLOCK|O_LARGEFILE) = -1 EBUSY (Device or resource busy)
nanosleep({0, 400000000}, NULL)         = 0
open("/dev/scd0", O_RDWR|O_EXCL|O_NONBLOCK|O_LARGEFILE) = -1 EBUSY (Device or resource busy)
open("/dev/scd1", O_RDWR|O_EXCL|O_NONBLOCK|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/dev/scd2", O_RDWR|O_EXCL|O_NONBLOCK|O_LARGEFILE) = -1 ENOENT (No such file or directory)
        ︙
[many more irrelevant and repetitive lines of output deleted]

As you will see in the above output, wodim detects a optical drive, but cannot open it exclusively for itself. By the way, on my system, /dev/scd0 is a symbolic link to /dev/sr0:

$ ls -l /dev/scd0
lrwxrwxrwx 1 root root 3 2019-04-03 11:13 /dev/scd0 -> sr0

As for that file called README.ATAPI.setup, on Debian and its derivatives, the file is located in the directory /usr/share/doc/wodim, and it can be found online here and possibly other places.  Its contents are out of date, and some of the information is misleading. For example, the document states:

If you have just one CD writer in your computer, CD-writing should work out of the box.  There should be a symbolic link /dev/cdrw which points to your actual CD-Writer's device (e.g., /dev/hdb).  If the link is not present (e.g.,  the system is not using udev/devfs) or if you want to use a different device as default, you can configure the device in /etc/wodim.conf:

CDR_DEVICE=/dev/hdd

would configure the default device to be /dev/hdd, i.e., the slave device on the secondary IDE bus.

The advice on using /dev/hdb or /dev/hdd does not apply anymore, since the Linux kernel now uses "IDE-SCSI" emulation to make IDE / PATA devices appear as SCSI devices. Thus, you can read the document, but wherever there is a /dev/hd*, replace it with a /dev/sr0.


I had to append dev=/dev/cdrom to the list of arguments to overcome this error .
That worked out with both cdrecord and wodim .