Summary: external disk drive boot challenge for old sunos gurus

From: Martin Meadows (PZXKYS@atdva3.atd.gmeds.com)
Date: Tue May 16 2000 - 06:26:29 CDT


Thanks to following people for the awesome help:
From: Thomas Knox <knoxth@cch.com>
From: Tim Evans <Tim_Evans@troweprice.com>
From: "Patrick L. Nolan" <pln@razzle.stanford.edu>
From: "Knudsen, Steven" <sdknuds@sandia.gov>
From: David Evans <daevans@us.oracle.com>
From: "Salehi, Michael E" <Mike.Salehi@usa.xerox.com>
From: Arthur Darren Dunham <add@netcom.com>
From: Kurt Werth ph3501 <werth@bns101.cs.lmco.com>
From: Matthew Stier <Matthew.Stier@tddny.fujitsu.com>
From: Carlo Musante <carlo@ucomm.wayne.edu>
From: Mark Hargrave <hargrme@wisdom.maf.nasa.gov>
From: "O'Neal, Chris" <onealwc@agedwards.com>
From: seeger@cise.ufl.edu (Charles Seeger)
From: Lefteris Skapetis <skapetis@intranet.gr>

My apologies if I missed anyone.

The problem:

>
> I have a sparc 10 running sunos 4.1.3_u1b with an internal drive going bad.
> I had 3 external drives already plugged into this sparc 10 and I just attempted
> to add a 4th external drive and boot from it. Drives sd0, sd1, sd2 & sd3 were
> already in use. I understand that scsi 4 is reserved for a tape drive. I set
> the new drive to scsi 5. Probe-scsi recognized it as target 5. I booted the
> system from sd0 (the drive to be replaced). The format command saw
> scsi device 5 as sd16. I was able to format sd16 and I created 3 new
> filesystems and mounted them as new_root, new_usr, new_home. I then proceeded
> to dump | restore new_usr and new_home and I did the same for new_root from
> single user mode. I changed new_root fstab from sd0* to sd16*. I installed
> the bootblock on sd16a. I then took the system down and made sd16 my boot
> device and started to bring the thing to life. It appears that when it
> attempts to mount sd16a (/) from fstab it chokes. I get the following message
> on my console: "can't open sd16a"
>

The resolution:
I never managed to get the system to boot from sd16. Based on the excellent
advice I received I changed sd16 in the kernel to sd5 and was able to boot
from sd5.

The suggestions:

******************************************************

I think that scsi 5 is reserved for some other scsi device, don't remember which one.
AFAIK, on sunos 4.1.x the default kernel configuration reserves scsi id's 0-3
for disks and the rest for other devices. You have to edit the kernel config
file, configure scsi id 4 or 5 for a disk, rebuild the kernel, install it and reboot.
The kernel configuration files should be under /usr/kvm/sys but i'm not absolutely
sure since it's been many years from the last time i did this :-)

******************************************************

Martin, you may need to make a change to the kernel. The "swap generic"
configuration may not support booting from id5/sd16a, though I am just
guessing. You may have to explicitly specify the boot and swap devices.

Less likely to help would be to remove the id5 tape and cdrom devices from
the kernel config file. Also, be sure the /dev/sd16* and /dev/rsd16*
devices exist in the new root file system. I think they are made by default,
but...

Hopefully, you have the bits loaded to build a new kernel. My SS-10 is
still set up to dual boot SunOS 4.1.4, but that precludes building a
kernel for you.

I've never used id5 as a boot drive. Even though it should be possible to
make it work, possibly with some other kernel changes, I would still want
to return the system to booting from an internal sd0 drive before declaring
the repair complete. In fact, you might find it easier just to swap the
drive ids around rather than building a new kernel.

******************************************************

I run SunOS 4.1.4 a lot. I have done what you have outlined below many
times. However I don't do it exactly as you have laid it out below.

After getting the boot block onto the new_root...
- I modify /new_root/etc/stab as needed.
- shut down system.
- remove the drive with root (the old root)
- change the new disk drives SCSI is to target 3
- boot system.

If I want to remount the original drive that has "old root", then I would
change its SCSI ID and out it as target 5 sd16.

Also be aware that you need to have all of these devices defined in
/usr/kvm/sys/sun4m/conf/${kernalName}

Look at the bottom of the file for SCSI def stuff.

