Linux - NewbieThis 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
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
/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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.