LinuxQuestions.org
Help answer threads with 0 replies.
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 07-25-2005, 11:48 PM   #1
newmoon
Member
 
Registered: May 2005
Distribution: 1. KnoppMyth R5A12 2. Debian Testing (Sarge)
Posts: 54

Rep: Reputation: 15
Uh-oh. Erased /dev/dvd file


Hi all:

Well, I'm a relative newbie to Linux, and apparently, I didn't learn the first time not to work on my box late at night.

When doing some work, I just erased the /dev/dvd file instead of erasing the symbolic link. Just to make matters worse, I also created a new, blank file, with the same name.

Is /dev/dvd a special file or is it generic? Can I recreate it somehow or am I screwed?

Oh, the machine is KnoppMyth (Debian Sarge 2.6.9 custom kernel).

I'm desperate for help

Thanks for any input.


newmoon
 
Old 07-25-2005, 11:52 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Well, it all depends. If you have udev, you could just remove the file and reboot. Otherwise, there's probably a "MAKEDEV" script in you /dev that you can use to recreate it.
 
Old 07-26-2005, 12:24 AM   #3
newmoon
Member
 
Registered: May 2005
Distribution: 1. KnoppMyth R5A12 2. Debian Testing (Sarge)
Posts: 54

Original Poster
Rep: Reputation: 15
Matir:

Thanks for your quick reply!
Well, I'm not using udev, AFAIK.

I looked around for a makedev file, but there were several files by that name. The one in /dev directory was tiny, and when I looked at it, barely contained any code.

Should the file you're talking about end in ".sh" ?

What repercussions would running that script have?


Thanks again.

newmoon


Quote:
Originally posted by Matir
Well, it all depends. If you have udev, you could just remove the file and reboot. Otherwise, there's probably a "MAKEDEV" script in you /dev that you can use to recreate it.
 
Old 07-26-2005, 12:30 AM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 128Reputation: 128
I think just running "/dev/MAKEDEV.sh dvd" should work... it's been a while since I've used raw dev nodes... you could try googling for relevant info.
 
Old 07-26-2005, 12:55 AM   #5
newmoon
Member
 
Registered: May 2005
Distribution: 1. KnoppMyth R5A12 2. Debian Testing (Sarge)
Posts: 54

Original Poster
Rep: Reputation: 15
Well, unfortunately:

Code:
MAKEDEV dvd
MAKEDEV: don't know how to make device "dvd"
What can I try next.

Thanks

newmoon



Quote:
Originally posted by Matir
I think just running "/dev/MAKEDEV.sh dvd" should work... it's been a while since I've used raw dev nodes... you could try googling for relevant info.
 
Old 07-26-2005, 01:19 AM   #6
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Which device is your dvd drive? hda, hdb, hdc, hdd? It should show up in 'dmesg' somewhere (dmesg | grep -i dvd). See if that exists. If so, just ln -s /dev/DRIVE_FROM_DMESG /dev/dvd
 
Old 07-26-2005, 09:18 AM   #7
newmoon
Member
 
Registered: May 2005
Distribution: 1. KnoppMyth R5A12 2. Debian Testing (Sarge)
Posts: 54

Original Poster
Rep: Reputation: 15
Thanks.

But I'm confused. Don't I need the actual dvd device file there, as opposed to just a blank file with a link? If so, is this file standard? Perhaps if it is, I could just get another copy from someone with the exact same distrib?



newmoon



Quote:
Originally posted by Matir
Which device is your dvd drive? hda, hdb, hdc, hdd? It should show up in 'dmesg' somewhere (dmesg | grep -i dvd). See if that exists. If so, just ln -s /dev/DRIVE_FROM_DMESG /dev/dvd

Last edited by newmoon; 07-26-2005 at 09:21 AM.
 
Old 07-26-2005, 10:52 AM   #8
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Dev files don't actually do anything, per se. On my computer, /dev/dvd is a symbolic link to /dev/hdd, for example.
 
Old 07-26-2005, 12:42 PM   #9
Chromezero
Member
 
Registered: Nov 2004
Location: Arizona
Distribution: Slackware, RHEL, others
Posts: 470

