LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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

Reply
 
Search this Thread
Old 08-13-2008, 07:19 AM   #1
JasonC10203
Member
 
Registered: Sep 2007
Distribution: GRML 1.1
Posts: 56

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?

Thanks,
Jason

P.S.
My Linux version is 2.6.23-grml
 
Old 08-13-2008, 08:44 AM   #2
JasonC10203
Member
 
Registered: Sep 2007
Distribution: GRML 1.1
Posts: 56

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:
Code:
      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, 08:49 AM   #3
timmeke
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?
 
  


Reply


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 07:39 AM
script/command to delete all symlinks from a directory reddazz Linux - General 5 03-15-2005 11:39 PM
symlinks in / directory Bruce Hill Linux - Software 4 10-24-2004 08:32 PM
Symlinks Problem... jd32 Linux - Newbie 5 10-17-2004 03:08 PM
/dev symlinks disappear on reboot, kernel 2.6.7 TheRepublican Linux - Hardware 6 07-01-2004 04:52 PM


All times are GMT -5. The time now is 02:52 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration