LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 02-21-2010, 01:41 PM   #1
Wintershade
LQ Newbie
 
Registered: Aug 2006
Location: Croatia
Distribution: Arch Linux (rolling release)
Posts: 26

Rep: Reputation: 15
[SOLVED] Mounting CDs/DVDs via HAL under a specific mountpoint?


Hello again. I'm trying to make HAL mount my CD and DVD discs under a specific mountpoint (such as "/media/optical_disc", rather than "/media/<disc_label>". I understand from the Arch Linux Wiki it's possible for the media which gets recognized by it's uuid.
If someone could help me do it with optical disks, I'd be very grateful.

Thanks in advance!

Last edited by Wintershade; 04-07-2010 at 03:29 PM. Reason: solved
 
Old 03-01-2010, 06:55 PM   #2
hiok
LQ Newbie
 
Registered: Nov 2009
Posts: 3

Rep: Reputation: 0
Try pointing your mount points in /etc/fstab

I have an entry here in my /etc/fstab:

/dev/sdb2 /mnt/ipod vfat uid=1001,gid=100,users,noauto 0 0
/dev/sr0 /mnt/cdrom auto ro,noauto,users 0 0

Whenever I connect the ipod thing or put a data disc in the tray and close it, gnome-volume-manager, working over HAL, mounts them in the places specified in the fstab.

The only think is you have to know the device names: in my case, the optical discs are /dev/sr0. You should check yours and use it accordingly.

As far as I understand it, you shouldn't use /media for that, but /mnt instead.

If you really need /media, which I'm not sure would be good practice, or even work, you could make a symbolic link there pointing to /mnt/cdrom, for instance.
 
Old 03-01-2010, 07:36 PM   #3
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,771
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
... a silly geek trick

Years ago I learned to do this with mount points:
Code:
user@host:path$ cd /mnt
user@host:path$ # create your mount point folders
user@host:path$ sudo mkdir mntPnt1
user@host:path$ ...
user@host:path$ sudo mkdir mntPnt99
user@host:path$ # if they will not be mounted all the time, you might
user@host:path$ # forget why these folders exist ... especially when you
user@host:path$ # put them somewhere other than /mnt
user@host:path$ ...
user@host:path$ sudo touch mntPnt1/_THIS_IS_A_MOUNT_POINT_.txt
user@host:path$ ...
user@host:path$ sudo mkdir mntPnt99/_THIS_IS_A_MOUNT_POINT_.txt
In really complex situations, I even put remarks into the text file to explain what I use each mount point for.

Another aspect of this trick shows up if the mount fails for whatever reason. Any time I list the folder content and see this file (and maybe
others) I know immediately that something went haywire during the mount
request or there was some other forced umount.

Cheers,
~~~ 0;-Dan
 
Old 04-07-2010, 03:29 PM   #4
Wintershade
LQ Newbie
 
Registered: Aug 2006
Location: Croatia
Distribution: Arch Linux (rolling release)
Posts: 26

Original Poster
Rep: Reputation: 15
Hi everyone... sorry for the delay and for resurrecting the old topic. I've been away for a while, and now I've managed to get what I want.
I've created a new HAL policy file (in /etc/hal/fdi/policy on Arch Linux, elsewhere on other distros TTBOMK) called 20-disc.fdi, which contains the follwing configuration:
Code:
<?xml version="1.0" encoding="UTF-8"?>
 <deviceinfo version="0.2">
  <device>
   <match key="volume.is_disc" bool="true">
    <merge key="volume.label" type="string">disc</merge>
   </match>
  </device>
</deviceinfo>
From now on, every optical disc I insert into my computer will be mounted under /media/disc. Voila, desired effect achieved!
Thanks everyone for the help.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to stop HAL from seeing specific partitions? gibson79 Slackware 1 09-22-2009 01:07 PM
Autoplaying DVDs, Hal, kde, dbus etc dive Slackware 2 06-18-2007 11:16 AM
Auto mounting CDs & DVDs Gonto SUSE / openSUSE 3 05-29-2005 05:51 AM
Mounting several drives to one mountpoint? (redhat 9, IDE disks) ozric Linux - Newbie 3 02-01-2005 10:11 AM
Mounting a large directory over NFS... Mountpoint is empty? Shade Linux - Networking 5 04-18-2004 08:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:39 AM.

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