LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Find location of CD/DVD drive mount point. (https://www.linuxquestions.org/questions/linux-newbie-8/find-location-of-cd-dvd-drive-mount-point-4175599076/)

swamprat 02-06-2017 12:48 AM

Find location of CD/DVD drive mount point.
 
Greetings,

I'm running CentOS 7.2 KDE and when I put a CD or DVD in the drive which I think is SR0 it shows up when I execute the Dolphine file manager I can see the contents of the media in the drive.

However when I use a terminal session I have no idea where to look or what type of terminal commands to execute to see such media contents within the terminal session.

The drive appears to already to be mounted when I boot up the system that's why I believe I can see the media contents.

This machine has two CD/DVD drive and I've tried to use the mount command to get the second drive mounted. There has to be a 100 mount commands and no matter how I've tried I can't mount the second drive nor can I see the contents of the second drive in a terminal session.

I do see some directories such as /mnt/cdrom but when I look at this cdrom directory there is nothing there. Also there is a directory with SR0 in it but I have no idea what it does.

Any help here would be greatly appreciated.

Thanks

pan64 02-06-2017 05:57 AM

probably mount | grep -i sr0 or mount | grep -i cd will help you to find it

swamprat 02-06-2017 10:18 AM

Thanks for your quick reply.

The first command you listed gave me the information below. The second command didn't work.

I put a cd in the drive then booted the virtual machine up and there was an icon in the task bar for the cdrom. I clicked on it and Dolphin came up with the following presented FD-SETUP. You can see all the files on the cd/dvd.

Being a newbie I guess thee cd device is mounted during the boot process so like windows it's there all the time and you can use it whenever.

root@localhost FD-SETUP]# pwd
/run/media/rifkinho/FD-SETUP
[root@localhost FD-SETUP]# ls -la
total 88
dr-xr-xr-x. 13 rifkinho rifkinho 2048 Dec 20 09:03 .
drwxr-x---+ 3 root root 60 Feb 6 10:35 ..
dr-xr-xr-x. 2 rifkinho rifkinho 4096 Dec 20 08:59 ARCHIVER
dr-xr-xr-x. 2 rifkinho rifkinho 8192 Dec 20 10:25 BASE
dr-xr-xr-x. 2 rifkinho rifkinho 2048 Dec 20 09:00 BOOT
dr-xr-xr-x. 2 rifkinho rifkinho 6144 Dec 20 08:59 DEVEL
dr-xr-xr-x. 2 rifkinho rifkinho 2048 Dec 20 08:59 EDIT
dr-xr-xr-x. 2 rifkinho rifkinho 6144 Dec 20 08:59 GAMES
dr-xr-xr-x. 2 rifkinho rifkinho 2048 Dec 20 09:02 ISOLINUX
dr-xr-xr-x. 2 rifkinho rifkinho 4096 Dec 20 08:59 NET
dr-xr-xr-x. 2 rifkinho rifkinho 36864 Dec 20 10:28 PKGINFO
dr-xr-xr-x. 2 rifkinho rifkinho 2048 Dec 20 08:59 SOUND
dr-xr-xr-x. 2 rifkinho rifkinho 14336 Dec 20 10:29 UTIL
[root@localhost FD-SETUP]# pwd
/run/media/rifkinho/FD-SETUP


