Subject: Re: Indirect file system mount
To: None <tech-kern@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 03/02/2004 02:18:24
> Well, IMHO the problem is obvious - when i remove wd0 or wd1 disk
> from my PC, the order of detected IDE disks is shifted so i do not
> have anymore for example /dev/wd1a as system root course now it's
> located on /dev/wd0a.  So every time i need to fix /etc/fstab
> manually when something's changed.

The usual approach to this is to build a kernel with a slightly
different config.  Exactly what the changes will be depends on where
your disks are attached.

You don't say which port you're using.  You do mention having NTFS,
FAT32, and Linux on the disks, which if I'm not mistaken means either
i386 or alpha (AFAIK nothing else runs NT, NetBSD, and Linux), most
probably i386.  (People running alphas tend to mention that they're
using alphas; also, there are probably more i386 machines out there
than any other single port, possibly even more than all other ports put
together.)

I would guess the commonest case these days is that your disks attach
at pciide, as indicated by boot-time messages like

	wd0 at pciide0 channel 0 drive 0: <MAXTOR 6L040J2>

	wd1 at pciide0 channel 0 drive 1: <IBM-DPTA-372730>

In that case, edit your kernel config to add lines

	wd0 at pciide0 channel 0 drive 0
	wd1 at pciide0 channel 0 drive 1
	wd2 at pciide0 channel 1 drive 0
	wd3 at pciide0 channel 1 drive 1

(or whatever the actual locations are) and all four wd disks will be
nailed down - for example, if you pull wd1, wd2 and wd3 will not
magically get renamed to wd1 and wd2; instead, wd1 simply won't exist.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B