Automatically mount cd/dvd and usb rhel5?

Posted on 2008-11-14
Medium Priority
Last Modified: 2013-12-16
I've maually installed RHEL5 from a dvd. After I ejected the dvd and rebooted I cant se the dvd anymore. I tried to attach some USB sticks and other cd/dvd's but none of them mounts automatically.
I found that I can mount the cd/dvd with the command: # mount /dev/cdrom /mnt/cdrom (if I created /mnt/cdrom dir first)

What do I have to do to get the usb sticks and dvd's mounted automatically?
Question by:tietohacker

Expert Comment

ID: 22960499
You can auto mount with linux.  The issue is all the file types linux supports.  CD and DVD are a known type but USB device could be many file system types.

Start my checking that autofs is running.  Type
chkconfig --list autofs

You should get:
autofs          0:off   1:off   2:off   3:on    4:on    5:on    6:off

Then check the file /etc/auto.misc.  It should have the lines.
cd              -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
backup          -fstype=ext3            :/dev/sde1

Here is a link to automounting example configurations.


LVL 88

Expert Comment

ID: 22960616
Is there a specific reason for using rhel5 and not another distro? The redhat versions are mainly meant for secure infrastructures and therefore much that can compromise this security like external media isn't supported by default. Distro's like Ubuntu, LinuxMint, Fedora-Core (from which redhat is eventually based on) are all more user friendly than rhel and have USB support and I believe also automount already there by default, or at least it is very easy to get that added. For rhel that might not be as easy, and also not recommended.

Also, are you using a GUI? if not, I don't think you can get automount to run.

LVL 19

Expert Comment

ID: 22961132
I think rindi may have got it with the GUI, strange but it seems to be true.

I've no idea why the GUI seems to make a difference but on my RHEL systems it does seem to.
Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.


Author Comment

ID: 22974928

Yes mgrennan, I have the below line in my /etc/auto.misc:
cd              -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
(but do I really need the backup line?) I comment that out.
My chkconfig --list autofs also reports correct output.

But how can I get the cd/dvd and usb device automatically automounted under /media ??


Accepted Solution

mgrennan earned 250 total points
ID: 22978547
You do not need the backup line.

Q, If you drop a data CD in to the cd/dvd drive it should be mounted for you at /media/cd.
The command 'df' should show you.

The DVD mounting is not to hard.  Check if yo have a file /dev/dvd.  Then try:

dvd -ftype-=iso9660,ro,nosuid,nodev :/dev/dvd

USB devices are a bit harder.  They show up as /dev/sd?#   and don't always maintain the same device letter (the ?).   The number (#) is the partition on the device starting with 0.  Some thumb disk have a 0 and 1 partition.  

If you only have one disk in your system it is /dev/sda# and may have more partitions.  The next device would be sdb then sdc and so forth.  If you plug in two devices they will be "lettered" in order.

Excuse me if I'm talking down to you.

I guessing you want you want the same device, like your pocket thumb drive, to always mount in the same place.  To do this you need to work with /etc/udev/rules.d   This directory contains rules that describe what scripts to run when a given device is plugged in.  If you have a bunch of the same thumb drives with the same company ID and partitions, write a script to look for a file you create on each one to tell Linux where to mount that one drive.

Author Comment

ID: 23568444
I give up. The cd or dvd device doesnt get mounted at all. Thanks anyway.

Expert Comment

ID: 24078830
it will be mounted when you access it!

Author Comment

ID: 24094323
I'm sorry, but it doesn't

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Often times it's very very easy to extend a volume on a Linux instance in AWS, but impossible to shrink it. I wanted to contribute to the experts-exchange community a way of providing a procedure that works on an AWS instance. It can also be used on…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month14 days, 5 hours left to enroll

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question