LinuxQuestions.org
Review your favorite Linux distribution.
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 12-05-2006, 08:18 PM   #1
jxrod2000
Member
 
Registered: Apr 2006
Location: MA, USA
Distribution: Ubuntu 18.04
Posts: 35

Rep: Reputation: 15
symbolic link to device


Hello,

I have the most weired problem. I have upgraded to a dvd burner, and kept my existing cd burner. Initially there was a symbolic link /dev/cdrecorder to /dev/hdb.

I have created two new symbolic links as follows:
ln -s /dev/hdb /dev/dvdrw -> this is my new dvd
ln -s /dev/hdd /dev/cdrw -> my old cd.

My fstab entries for these devices are as follows
/dev/dvdrw /dvdrw subfs noauto,fs=cdfss,ro,user,procuid,nosuid,nodev,exec,iocharset=utf8 0 0

/dev/cdrw /cdrw subfs noauto,fs=cdfss,ro,user,procuid,nosuid,nodev,exec,iocharset=utf8 0 0

When I installed the dvd I moved the cd to hdd from hdb and the dvd is now hdb.

All this stuff works, but when I reboot my symbolic links (/dev/dvdrw and /dev/cdrw) are gone.

For the life of me I can't understand why:

here is the output of ls:
lrwxrwxrwx 1 root root 8 2006-12-05 21:07 /dev/dvdrw -> /dev/hdb

lrwxrwxrwx 1 root root 3 2006-12-05 20:49 /dev/cdrecorder -> hdb
lrwxrwxrwx 1 root root 3 2006-12-05 20:49 /dev/cdrom -> hdb
lrwxrwxrwx 1 root root 8 2006-12-05 21:07 /dev/cdrw -> /dev/hdd

The /dev/cdrecorder and /dev/cdrom are the old links, which stay put as they should.

The output of ls against hdb and hdd:
brw------- 1 ascjxr disk 3, 64 2006-12-05 15:49 /dev/hdb
brw-r----- 1 root disk 22, 64 2006-12-05 15:49 /dev/hdd

I'm not sure why hdb has my id, but I have tried to change that to root, but again when I reboot it's back to my id.

Any ideas why this is happening and how to permanently fix it. I seem to be able to fix it temporarily, but it doesn't stay across reboots.

Thanks,
Joe.
 
Old 12-05-2006, 08:45 PM   #2
osvaldomarques
Member
 
Registered: Jul 2004
Location: Rio de Janeiro - Brazil
Distribution: Conectiva 10 - Conectiva 8 - Slackware 9 - starting with LFS
Posts: 519

Rep: Reputation: 34
Hi jxrod2000,

If you use a modern distribution, you don't have the directory /dev fully populated on the root fs. Instead, during boot, it's created a pseudo file system which is mounted on /dev and it is populated on demand. Your links won't be preserved after reboot as this file system exists only in memory.

I can't say the way, but you can change the devfs or udev configuration to create your symlinks when it populates the new fs on start up.
 
Old 12-05-2006, 09:30 PM   #3
dxqcanada
Member
 
Registered: Sep 2006
Location: Canada
Distribution: Gentoo
Posts: 702

Rep: Reputation: 43
I believe that udev will copy any device file that is saved in /etc/udev/devices/ at bootup.

Create this directory and copy your link files into it.
 
Old 12-06-2006, 08:21 PM   #4
jxrod2000
Member
 
Registered: Apr 2006
Location: MA, USA
Distribution: Ubuntu 18.04
Posts: 35

Original Poster
Rep: Reputation: 15
Changing udev did it.

Thank you dxqcanada and obrigada Osvaldo.

You guys pointed me in the right direction. Since I run Suse, it wasn't as simple as just copying the dev links, but I was able to figure it out.

Joe.
 
Old 12-07-2006, 09:56 AM   #5
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
Quote:
Originally Posted by jxrod2000
Thank you dxqcanada and obrigada Osvaldo.

You guys pointed me in the right direction. Since I run Suse, it wasn't as simple as just copying the dev links, but I was able to figure it out.

Joe.
**nevermind**

Excellent!
 
  


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
What is a Symbolic Link? little_penguin Linux - Software 2 05-14-2005 09:27 AM
Symbolic link to device at startup hinkipunk Linux - General 4 01-26-2005 10:04 AM
Adding symbolic link to device javamdk Linux - General 2 07-21-2004 01:21 PM
Symbolic link. bulzbb Linux - General 8 03-19-2004 04:57 AM
Symbolic link bwaynej2002 Linux - General 8 08-25-2003 10:06 PM

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

All times are GMT -5. The time now is 03:33 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