LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   rm /dev/dvd; ln -s /dev/hdd /dev/dvd has no effect after rebooting. (http://www.linuxquestions.org/questions/linux-newbie-8/rm-dev-dvd%3B-ln-s-dev-hdd-dev-dvd-has-no-effect-after-rebooting-889712/)

stf92 07-03-2011 03:00 PM

rm /dev/dvd; ln -s /dev/hdd /dev/dvd has no effect after rebooting.
 
Kernel 2.6.21.5, Slackware 12.0

Hi:
Because mplayer looks for /dev/dvd and
Code:

lrwxrwxrwx 1 root root 8 2007-01-24 07:35 /dev/dvd -> /dev/hdc
whereas my the disc I want to play is in /dev/hdd (/dev/hdc is a CD-ROM drive), I do
Code:

$ rm /dev/dvd
$ ln -s /dev/hdd /dev/dvd

which gives
Code:

lrwxrwxrwx 1 root root 8 2007-01-24 07:35 /dev/dvd -> /dev/hdd
OK. Now I reboot the machine and, when I look at /dev/dvd, again it is linked to /dev/hdc. How can this be? Or should it be a hard link that I must do? Thanks.

andrewthomas 07-03-2011 03:24 PM

couldn't you just add:
Code:

rm /dev/dvd
ln -s /dev/hdd /dev/dvd

to /etc/rc.d/rc.local and
Code:

chmod +x /etc/rc.d/rc.local

stf92 07-03-2011 03:57 PM

Thanks for the feedback. I did what you said. As I already have other stuff in /etc/rc.d/rc.local, and it always gets executed, I have no doubt this will also execute in the next reboot.

If I ls -s a regular file, the link stays there until I explicitly remove it. But /dev/dvd is not a regular file. May be this the reason why it reappears?

chrism01 07-03-2011 07:19 PM

You may need to read this http://linux.die.net/man/8/udev

andrewthomas 07-03-2011 07:25 PM

This is pretty good also:

http://www.reactivated.net/writing_u...#example-cdrom


All times are GMT -5. The time now is 01:53 AM.