Monday, April 27, 2009

Getting CD-ROM info in linux

I wanted to burn a DVD( Ubuntu :D) but my machine does not have DVD RW. I thought one of the server might have it, so I needed to check them. The problem is all servers are without X, so I needed some command to get that info. After Googling a bit I found some useful files.

/proc/sys/dev/cdrom/autoclose
/proc/sys/dev/cdrom/autoeject
/proc/sys/dev/cdrom/check_media
/proc/sys/dev/cdrom/debug
/proc/sys/dev/cdrom/info
/proc/sys/dev/cdrom/lock

All the files are readable by all and produce ASCII output when read. They reflect the current state of the CDROM subsystem. This location is part of the procfs's window through to the sysctl configuration mechanism (see man sysctl). All but info are writable by the superuser. There is a column for each CDROM and DVD player in the system in info (not just SCSI devices).

As an example, the auto eject feature can be turned on by the superuser with the command echo "1" > /proc/sys/dev/cdrom/autoeject. This will cause cdroms to be ejected from the drive when unmounted.

No comments:

Post a Comment