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.
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 am in the process of trying to make a bootable CD distro and one of the initrd's tasks is to locate the CD drive so it can set up the loopback filesystem that will be the root fs.
my biggest problem is that i dont truely understand the /dev/ directory enough to use it. and of course knowing this is intregral for the task of finding my cdrom drive automatically.
when i search on the /dev directory i get all sorts of breif newb oriented pages, but i need an in depth tut on it and how to use it, does anyone know where i can find this? also, would using the devfs under the kernel be easier or will i still need to know about the /dev stuf?
What do you want to know, exactly? The /dev/ directory is where all of the hardware that your computer is configured to use is stored. Linux uses everything on the system as a file, including hardware. The cd drive would probably be /dev/cdrom.
do me a favor, type "ls -l /dev/cdrom"; /dev/cdrom is not a device but its a link to the real cdrom device which us usually designated as /dev/hd*, the scripts job would be to find the real cdrom then set up the real root filesystem image as a /dev/loop* so that it could be mounted.
what i dont understand is the mechanics of stuf like "mknod" and what the "major" and "minor" numbers are, and im sure that's inportant to what i need to do, and at the verry least it would be usefull to know what they are and how to use them.
Device major/minor numbers are identifiers for devices. For an example look in the file /proc/stat at the disk_io line. The first numbers in parenthesis are the major and minor numbers of all the disks in your system. Eg disk_io: (3,0): (92,92,113,0,0) (3,1): (38582,9146,261475,29436,388120)
im not designing it for my machine, if i was it would be so much easier cause i already know what my cdrom drives designation is. im trying to make this work on any ide based system.
hopefully one of the things my script can do is make a symlink to /dev/cdrom
Have you read The Bootdisk HOWTO? That has some good information on setting up a basic Linux filesystem. Even though it is written for a floppy it still is relevant for a cdrom bootdisk.
The file devices.txt is the file I use when I want to know the major/minor of a device, it comes with the kernel sources, so you should have one at:
/usr/src/linux/Documentation/devices.txt
As far as mknod goes it's real simple to use, you just need to know the major/minor number of the device and whether it is a character or block device.
I just finished project that took me deeply into understanding /dev/xxxx. I posted what I did in the "Success Stories" forum, here
The story may not be interesting to you but I found some articles that talked about /dev/ and helped me learn what info I had there and how it worked. I provided links to the articles.
Yesterday, I'm running Mandrake 9.2, I discoverd that some of the articles I referenced were installed on my hard drive , in, off all places, a directory called HOWTO.
There's another reference that I found quite helpful. I think the name of it is "Introduction to Linux." It has a great discussion on the file system. I don't have great conficence in the accuracy of this link, but you can try it here.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.