mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Gooch <rgooch@ras.ucalgary.ca>
To: AJ Lewis <lewis@sistina.com>
Cc: Goswin Brederlow <goswin.brederlow@student.uni-tuebingen.de>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: devfs and /proc/ide/hda
Date: Fri, 27 Apr 2001 10:22:49 -0600	[thread overview]
Message-ID: <200104271622.f3RGMn703075@vindaloo.ras.ucalgary.ca> (raw)
In-Reply-To: <20010427110935.C1632@sistina.com>
In-Reply-To: <3A9CCA76.3E6AB93A@optushome.com.au> <20010228161023.A19929@win.tue.nl> <20010301084133.C16667@sistina.com> <87snkov3uk.fsf@mose.informatik.uni-tuebingen.de> <20010427110935.C1632@sistina.com>

AJ Lewis writes:
> 
> --CblX+4bnyfN0pR09
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
> Content-Transfer-Encoding: quoted-printable
> 
> On Thu, Mar 08, 2001 at 01:32:03PM +0100, Goswin Brederlow wrote:
> >      > What it should do is change based on whether devfs is mounted
> >      > or not.  It doesn't make *any* sense to have
> >      > /dev/ide/host0/foo/bar in your /proc/partitions entries if you
> >      > aren't mounting devfs.  The /proc/partitions entry is the only
> >      > way I know of for something like LVM to determine which devices
> >      > to scan for Volume Groups.  If you can't read /proc/partitions,
> >      > it has to attempt to scan all block devices it recognizes,
> >      > regardless of whether they are actually on the system or not.
> >      > This can take several minutes.
> >=20
> > First:
> >=20
> > % cat /proc/partitions=20
> > major minor  #blocks  name
> >=20
> >    3     0   20010816 ide/host0/bus0/target0/lun0/disc
> >    3     1     192748 ide/host0/bus0/target0/lun0/part1
> >    3     2     249007 ide/host0/bus0/target0/lun0/part2
> >    3     3          1 ide/host0/bus0/target0/lun0/part3
> >    3     5     289138 ide/host0/bus0/target0/lun0/part5
> >    3     6    1951866 ide/host0/bus0/target0/lun0/part6
> >    3     7     979933 ide/host0/bus0/target0/lun0/part7
> >    3     8   16346106 ide/host0/bus0/target0/lun0/part8
> >   33     0   80043264 ide/host2/bus0/target0/lun0/disc
> >   33     1   80035798 ide/host2/bus0/target0/lun0/part1
> >=20
> > So its already right.
> 
> Only if devfs is mounted.  That's my point.  Maybe it's an corner
> case to have devfs compiled into the kernel, but not mounted, and so
> we can just ignore this, but it seems to me that /proc/partitions
> should reflect which /dev system is currently running.

I consider it a corner case. There isn't really an alternative.
Firstly, it would be really messy to magically change the output of
/proc/partitions depending on whether devfs was mounted. Secondly,
just because it's mounted doesn't mean it's mounted on /dev, so it's
still easy to get wrong.

> > Secondly with devfs, why not just scan all /dev/discs/?
> >=20
> > % ls -l /dev/discs=20
> > total 0
> > lr-xr-xr-x    1 root     root           30 Jan  1  1970 disc0 -> ../ide/h=
> ost0/bus0/target0/lun0/
> > lr-xr-xr-x    1 root     root           30 Jan  1  1970 disc1 -> ../ide/h=
> ost2/bus0/target0/lun0/
> >=20
> > Also if lvm opens all known devices by way of /dev/whatever while
> > scanning, it will only find existing devices there with devfs.
> 
> Yeah, as long as devfs is running, that makes sense.

If you want a really robust solution, have your tool scan
/proc/filesystems and see if devfs is available. If not, scan
/proc/partitions. If devfs is available, then create a temporary mount
point and mount it there, then scan $mntpoint/discs.

				Regards,

					Richard....
Permanent: rgooch@atnf.csiro.au
Current:   rgooch@ras.ucalgary.ca

      parent reply	other threads:[~2001-04-27 16:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-28  9:52 Glenn McGrath
2001-02-28 10:29 ` Helge Hafting
2001-02-28 10:29   ` Glenn McGrath
2001-02-28 11:58     ` Pierre Rousselet
2001-02-28 15:15     ` Guest section DW
2001-02-28 15:10 ` Guest section DW
2001-03-01 14:41   ` AJ Lewis
2001-03-08 12:32     ` Goswin Brederlow
2001-04-27 16:09       ` AJ Lewis
2001-04-27 16:22       ` Richard Gooch [this message]

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=200104271622.f3RGMn703075@vindaloo.ras.ucalgary.ca \
    --to=rgooch@ras.ucalgary.ca \
    --cc=goswin.brederlow@student.uni-tuebingen.de \
    --cc=lewis@sistina.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®