All of lore.kernel.org
 help / color / mirror / Atom feed
* When does the /dev/sda1 node comes into being ?
@ 2013-02-05 17:26 horseriver
  2013-02-06  4:29 ` Valdis.Kletnieks at vt.edu
  2013-02-06  6:45 ` Peter Teoh
  0 siblings, 2 replies; 3+ messages in thread
From: horseriver @ 2013-02-05 17:26 UTC (permalink / raw)
  To: kernelnewbies

hi:)

  During booting period .every device will have a node at /dev/ folder.
  what is the detail of ths procedure?

thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* When does the /dev/sda1 node comes into being ?
  2013-02-05 17:26 When does the /dev/sda1 node comes into being ? horseriver
@ 2013-02-06  4:29 ` Valdis.Kletnieks at vt.edu
  2013-02-06  6:45 ` Peter Teoh
  1 sibling, 0 replies; 3+ messages in thread
From: Valdis.Kletnieks at vt.edu @ 2013-02-06  4:29 UTC (permalink / raw)
  To: kernelnewbies

On Wed, 06 Feb 2013 01:26:44 +0800, horseriver said:
>   During booting period .every device will have a node at /dev/ folder.
>   what is the detail of ths procedure?

'man udev'.  Although the details are a tad murkier for kernels after
2.6.32 that include CONFIG_DEVTMPFS in the config.

Also, note that not all systems will have a /dev/sda1 - that assumes a
partition table on a particular type of disk handled by a specific device
driver.  If that disk has no recognizable partition table, it will just have a
/dev/sda entry.  If the disk is driven by a different driver, you'll see
/dev/hda entries instead.  And if your boot storage device is an SD card
or something, you may have /dev/mmc0 or other entries.

And this:

[~] ls -l /dev/sdre1
brw-rw---- 1 root disk 133, 385 2012-11-27 05:17 /dev/sdre1

is how I pay the rent. :)  (Bonus points if you can figure out why
my system reports that. :)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 865 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130205/90b8bd95/attachment.bin 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* When does the /dev/sda1 node comes into being ?
  2013-02-05 17:26 When does the /dev/sda1 node comes into being ? horseriver
  2013-02-06  4:29 ` Valdis.Kletnieks at vt.edu
@ 2013-02-06  6:45 ` Peter Teoh
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Teoh @ 2013-02-06  6:45 UTC (permalink / raw)
  To: kernelnewbies

i think it depends.   some are softlinks in /dev/ some are created by udev
after udevd read the configuration file, many scenario involved (just
search for "util_create_path" inside udev source codes and u can what are
all the situation).

but for harddisk (whose partition is also the rootfs) /dev/sda is created
during kernel booting up (inside the initrd file, just gunzip and extract
out the cpio file, eg, view the file scripts/local and u can see it make
the /dev/sdXXXX nodes based on /sys/block/XXXX information, which in turn
depends on the kernel calling xxxx_device_register() functions (there a few
variations of them - organized hierarchically)).

on the other hand, if /dev/sda is not the rootfs, but just a normal
harddisk listed in /etc/fstab, then likely it is mounted by udev, detecting
it, and then calling (indirectly from userspace to kernel)
sd_probe_async(), which will then printk() out the "Write Protect is off"
message in your dmesg output - anytime u plug in the harddisk u can see
this.

On Wed, Feb 6, 2013 at 1:26 AM, horseriver <horserivers@gmail.com> wrote:

> hi:)
>
>   During booting period .every device will have a node at /dev/ folder.
>   what is the detail of ths procedure?
>
> thanks!
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
Regards,
Peter Teoh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130206/95ff981f/attachment.html 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-06  6:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-05 17:26 When does the /dev/sda1 node comes into being ? horseriver
2013-02-06  4:29 ` Valdis.Kletnieks at vt.edu
2013-02-06  6:45 ` Peter Teoh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.