SUMMARY: boot from another disk

From: Marina Daniels (Marina.Daniels@ccd.tas.gov.au)
Date: Wed Apr 02 1997 - 18:38:20 CST


*** ORIGINAL QUESTION ***********************
>
> I lost my boot disk on a Solaris 2.5 system so I restored the filesystems
> concerned onto a different disk c1t1d0 and did an installboot but now I don't
> know how to tell it to boot from this disk instead.
>
> I know you're meant to use "boot diskX:X" but I tried
>
> boot disk1:0
> and
> boot disk1:1 with no luck
>
> How am I meant to work out what numbers to use for "c1t1d0"?
Marina
****************************

Sorry this summary is so late.
Thanks very much to :

Francisco Castro Casta~no paco@divisa.dvnet.es
David Montgomery <david@cs.newcastle.edu.au
Glenn Satchell - Uniq Professional Services <Glenn.Satchell@uniq.com.au>
Jon Anderson <jon.anderson@gs.com>
Mark Hargrave, meh@wisdom.maf.nasa.gov
jbwendl@mtb.phil.mop.com (James Wendling)
Jens Fischer <jefi@kat.ina.de>
negativl@netcom.com (Raymond Wong)

sorry if I've forgotten anybody.

from Jon:

A good reference guide can be found at:
http://www.sun.com/sunworldonline/swol-10-1995/swol-10-openboot.html
*****

also, important to remember (from jbwendl)
You have to remember that vfstab will need to have the disk names changed also
or nothing will mount.
*****

from Francisco:

You can do:
Example:

        cd /dev/dsk
        ls -l c0t0d0s5 (if 5 is the boot slice )

                ../../devices/sbus@1,f8000000/esp@0,800000/sd@0,0:f

At the prompt, to write
        ok> nvalias 'name' ../../devices/sbus@1,f8000000/esp@0,800000/sd@0,0:a
        ok> setenv boot-device 'name'

'name' is a word (eg: "diskb")

-
*******

from Glenn:
The boot prom command devalias which list the paths associated with the default
boot device names. 'disk1' defaults to c0t1d0s0, the :X on the end is the slice
on the disk.

The path for each of the devices will be something like
/iommu@123456/sbus@123456/..... This path wuill also be
different for the second scsi bus (c1) and it may also be
different on different systems (eg SS20 and Ultra).

If you have a similarly configured system you can work it out by
looking at the boot /var/adm/messages for that system, eg, on my
system (an SS2):

Mar 9 22:07:02 upstage unix: sbus0 at root: obio 0xf8000000
Mar 9 22:07:02 upstage unix: dma0 at sbus0: SBus slot 0 0x400000
Mar 9 22:07:02 upstage unix: esp0 at sbus0: SBus slot 0 0x800000 SBus level 3 s
parc ipl 3
Mar 9 22:07:02 upstage unix: sd0 at esp0: target 0 lun 0
Mar 9 22:07:02 upstage unix: sd0 is /sbus@1,f8000000/esp@0,800000/sd@0,0
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

You need to find the corresponding string for c1t1d0. What
doesn't help is that they use different naming conventions (sd0
is c0t0d0), I'm not sure what c1t1d0 will be, however the bit as
the end (sd@0,0) is the target and lun so yo'er looking for
something that ends in sd@1,0.

Another option is to move this disk onto the builtin scsi
controller so you can use 'boot disk1' or something that is
already setup.

Once you work it out you can use the boot prom command 'nvalias'
to set up a permanent naming scheme so that next time you can
say 'boot mydisk' and get the nwe root disk.

Hope this helps.

********
from Jens:

the diskX:X notation which you have tried is used to select different slices
on disks on Controler 0, e.g. boot disk1:2 means "boot from slice 2 of disk
with SCSI-ID 1 on controler 0" if you haven't changed the default devaliases.
What you realy need to do is to boot from a disk on a different controler (1),
and for these disks there are no devaliases defined. Therefore you either have
to setup your own alias for this disk or you have to use the full hardware path
to your disk at the boot command. You can find the hardware path to the disk
with
show-disks at the PROM mode, devlias gives you a list of the predefined aliases.
The appended summary describes how to setup your own aliases:-

Original Question;

Sun Managers;

I know how to change the values of those variables displayed when I issue
the "printenv" command with "setenv"

for example: setenv boot-device=disk

Now my question, how would I change the value of those variables displayed
when I issue the "devalias" command? I want to change the value of disk.

Answer -1 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
nvalias newdisk /io-unit......
                or nvedit
                then
        nvstore
        nvrun
        reset

works for me!

Answer-2 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
you can change devalias values using the devalias command as follows

ok devalias disk /sbus@0,e800000/esp@0,8000000/sd@3,0:a (for example)

it is also possible to create new device aliases in the same way, for example

ok devalias diskb /sbus@0,e800000/esp@0,8000000/sd@3,0:b

creates a new device alias diskb

Answer-3 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

To change the value of a devalias you need to do the following:

devalias alias-name device-path

It seems that diskX:X in the boot prom is really just an alias set up with
setenv...

you need make sure that the alias you are using points to the right device. Do
a 'devalias' at the ok prompt and take a look at diskX. Make sure that the
path is correct on the system. Then try boot using 'boot diskX'.

so for example,
I wanted to boot from c1t1d0s0 so...

cd /dev/dsk
ls -l c1t1d0s0 shows:

lrwxrwxrwx 1 root root 79 Mar 21 12:17 c1t1d0s0 ->
.../../devices/iommu@f,e0000000/sbus@f,e0001000/dma@0,81000/esp@0,80000/sd@1,0:a

At the boot prompt, write
        ok> nvalias 'name'
devices/iommu@f,e0000000/sbus@f,e0001000/dma@0,81000/esp@0,80000/sd@1,0:a

        ok> setenv boot-device 'name' where 'name' is a word like `diskb'

or just use boot `name'



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:49 CDT