Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
02-06-2017, 12:48 AM
|
#1
|
Member
Registered: Sep 2005
Location: New Jersey, USA
Distribution: VMware V12 and V15 in Windows 10, MX Linux 23.1, Kubuntu 23.10, IBM z/VM 5.4
Posts: 559
Rep:
|
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
|
|
|
02-06-2017, 05:57 AM
|
#2
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,684
|
probably mount | grep -i sr0 or mount | grep -i cd will help you to find it
|
|
|
02-06-2017, 10:18 AM
|
#3
|
Member
Registered: Sep 2005
Location: New Jersey, USA
Distribution: VMware V12 and V15 in Windows 10, MX Linux 23.1, Kubuntu 23.10, IBM z/VM 5.4
Posts: 559
Original Poster
Rep:
|
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.
|
|
|
02-06-2017, 10:24 AM
|
#4
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
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.
|
|
|
02-06-2017, 10:46 AM
|
#5
|
LQ Guru
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,352
|
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
|
|
|
02-06-2017, 12:25 PM
|
#6
|
Senior Member
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
|
Quote:
Originally Posted by swamprat
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.
|
|
|
02-06-2017, 01:03 PM
|
#7
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,684
|
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.
|
|
|
02-06-2017, 08:19 PM
|
#8
|
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,542
|
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.
|
|
|
02-06-2017, 09:20 PM
|
#9
|
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 4,137
|
$ 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 02:58 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|