Also please be advised that at that time, SUN recommend no more than 4 hard
disk drives on a single SCSI chain.

******************************************************

Martin,

I think this might help you:

in the file:

/usr/kvm/sys/sun4c/conf/GENERIC

under:

scsibus0 at esp # declare first scsi bus

Change:

tape st1 at scsibus0 target 5 lun 0 # second SCSI tape

-to-

disk sd5 at scsibus0 target 5 lun 0 # fifth hard SCSI disk

Rebuild the kernel:

cd /usr/sys/sun4c/conf

/usr/etc/config GENERIC

cd ../GENERIC

make

cp /vmunix /vmunix.orig

mv vmunix /vmunix

- Reboot system

- If System reboots ok, delete /vmunix.orig

- If not,

> b vmunix.orig

(fix problem and rebuild the kernel)

This should setup target 5 for you.

Hope this helps!

******************************************************

I think you should remove the old drive at SCSI ID 0 and replace it with
the new drive. SunOS expects that both ID 4&5 are tape drives and 6 is
the CDROM. If you want to keep 0 you will have to rebuild the kernel on
the new drive to change SCSI ID 5 from tape to hard disk. I suppose the
procedure can be found by a search on www.metacrawler.com.

******************************************************

The SunOS 4 kernel expects target 4 and 5 to be tape drives, and unless the kernel
is recompiled, I don't beleive it will accept target 5 as a boot disk.

******************************************************

Do you have the fifth disk defined in the kernel config file?

******************************************************

It's not that 4 is reserved for tape. It's that SunOS 4x. has static
definitions of hard drives at 0-3 *only*.

To add another hard drive, you have to build a new kernel. It's not
that bad. man config to get the whole idea.

Check your /etc/motd file to see what kernel you're using now (it's in
parenthesis and will be GENERIC unless you've made changes).

Go into the GENERIC config and find the section for scsi drives. Find
the section where you've got scsi 0-3 and modify it to use id 4 also (or
whatever you want).

Build a new kernel, put it in place, reboot. Keep the old kernel
around, you can boot from an alternate kernel with..

boot vmunix.old

or whatever you've named it.

******************************************************

        I have no SunOS around to be precise, but anyway you may have to
rebuild the kernel. Look to see if an sd for that
target is defined, if not you have to rebuild the kernel. Also
make sure you put the boot blk using installboot.

******************************************************

http://www.cs.uu.nl/wais/html/na-dir/comp-sys-sun-faq.html

Subject: FAQ: Sun Computer Administration Frequently Asked Questions

66) I just restored my root partation and now I cannot boot.
        What is wrong?

        You probably need to run installboot. Under Solaris 1, boot
        from cdrom, boot the miniroot, mount the root filesystem on
        /mnt, and reinstall the boot block:

            cd /usr/kvm/mdec # note - miniroot's usr, not sd0's
            installboot -vlt /mnt/boot bootsd /dev/rsd0a

        For Solaris 2, the equivalent command, which may also live
        outside the miniroot, would be:

            /usr/sbin/installboot /usr/lib/fs/ufs/bootblk \
            /dev/rdsk/c0t0d0s0

        Under Solaris 1, if only your /vmunix is bad, you may not need
        to restore anything from tape. Before running installboot:

            cp /mnt/usr/kvm/sys/<arch>/<kernel>/vmunix /mnt/vmunix

Solaris 1 = SunOS 4.x + Openwindows.

So according to this just do what you would do under Solaris 2.x,
run installboot.

******************************************************

If I recall correctly sd5 is set up to be scsi tape 1 in the kernel, you can
change that or scsi 4 for that matter and rebuild, but as 4.1.3 comes I
don't think that works

******************************************************

How about swap space? To the best of my memory, SunOS 4 kernels by
default would assume that swap is found on the b partition of the
boot disk. You could add more swap partitions through fstab, but you
would have to build a new kernel to override the default behavior.

This doesn't really look like it corresponds to the error message
you are seeing, but you should probably keep it in mind.

Another thing to check would be if sd16 is really the proper way
to specify a disk in fstab. I really don't remember the full details
of this. Look in /dev to see what's there.

******************************************************

SCSI target 5 is also reserved for tape drives in 4.x.x. If you want to use
it for a disk, you need to reconfigure and rebuild the kernel.

******************************************************

Did you do a "boot -r" when you brought the system back up?



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:14:08 CDT