On Oct 17, 2012, at 6:48 AM, dexen deVries wrote:
> a technical and organizational problem: back then Linux' /dev consisted of 
> special files held on drive, its MAJOR/MINOR schema* getting dangerously 
> cramped.
> 
> those days Linux' /dev is usually mounted at boot and maintained by kernel, 
> somewhat alike /proc; adding some more entries probably isn't that much of a 
> problem.

You should explore /sys on Linux. They've embraced namespaces in a major way.

$ df /sys
Filesystem           1K-blocks      Used Available Use% Mounted on
sysfs                       0K        0K        0K   -  /sys
$ ls -lR /sys |wc
  10485   63451  419873
$ ls -l /sys/dev/block/8:1
lrwxrwxrwx. 1 root root 0 Oct 17 11:31 /sys/dev/block/8:1 -> 
../../devices/pci0000:00/0000:00:0d.0/host2/target2:0:0/2:0:0:0/block/sda/sda1

Let us see where this leads:

$ ls -Ll /sys/dev/block/8:1
total 0K
-r--r--r--. 1 root root 4096 Oct 17 11:31 alignment_offset
-r--r--r--. 1 root root 4096 Oct 17 11:31 dev
-r--r--r--. 1 root root 4096 Oct 17 11:31 discard_alignment
drwxr-xr-x. 2 root root    0 Oct 17 11:26 holders 
-r--r--r--. 1 root root 4096 Oct 17 11:31 inflight
-r--r--r--. 1 root root 4096 Oct 17 11:31 partition
drwxr-xr-x. 2 root root    0 Oct 17 11:31 power
-r--r--r--. 1 root root 4096 Oct 17 11:25 size
-r--r--r--. 1 root root 4096 Oct 17 11:31 start
-r--r--r--. 1 root root 4096 Oct 17 11:31 stat
drwxr-xr-x. 2 root root    0 Oct 17 11:31 subsystem
drwxr-xr-x. 2 root root    0 Oct 17 11:31 trace
-rw-r--r--. 1 root root 4096 Oct 17 11:31 uevent

Exploring further...

$ ls -l /sys/dev/block/8:1/subsystem
lrwxrwxrwx. 1 root root 0 Oct 17 11:31 /sys/dev/block/8:1/subsystem -> 
../../../../../../../../../class/block

Editorial comments left as an exercise to the reader!

Reply via email to