Subject: Re: Newbie Question
To: None <port-sparc@netbsd.org>
From: Ben Cottrell <tamino@wolfhut.org>
List: port-sparc
Date: 09/14/2001 21:04:42
On Sat, 15 Sep 2001 13:32:48 +1000, Grant Beattie wrote:
> In the GENERIC kernel, sd device numbers are dynamically allocated
> based on scsi-id, which may cause havoc if the new disk has a lower
> scsi-id than the existing one.

To elaborate on what Grant said, whenever the system boots it will
probe all the SCSI devices starting from the lowest SCSI ID and going
up; the first disk it finds will be sd0, the second will be sd1, etc.

So, as long as you set the new disk to a higher SCSI ID than the
existing one, then the disk that has always been probed as sd0 will
continue to be probed as sd0, and everything will be happy.

Once you've gotten sd1 (the new disk) to show up in your dmesg
output, you'll probably want to run something like:

	disklabel sd1 > /tmp/disklabel
	vi /tmp/disklabel
	disklabel -R -r sd1 /tmp/disklabel

The first line will put a default disklabel (the one the kernel
automatically puts together when it can't find a valid disklabel
on the disk) into a file. You'll get some warnings; this is okay.

Edit the disklabel to your heart's content, keeping in mind that
you should leave the "c" partition exactly the way it is. You will
also need to edit "3 partitions" so that it says "8 partitions",
or else only the first 3 will actually get written. 8 ("a" through
"h") is the maximum with the default setup.

The third command will put the edited disklabel back onto sd1 (the
-R flag) and will do so in a way which will not be affected by the
fact that it doesn't have a disklabel already (the -r flag).

Once the disk has a valid disklabel of some sort, you can thereafter
edit it with:

	disklabel -e sd1

In other words, the rigmarole with -r is only necessary the first
time.

After that's done, read the man pages for "newfs", "mount", and
"fstab", and take a look at the /usr/mdec/binstall script if you
will be wanting to boot off this new disk.

Urf. I'm procrastinating. I really should vacuum. I think I'll go
do that now ;-)

	~Ben