[root@localhost FD-SETUP]# mount | grep -i sr0
/dev/sr0 on /run/media/rifkinho/FD-SETUP type iso9660 (ro,nosuid,nodev,relatime,uid=1000,gid=1000,iocharset=utf8,mode=0400,dmode=0500,uhelper=udisks2

The run directory has a whole lot of stuff in there but I don't know what that's all about nor why the cd got mounted in this place.

I still can't figure out how to use the mount command because there must be over 100 options etc.

Would you be good enough to list a normal mount command. BTW, there are no cd/dvd device in the FSTAB file as listed below:

# /etc/fstab
# Created by anaconda on Fri Aug 26 07:08:25 2016
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=bee17c45-7b4f-4047-8427-8d6cf2ffe1f3 / xfs defaults 0 0
UUID=db3588a3-4060-4e12-839b-ae009de4debf /boot xfs defaults 0 0
UUID=3c10044e-00c3-4b7c-860f-0f04ba51dc27 swap swap defaults 0 0
[root@localhost /]#

Thank you again.

suicidaleggroll 02-06-2017 10:24 AM

If the CD drive isn't mounted yet, mounting it is as easy as:
Code:

mount /dev/sr0 /mnt/point
Changing "/mnt/point" to whatever directory you want to use for the mount location.

If you don't know if/where it's mounted, you can use "df" to print all mounted filesystems and find the one for /dev/sr0.

jailbait 02-06-2017 10:46 AM

If you want to mount the CD on your own mount point you don't have to find out where it is currently mounted or if it is mounted. You can use the umount command to get it unmounted no matter where it is mounted or not mounted:

Code:

umount  /dev/sr0
mount /dev/sr0 /mnt/wherever

--------------------
Steve Stites

jsbjsb001 02-06-2017 12:25 PM

Quote:

Originally Posted by swamprat (Post 5665713)
Greetings,

I'm running CentOS 7.2 KDE and when I put a CD or DVD in the drive which I think is SR0 it shows up when I execute the Dolphine file manager I can see the contents of the media in the drive.

However when I use a terminal session I have no idea where to look or what type of terminal commands to execute to see such media contents within the terminal session.

The drive appears to already to be mounted when I boot up the system that's why I believe I can see the media contents.

This machine has two CD/DVD drive and I've tried to use the mount command to get the second drive mounted. There has to be a 100 mount commands and no matter how I've tried I can't mount the second drive nor can I see the contents of the second drive in a terminal session.

I do see some directories such as /mnt/cdrom but when I look at this cdrom directory there is nothing there. Also there is a directory with SR0 in it but I have no idea what it does.

Any help here would be greatly appreciated.

Thanks

If your using a graphical environment/interface (like KDE/GNOME/Xfce/etc) the CD/DVD should be automatically mounted by the graphical environment. If you have started your PC in 'text mode' (with no graphical environment running), you would have to manually mount it yourself. Like above posters have said with the mount command.

pan64 02-06-2017 01:03 PM

so it looks like this is the dir you are looking for: /run/media/rifkinho/FD-SETUP
But actually I do not know if it was the answer...
I think this is auto-mounted, so either you use some kind of GUI or automounter was configured. As far as I know rifkinho is the user and FD-SETUP is the "title" or label of that disk. Would be nice if you could tell us if it solves your problem.

frankbell 02-06-2017 08:19 PM

These days, all the cool hip young distros with the hipster beards are putting optical disks and other removable media in /run/media/[username] by default.

Don't ask me why. I wasn't consulted.:)

Shadow_7 02-06-2017 09:20 PM

$ mount

With no parms to see what is mounted and where. Swap is different and can be seen with free or "swapon -s".

$ cat /proc/devices

To see the major numbers to compare against /dev/ contents.

$ cat /proc/misc

To see minor numbers for major number 10 devices, or whatever major gets misc for your distro. But unrelated in this case.

In the olden days the cdrom was at /dev/hdc. And /dev/cdrom was a link to /dev/hdc. But these days, typically /dev/sr0 is the cdrom drive and sometimes /dev/cdrom is linked to it, but a lot of times you have to create this manually for those legacy things that expect it. Or use more specialized names to access them via media players.

Basically the bottom half of /proc/devices are the block devices which are typically storage devices (optical drives fall into this category). In days of old, we had to use these major (and minor) numbers to create our /dev/ devices. Although many distros did their best to create all possible devices under /dev/ so you didn't have to. The era of MAKEDEV and MKNOD. But udev came around and re-leaved us of that burden.

For certain media types (audio cds) you cannot mount them (anymore). But you have to call them special names like dvd:// or cdda://. Also cddb:// if you want to query the internet for a database of known media contents (cloud based meta-data). For example:

$ mpv --ao=alsa cdda://
(audio cd without lookup)

In short /dev/sr0 is typically your optical drive. And you'll probably have to create /dev/cdrom as a link to /dev/sr0 to have a more human friendly name.


All times are GMT -5. The time now is 05:59 AM.