LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   which module creates device files (https://www.linuxquestions.org/questions/red-hat-31/which-module-creates-device-files-541470/)

baloon 03-28-2007 09:11 PM

which module creates device files
 
Hello

I am having some difficulty with the cdrom device. I like to know during installation which module / script will be creating /dev/* entries. I am more interested about /dev/cdrom and /dev/scd[0-9] etc.

Any pointers will be appreciated.

Thanks
-B

blackhole54 03-28-2007 10:38 PM

If you are using a recent 2.6 kernel, I believe (not sure) that these entries are created dynamically at run time instead of at installation time. Do an internet search on udev if you want to look up info on this.

GrapefruiTgirl 03-28-2007 10:40 PM

If you are using a 2.4 kernel, hotplug (a/ script(s)) typically deals with the device nodes in /dev.
With 2.6 kernels, hotplug is replaced by the UDEV system (a program and script(s).

I think this is pretty universal, but some distributions may have slight variations on each thing.

What exactly are you trying to do? And with what distribution? During boot, you mean, or actually during installation? During installation of a system, I don't know if any device nodes are specifically created, or if they would be created for the first time upon the first reboot when installation is done.
And as stated by the above person, /dev nodes are re-created dynamically after each boot.

baloon 03-29-2007 12:29 AM

Hello


Thanks for the replies. I am trying to install RHEL AS3 U8. In this cdrom drive will be emulated as scsi drive by setting a boot parameter as hdc=ide-scsi. But for the device to be emulated as scsi, the device node to be used has to be /dev/scd0 where as in AS3 U8 /dev/cdrom is a symlink to /dev/hdc. ( I checked in U6 and it is being created correctly. /dev/cdrom ->/dev/scd0 ) so if it is set like this, I cannot mount cdrom drive. If I change the link /dev/cdrom to point to /dev/scd0, cdrom can be mounted. So got a kind of confused on why it got changed in U8, and how it can be rectified.

As you said udev is creating this, I also got this hint some times back .. but I didn't get much idea on what how it is done and how udev works in RHEL AS3. Any pointers to that .. ??

When you say it will be dynamically created, will it be at boot time or even during run time it will be changed. I guess it is during boot time ???

I want to see why does udev create a link pointing to /dev/hdc instead of /dev/scd0.

Thanks
-B

GrapefruiTgirl 03-29-2007 01:04 AM

RE: "How UDEV works in RHEL AS3"..... I suppose it works the same way as in any distribution. I can't be specific to RH as I use Slackware, but I am assuming that UDEV is UDEV, regardless of the Linux version. To be vague and simplistic :) the computer saves the /dev directorys contents at shutdown, so that any special or weird human-made nodes are preserved, and upon reboots, the machine detects all the hardware, drives, devices, etc, and creates the needed nodes for them, plus any human-made or weirdo nodes.
UDEV also uses (depending on the system) a RULES file (or several of them) and ALIASES to create special device links.
As for why exactly RH is creating a dev-link to hdc instead of scd0, I have no idea, but the CDROM device is *probably* not an actual scsi device, but in your case, you are needing direct native-scsi functionality to get the drive to do what you want it to do. ATA/ATAPI and most similar optical drives use the scsi command set internally anyways; it's just 'wrapped' with something newer (ATAPI) unless the drive is very old or very rare.
In any case, just delete the sym-link you don't want, and make a new one :) and it should remain in place across reboots and you'll forget all about it! The man page for the ln command gives details, but in case you don't know, you'll want something like:
ln -s /dev/new-link /dev/scd0

baloon 03-29-2007 11:26 AM

Hello

thanks a lot for the detailed reply. I changed the link and it works well now. But thought of doing some more research - that is why dig into depth.

I am a bit confused about the scsi emulation. At what circumstances we kernel for for scsi emulation for cdrom drive - any idea ? Is it mandatory for all the cdrom drives ( I don't think so ) or is it required for some of the drives ( I think yes !! ) .. what parameter decides that scsi emulation is required for this cdrom .. ??? any pointers ..

-B

GrapefruiTgirl 03-29-2007 12:17 PM

I personally cannot answer that question--- I would try Google, and searching for related threads on LQ here.
Also, try the man pages for lilo, mount, fstab, lilo.conf.
I don't know what reason(S) *exactly* make it necessary to use hdx=ide-scsi|ide-cdrom or similar parameters. You are right it is not mandatory most of the time, but is probably absolutely necessary for a few devices..
Best of luck :) If you find conclusive/concise info, please do post it.

baloon 03-29-2007 02:45 PM

Thanks for the help .. I will try to find some pointers and put it here if I find any useful stuff ..

jschiwal 03-29-2007 03:00 PM

On 2.4 kernels you need that entry in boot, but for recent 2.6 kernels, emulating a scsi device isn't necessary. It may have to do with the version of cdrecord that you have. If it is a recent version then I doubt whether you still need to do it. I haven't had to for the last couple years at least.


All times are GMT -5. The time now is 06:02 PM.