LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-01-2012, 07:10 PM   #1
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Rep: Reputation: 47
Optimizing cdrom mounting


I have to use a lot of CDs and I need to insert them, see their contents and change them quickly. How can I optimize their mounting and unmounting? Will there be a problem if I just remove them from drive and change them without clicking on eject option from their icon on desktop?
 
Old 01-02-2012, 11:58 AM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Hi rng,

We usually use mount and umount options where we want the data in cache to be written on the device. For example if you connect a USB drive and copy something onto it then it is always advisable to umount it instead of directly removing it because the data is actually written just before the device is unmounted. This is applicable in the situation where the device is mounted with async option.

CD-ROM is mounted as read only device so there shouldn't be a problem if you directly change the CD instead of ejecting it and then removing it. But if you go by procedure then it is good to eject and then insert the new one. The reason being even if you remove the CD the system for a fraction of time keeps the old image and you might get invalid handle error if you directly put in the new CD.
 
Old 01-03-2012, 01:18 AM   #3
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Original Poster
Rep: Reputation: 47
Thanks for the info.
 
Old 01-03-2012, 11:43 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,727

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
In addition, the drive will probably be locked so you can not eject via it's push button unless the disk is unmounted.
 
Old 01-03-2012, 06:43 PM   #5
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Original Poster
Rep: Reputation: 47
I have to work in a windoz program thru wine which reads CDs. I have set cdrom folder in wine to /cdrom. But CDs are mounted in a subfolder of /media folder created according to label of CD, eg /media/123456. Hence, with every change of CD, I have to give commands 'sudo umount /cdrom' and 'sudo mount /dev/sr0 /cdrom'. I windoz, one can simply remove CD and insert second CD and continue work in program.

How can I speed up mounting of CD?
 
Old 01-04-2012, 11:36 AM   #6
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Original Poster
Rep: Reputation: 47
If I enter following line in /etc/fstab, will ubuntu always mount CDs on /cdrom (even later once system is running and when I change CDs)?
Code:
/dev/sr0 /cdrom auto defaults 0 0
 
Old 01-04-2012, 12:08 PM   #7
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Nope, /etc/fstab is referred by the system only at the time of booting. If you put the CD in and the boot up your first then it will mount that CD to /cdrom directory. However, when you will change CDs it will mount to default mount point which is /media unless you specify manually to mount at some other location.
 
Old 01-05-2012, 12:41 PM   #8
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,142

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
Quote:
Originally Posted by T3RM1NVT0R View Post
Nope, /etc/fstab is referred by the system only at the time of booting.
No so! I have this in my fstab:
/dev/sdb1 /media/usb ext2 noauto,noatime,users 0 0
and all my usb memory sticks mount to /media/usb when inserted (auto mounting is on).
 
Old 01-05-2012, 05:01 PM   #9
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

@ DavidMcCann,

I tried it for my CDs and it is unable to mount CD until I run mount -a. When you say automounting is on are you talking about autofs?
 
Old 01-06-2012, 05:16 PM   #10
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,142

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
By "automounting", I mean the desktop is set to mount any removable media when they are inserted.
 
Old 01-06-2012, 06:51 PM   #11
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Original Poster
Rep: Reputation: 47
By default, ubuntu automounts inserted CDs on a folder created in /media according to the label of the CD.

I tried putting following line for /dev/sr0 (cdrom) in /etc/fstab in ubuntu:
Code:
#/dev/sr0 /mnt/sr0 iso9660 auto,noatime,users,suid,dev,exec,ro 0 0 # AutoUpdate
It automounts only if a CD is there at boot time (gives an error message if no CD is present in the drive). There is no automounting if cd is inserted later on (not even on /media/cd-label folder).
 
Old 01-07-2012, 10:32 AM   #12
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,142

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
What you did wrong there was to put "auto" in the 4th column of fstab when you should have put "noauto".
 
Old 01-07-2012, 12:11 PM   #13
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Original Poster
Rep: Reputation: 47
I now have tried 'noauto' also but it does not work.
 
Old 01-08-2012, 12:32 AM   #14
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Original Poster
Rep: Reputation: 47
I found the answer on following sites. This line in /etc/fstab works well- automounts cd on /media/cd folder:
Code:
/dev/sr0         /media/cd   auto    ro,user,noauto,unhide   0      0
https://bbs.archlinux.org/viewtopic.php?id=115424
http://forum.winehq.org/viewtopic.php?p=58359#58359
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mounting cdrom sephstorm Linux - Newbie 6 07-10-2011 05:58 PM
CDROM mounting problem => /dev/cdrom is not a valid block device Vizy Linux - Hardware 8 11-04-2010 04:46 PM
mounting cdrom jwhiz Linux - Newbie 3 12-27-2003 08:54 AM
mounting a cdrom PlatinumRik Linux - Networking 6 05-27-2003 09:11 AM
mounting my CDROM linuxRules Linux - General 11 07-26-2002 01:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration