Subject: Re: Attaching additional HDD - such simple(?) thing not without
To: Zbigniew Baniewski <zb@ispid.com.pl>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: netbsd-users
Date: 05/23/2006 23:06:50
On Wed, 24 May 2006 03:58:47 +0200, Zbigniew Baniewski <zb@ispid.com.pl>
wrote:
> On Tue, May 23, 2006 at 09:29:11PM -0400, Steven M. Bellovin wrote:
>
> > Here's a suggestion I've made in the past (and implemented ~25 years ago):
> > use the volume label and mount things like /dev/dsk/myvol/a, etc.
>
> You mean something "udev-style"? I wasn't aware it's possible under NetBSD.
> Perhaps a link to some more detailed docs?
I implemented it under AU, Amdahl's mainframe Unix port. That was a
*long* time ago -- they ported 7th Edition...
My suggestions were made on assorted NetBSD mailing lists --- probably
current-users, possibly the super-secret developers-only mailing list. I
could dig it up, but it's not worth the effort. I hadn't heard of udev;
looking at the documentation, it's not a bad idea, though it's rather more
complex than what I had in mind. Still, it's solving more problems, such
as names for USB printers; I don't know that I'd come up with anything
better.
For my scheme, you'd have to play around a bit with /etc/rc and with the
very early rc.d scripts. The root fsck would need to depend on the
kern.root_device sysctl; once root was clean, you could mount a tmpfs or a
special file system on /dev/dsk. You then have a script that looks at
hw.disknames, uses disklabel to learn the 'disk' value (I think it's that
and not 'label'), create subdirectory for it, and then symlinks for each
partition in the slice. Bundle most of that into a script that can be
invoked for, say, a USB disk if/when we get the event-handler.
--Steven M. Bellovin, http://www.cs.columbia.edu/~smb