Why are my DVD and Bluray drives called /dev/srX? What does sr stand for?
When I first started using Ubuntu, I think my CD drives were mapped through /dev/cdrom0
and /dev/cdrom1
, etc. but looking at things today, you can see they now come through on a sr
prefix:
$ ll /dev/{cdrom,sr*}
lrwxrwxrwx 1 root root 3 Feb 10 09:15 /dev/cdrom -> sr0
brw-rw----+ 1 root cdrom 11, 0 Feb 10 09:15 /dev/sr0
brw-rw----+ 1 root cdrom 11, 1 Mar 27 10:30 /dev/sr1
I'm just curious what this stands for. TLDP isn't being very helpful here; and it still lists sd
as "SCSI drive", and I think it more commonly means "serial drive" these days.
What does "sr" stand for? Why does /dev/cdrom
still exist?
Solution 1:
Linux SCSI Disk support module = sd_mod
Linux SCSI Tape support module = st
Linux SCSI CDrom support module = sr_mod
Linux SCSI generic support module = sg
So, most likely, that stands for SCSI CDrom
Source
I've noticed that this doesn't fully address the question.
As you can see, /dev/cdrom
is just a symbolic link to /dev/sr0
, which is the actual device.
The naming of a character device is dependant on the module which initializes it: SCSI
CD-ROMS are handled by the sr_mod
module, and they're named after the module itself (srX
).
If your CD-ROM drive happened to be an IDE
drive, the actual device's name would have been /dev/hdX
.
So since there are multiple interfaces through which a CD-ROM drive could be attached to the system, /dev/cdrom
is used to always point to the first CD-ROM device (SCSI
, IDE
or whatever), most likely to give the drive an unique common interface for whatever needs to use it in the system.
CDROM device names are not maintained by the uniform CDROM layer but rather by each individual protocol stack. In the case of the SCSI subsystem, device names are maintained by the sr driver while the IDE subsystem maintains device names with its central "ide" driver (i.e. not by the ide-cd driver). USB and IEEE1394 cd devices names are maintained by their respective stacks. This may partially explain why the /dev/cdrom is often a symbolic link to the appropriate subsystem's device name.
Source
Solution 2:
Reading this, the letter r
appears to derive from ROM. No further source is given however.