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 09-03-2004, 03:04 PM   #1
Sinope
Member
 
Registered: Aug 2004
Location: Chicago
Distribution: Debian testing/unstable
Posts: 82

Rep: Reputation: 15
/dev/* ...what are they?


I'm slowly learning the ropes on Linux... I got a book called the Linux Pocket Guide by Daniel J. Barrett, which has been very helpful.

However, there is still one aspect I am totally clueless on: devices.

For instance, when I insert a floppy, I have to su -c "mount /dev/hd0 /mnt/floppy". Okay, that's no problem-- a bit annoying, but no big deal. I can do the same thing with smbfs shares on my parents' computers.

I have two CD drives. Here's where I get confused. When I know which one I want to mount, I use /dev/hdc or /deb/hdd. Works fine. Only, there is also this mysterious /dev/cdrom. When I mount it, I'm never sure what I'm going to get. Plus, there is a /dev/dvd.... is this just a copy of /dev/hdd? And what is the "dvd:/" that Xine wants but can never find? How do I get access to an audio CD?


Basically, I want to know what, exactly, the /dev/* files are, and how to work with them. Can anybody recommend any resources?

Thanks!


--S
 
Old 09-03-2004, 03:11 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
/dev files are device files. They're a static (or dynamic in newer systems) set of files that correspond to hardware on your system. There are two types of device files, block devices (disk drives and other sorts of storage mostly) and character devices (everything else, e.g. terminals and the null device). One of the fundamental abstractions of Unix is "everything's a file". In moust systems /dev/cdrom and /dev/dvd are symlinks to the appropriate /dev/hd* file or /dev/sd* (if you're using SCSI).

The files themselves have special meaning to the kernel. Each device has a major and minor number (you can see them with ls -l). When you open a device file, the major and minor number trigger magic in the kernel that invokes the appropriate driver to transmit commands to the device.
 
Old 09-03-2004, 05:15 PM   #3
greasycreek
LQ Newbie
 
Registered: Aug 2004
Distribution: Slackware-current w/ 2.4.27
Posts: 1

Rep: Reputation: 0
Re: /dev/* ...what are they?

Quote:
For instance, when I insert a floppy, I have to su -c "mount /dev/hd0 /mnt/floppy". Okay, that's no problem-- a bit annoying, but no big deal. I can do the same thing with smbfs shares on my parents' computers.
look into the /etc/fstab file to take care of your mount points.

see http://shilo.is-a-geek.com/slack/fstab12.html
it helped me out.

Last edited by greasycreek; 09-03-2004 at 05:25 PM.
 
Old 09-03-2004, 07:45 PM   #4
Sinope
Member
 
Registered: Aug 2004
Location: Chicago
Distribution: Debian testing/unstable
Posts: 82

Original Poster
Rep: Reputation: 15
BT: the hint about those numbers was very helpful... thanks!

Shilo: your site is great! Thanks a bunch! Like whoa! I totally bookmarked it.

--S
 
Old 09-04-2004, 08:46 PM   #5
irlandes
Member
 
Registered: Nov 2003
Posts: 122

Rep: Reputation: 17
mknod

I think the command to make devices is mknod, see man mknod from any terminal. You need those major and minor device numbers to make one. This is not something that is commonly needed by noobs, but nice to know as a curiosity item.
 
  


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
I cannot access EITHER CD drive! And there's no /dev/hdc or /dev/hdd or /dev/cdrom! Dmalic Linux - Hardware 13 11-18-2005 07:11 PM
ln: creating symbolic link `/dev/dvd' to `/dev/hdc': Permission denied qazwsx27 Fedora 3 06-14-2005 02:09 PM
How can I boot either one of my hard drives /dev/hda or /dev/hdb, I have RH9 and FC2 omogunkristi Linux - General 1 06-21-2004 05:11 AM
Sandisk USB card Reader not linking /dev/sg0 to /dev/sda acidraven Linux - Hardware 1 06-19-2004 03:56 PM
mounting 2 ide-scsi devices /dev/cdrom and /dev/cdrom1 issue penguin123 Linux - Hardware 3 09-26-2003 08:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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