9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Bakul Shah <bakul@bitblocks.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] I found this discussion pretty funny
Date: Wed, 17 Oct 2012 12:04:43 -0700	[thread overview]
Message-ID: <63CDD553-2399-4283-9FFF-CB39F2F95151@bitblocks.com> (raw)
In-Reply-To: <9128765.rfzXBNVfCE@coil>


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	other threads:[~2012-10-17 19:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-17 13:40 ron minnich
2012-10-17 13:47 ` erik quanstrom
2012-10-17 13:48 ` dexen deVries
2012-10-17 19:04   ` Bakul Shah [this message]
2012-10-18  0:35     ` erik quanstrom
2012-10-18  1:10       ` Bakul Shah
2012-10-18 20:31         ` David Leimbach
2012-10-18 20:45           ` Charles Forsyth
2012-10-17 14:23 ` cinap_lenrek
2012-10-17 16:31   ` Charles Forsyth
2012-10-17 18:28     ` cinap_lenrek
2012-10-17 19:47       ` Francisco J Ballesteros
2012-10-17 17:54 ` tlaronde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=63CDD553-2399-4283-9FFF-CB39F2F95151@bitblocks.com \
    --to=bakul@bitblocks.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).