Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-13-2008, 08:19 AM   #1
Registered: Sep 2007
Distribution: GRML 1.1
Posts: 59

Rep: Reputation: 15
I am having a problem with my symlinks in the /dev directory

When I want to mount a cdrom or a dvd, the device that I must mount is /dev/hda. By default, the OS creates symlinks that point to /dev/hda (e.g. /dev/cdrom, /dev/dvd).

The problem is that for some reason, it is adding numbers behind these symlinks. For example, /dev/cdrom6 and /dev/dvd6. The number increases by one ever time I reboot the computer, which makes it nearly impossible for me to keep fstab working unless I want to let rebuildfstab do its thing (which I don't for various reasons).

So my question is, why are there numbers being appended to the end of my sym links and how do I stop this from happening?


My Linux version is 2.6.23-grml
Old 08-13-2008, 09:44 AM   #2
Registered: Sep 2007
Distribution: GRML 1.1
Posts: 59

Original Poster
Rep: Reputation: 15
After doing a bit of searching, I think I may have solved the problem (although this won't fix it if you are using more than one optical drive).

I edited the /lib/udev/write_cd_rules script file, making the following changes:

link_num=$(find_next_available 'cdrom[0-9]*') <---original
link_num="" <---my version

If you look further down in the script, you will see the following:
      write_rule "$match" "cdrom$link_num" "$comment"
["$ID_CDROM_CD_R" -o "$ID_CDROM_RW" ] && \
Since all I wanted was to have my cdrom, cdrw, dvd, and dvdrw symlinks stay the same (i.e. not have any numbers appended) this works since $link_num is set to nothing. It's a bit hacky, but it's the only solution I've found so far.
Old 08-13-2008, 09:49 AM   #3
Senior Member
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Could you post the code of find_next_available?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
/dev/cdrom1,/dev/cdrw1 symlinks made at each boot by udev which i dont want deepclutch Linux - Software 2 01-04-2007 08:39 AM
script/command to delete all symlinks from a directory reddazz Linux - General 5 03-16-2005 12:39 AM
symlinks in / directory Bruce Hill Linux - Software 4 10-24-2004 09:32 PM
Symlinks Problem... jd32 Linux - Newbie 5 10-17-2004 04:08 PM
/dev symlinks disappear on reboot, kernel 2.6.7 TheRepublican Linux - Hardware 6 07-01-2004 05:52 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:11 PM.

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