Rep: Reputation: 40
My setup is similar to Matir's. /dev/cdrom or /dev/dvd are just symbolic links to /dev/hde or whatever the physical drive is. My main system, for example, has 3 hard drives, 1 CD-RW, and 1 DVD-RW. Rather than trying to keep track of whether a drive is HDA, HDE, or whatever each drive is, I have sym links to keep them organized. This makes it easier to setup in Fstab or when mounting.
 
Old 07-26-2005, 03:46 PM   #10
username17
Member
 
Registered: Aug 2004
Location: Norfolk VA
Distribution: Slackware 11
Posts: 230

Rep: Reputation: 30
If /dev/dvd is symbolically linked to the correct device (/dev/hdc), then reconnecting the link should work.

Code:
ln -s /dev/hdc /dev/dvd
That SHOULD work assuming /dev/hdc is your Optical drive (or the DVD one, if you have more than one Optical drive).
Someone correct me if I'm wrong, but if you create a symbolic link, doesn't it create the file that is linked? In my understanding, the above command should create a file called /dev/dvd and it would be linked to /dev/hdc.
 
Old 07-26-2005, 08:56 PM   #11
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Creating a symbolic link creates a special file of type link (on filesystems that support such operations). In effect, the only way to have a link is to have such a file, and the only way to have such a file is to have a link.

Creating a symlink does NOT create the destination of the symlink (/dev/hdc above).
 
Old 07-27-2005, 09:02 AM   #12
Chromezero
Member
 
Registered: Nov 2004
Location: Arizona
Distribution: Slackware, RHEL, others
Posts: 470

Rep: Reputation: 40
It would not create /dev/hdc but you could use mknod /dev/hdc or makedev /dev/hdc to create the destination file correct? I'm still learning and thought it might help newmoon some as well.
 
Old 07-27-2005, 09:27 AM   #13
Itzac
Member
 
Registered: Feb 2003
Distribution: VectorLinux 5.1
Posts: 116

Rep: Reputation: 15
Chromezero is right. If hdc and hdd already exist in /dev (or whatever device is your dvd-rom), then all you have to do is link to it. If you also deleted the actual device file, you can use mknod to restore it. Look in /proc under under ide to determine the major and minor numbers. It's a little tricky, you'll need to cat a lot of the files in /proc/ide and compare them with the output of ls -l /dev/hd*. Or someone might just come along after me and post the numbers for you.

Hope this helps
 
Old 07-27-2005, 11:44 AM   #14
newmoon
Member
 
Registered: May 2005
Distribution: 1. KnoppMyth R5A12 2. Debian Testing (Sarge)
Posts: 54

Original Poster
Rep: Reputation: 15
Thanks guys. I'm trying to understand something.

Let's say I were to use MAKEDEV (so I can learn how, and so I can say that I did). :-)

Would I use the device characteristics for hdc ? What repercussions would that have as opposed to using a symbolic link?


I checked this guide:
faqs.com: Linux Administrator guide

and according to that, I should consult my "devices.txt" file. I did that, and it specifies /dev/hdc as block device, major: 22 minor: 0 .

So would it work if I did:
Code:
MAKEDEV -v dvd
	create dvd b 22 0 root:cdrom 0660
What owner and group and perms are usually given for dvd-anyone know?


Thanks again.


newmoon
 
Old 07-27-2005, 11:48 AM   #15
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 48
dvd is usually just a symbolic link to the hdx device - that *is* the norm. To have an actual dvd /dev entry, you'd have to change the way dev node names are assigned.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
mount as a device: mount dvd-iso file in /dev/dvd sadarax Linux - General 21 02-03-2011 12:59 AM
No /dev/hdd file for my dvd writer ? slzckboy Linux - Hardware 10 09-24-2005 03:48 PM
2.6.6, erased /dev/cdrom, had scsi emu. in 2.4.*, dont know what to do.... mipia Slackware 3 05-27-2004 09:36 PM
Sony DVD DDU1612. /dev/dvd no such file lamedavis Linux - Hardware 2 03-30-2004 07:06 PM
accidentily erased /dev/ttyS0 file frieza Linux - Hardware 1 01-02-2004 01:45 PM

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

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