LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 04-23-2014, 02:54 PM   #1
david_8274
Member
 
Registered: Jun 2013
Location: California
Distribution: Ubuntu, Fedora
Posts: 74

Rep: Reputation: Disabled
what dictates which devices gets an entry in /dev?


Hi,

When kernel boots up, there are a number of devices list in /dev. My question is, through what mechanism do we tell the kernel which device to be add to/remove from /dev on power up? (I am not talking about creating/deleting a node at run time)

Thanks,
Wei Xu
 
Old 04-23-2014, 03:27 PM   #2
Smokey_justme
Member
 
Registered: Oct 2009
Distribution: Slackware
Posts: 534

Rep: Reputation: 203Reputation: 203Reputation: 203
That depends on the distribution... Modern ones use udev or variants..
 
Old 04-23-2014, 04:37 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,398

Rep: Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207
It's possible that some get there from init and from kernel too.
 
Old 04-23-2014, 06:48 PM   #4
david_8274
Member
 
Registered: Jun 2013
Location: California
Distribution: Ubuntu, Fedora
Posts: 74

Original Poster
Rep: Reputation: Disabled
Thanks for the response!
@Smokey_justme, so some scripts are executed to call udev (or its variants) to populate /dev at boot time? Could you provide a bit more details?

Thanks,
Wei
 
Old 04-23-2014, 06:49 PM   #5
david_8274
Member
 
Registered: Jun 2013
Location: California
Distribution: Ubuntu, Fedora
Posts: 74

Original Poster
Rep: Reputation: Disabled
@jefro, Thanks for your reply! Could you provide with a bit more details? I am a newbie

Thanks,
Wei
 
Old 04-24-2014, 05:07 AM   #6
Smokey_justme
Member
 
Registered: Oct 2009
Distribution: Slackware
Posts: 534

Rep: Reputation: 203Reputation: 203Reputation: 203
Pff, basically after udev is started, it will load all devices, populate dev according to found devices (or newly connected), load the module, if one exists, execute custom scripts if needed, etc..

While in general udev does the same thing, the location of the files and the moment it populates /dev depends from distribution to distribution..

Also, on some distributions, you might run an initial initrd image (basically, before everything is booted, a small image is used containing the necessary modules/drivers that need preloaded in order for the system to boot -- think RAID, LVM, encrypted partitions --- at that point no udev is loaded, so the /dev is "manually" pre-populated with a minimal set of devices)
 
Old 04-24-2014, 09:16 AM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
During the initrd startup, the command "mount -t devtmpfs none /dev" is done. devtmpfs is built into the kernel and provides a map of the indentified devices during hardware initialization. The identified devices are already present in /dev at that point. udevd can add updates (by loading drivers based on events from controllers).
 
1 members found this post helpful.
  


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
How do I map ATA devices to /dev/sd* block devices when using a port multiplier? Mahonri Linux - Hardware 0 02-20-2014 12:44 AM
No /dev/sdc1, /dev/sdd1 devices in Slackware 14 installation image? andyt22 Slackware 2 08-15-2013 08:33 AM
What creates /dev/pts, /dev/loopx, and other /dev devices - Fedora Core 2 rickpo12 Linux - General 5 02-11-2012 09:50 PM
openSUSE Multimedia Optical Devices /dev/dvd & /dev/cdrom Configuration jdmcdaniel3 SUSE / openSUSE 2 10-31-2010 02:06 PM
mounting 2 ide-scsi devices /dev/cdrom and /dev/cdrom1 issue penguin123 Linux - Hardware 3 09-26-2003 09:36 PM


All times are GMT -5. The time now is 01:36 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration