Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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).
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.
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.
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.
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
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
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.
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.
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).
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.