32

I created 2 virtual machines with VMware Workstation 7. They have identical hardwares. One guest is CentOS 5.6, another is Mandriva 2011. When I try to mount the cdrom in guest OS, in CentOS, I should execute

mount /dev/hdc /path/to/mount

in Mandriva, I should execute

mount /dev/sr0 /path/to/mount

I also remebered in some other Linux variant, I had to use

mount /dev/cdrom /path/to/mount

My questions are:

  1. What's the difference between hdc, sr0 or cdrom?
  2. Is there a consistent way to mount cdrom in all Linux variants?
Landy
  • 903

3 Answers3

32
/dev/hdc

is the third IDE hard drive - Secondary Master.

/dev/sr0

is the first SCSI CD-ROM device in the system. This may be misleading as SCSI and SATA are interchangeable in Linux terminology. There is also SCSI emulation of ATAPI devices in some Unix systems (in FreeBSD it's called ATAPICAM) which makes ATAPI CD-ROM devices appear to be SCSI. Some older software is written purely to interface with SCSI peripherals and can't work with ATAPI ones, so this emulation layer can be quite useful.

/dev/cdrom

And yes, that is a symlink to one of the above - either done manually with ln or through the udev configuration.

Majenko
  • 32,964
9

/dev/hdc is a device on the ide controller.

/dev/sr0 is a device on the scsi controller.

/dev/cdrom is a symlink to either /dev/sr0 or /dev/hdc or whichever block device is appropriate. Most distributions come with a script that automatically sets up /dev/cdrom to be the correct device. So you're generally safe using /dev/cdrom. If you don't have /dev/cdrom you can always set it up yourself with ln -s

OmnipotentEntity
  • 1,632
  • 17
  • 23
3

The /dev/hdc is the older name for IDE CDROM (usually configured in hardware as the third IDE device). Old kernels and user space that use the IDE driver will show it as that. Newer kernels and userspace tools use libata, and map everything to scsi-like devices. So /dev/sr0 is now the first scsi-rom (zero). /dev/cdrom is usually a symlink to the first CD-ROM device.

Keith
  • 8,293