Skip navigation

Category Archives: Solaris

I have my reasons for this…

Now that sun have killed SXCE and in doing so probably the future of the Solaris platform, I’m undoubtedly going to need a opensolaris box to play with..

So … As perverse as it sounds, we’re going to poke and prod opensolaris in some hopefully not too unfamiliar ways, and try to get it to live alongside S10, inside the S10 created, ZFS v15 zpool …

At the moment I have a S10U8 workstation with two zpools which looks like this:

root@insomnia:/var/tmp > uname -a
SunOS insomnia 5.10 Generic_142901-03 i86pc i386 i86pc
root@insomnia:/var/tmp > zpool status
pool: data
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
data ONLINE 0 0 0
c1d0p2 ONLINE 0 0 0

errors: No known data errors

pool: rpool
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
c1d0s0 ONLINE 0 0 0

errors: No known data errors

I have two S10 BE’s set up on here:

root@insomnia:/var/tmp > lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
————————– ——– —— ——— —— ———-
s10u8_1 yes yes yes no –
s10u8_2 yes no no yes –

First thing to do, is create another BE for OpenSolaris:

root@insomnia:~ > lucreate -c s10u8_1 -n snv_130
Checking GRUB menu…
Analyzing system configuration.
Comparing source boot environment file systems with the file
system(s) you specified for the new boot environment. Determining which
file systems should be in the new boot environment.
Updating boot environment description database on all BEs.
Updating system configuration files.
Creating configuration for boot environment .
Source boot environment is .
Creating boot environment .
Cloning file systems from boot environment to create boot environment .
Creating snapshot for on .
Creating clone for on .
Setting canmount=noauto for in zone on .
Creating snapshot for on .
Creating clone for on .
Creating snapshot for on .
Creating clone for on .
Creating snapshot for on .
Creating clone for on .
Saving existing file in top level dataset for BE as //boot/grub/menu.lst.prev.
Saving existing file in top level dataset for BE as //boot/grub/menu.lst.prev.
File propagation successful
Copied GRUB menu from PBE to ABE
No entry for BE in GRUB menu
Population of boot environment successful.
Creation of boot environment successful.
root@insomnia:~ >

Next, check everything is there. Mount it, and rm everything from it.
(You should probably be a careful here and take a snapshot of your root zvol…)

root@insomnia:~ > lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
————————– ——– —— ——— —— ———-
s10u8_1 yes yes yes no –
s10u8_2 yes no no yes –
snv_130 yes no no yes –
root@insomnia:~ > zfs set mountpoint=/a rpool/ROOT/snv_130
root@insomnia:~ > zfs mount rpool/ROOT/snv_130
root@insomnia:~ > cd /a
root@insomnia:/a > ls
bin devices lib proc system
boot etc mnt reconfigure tmp
core export net rmdisk usr
Desktop home opt rpool var
dev kernel platform sbin vol
root@insomnia:/a > rm -rf /a/*
root@insomnia:/a >

Finally, lets share this out over NFS.

root@insomnia:~ > share -F nfs -o rw,anon=0 /a
root@insomnia:~ > share
– /a rw,anon=0 “”

Now for the Opensolaris install.

Download and install the latest opensolaris (at the time of writing, build 130) and get it inside VirtualBox.

I did nothing particularly unusual here, standard 64 bit VirtualBox vm with 768mb of memory.

Booted into the installer looks like this:

Once the installer completes, we don’t want to reboot..

Select ‘quit’ instead of reboot, and open a term.

Mount our NFS shared area, and the opensolaris install, and copy everything over:

jack@opensolaris:~$ pfexec su –
Sun Microsystems Inc. SunOS 5.11 snv_130 November 2008
root@opensolaris:~# zfs set mountpoint=legacy rpool/ROOT/opensolaris
root@opensolaris:~# mount -F zfs rpool/ROOT/opensolaris /a
root@opensolaris:~# mkdir /b
root@opensolaris:~# mount -F nfs 10.0.0.2:/a /b
root@opensolaris:~# cd /a
root@opensolaris:/a# find . | ptime cpio -pvdum /b

7313440 blocks

real 3:37:17.419601197
user 29.642283189
sys 15:36.499440337
root@opensolaris:/a#

YMM (hopefully) V on the amount of time this takes to complete… Well over three hours. Ehehem….

So, once this finally completes, we can shutdown the vm and leave it alone..

Next up is a bit of fixup:

root@insomnia:/a > cd etc
root@insomnia:/a/etc > mkdir vbox_files
root@insomnia:/a/etc > mv path_to_inst path_to_inst.old zfs/zpool.cache driver_* vbox_files/
root@insomnia:/a/etc > cp /etc/path_to_inst /etc/zfs/zpool.cache /etc/driver_* .
root@insomnia:/a/etc > touch /a/reconfigure

I hit an issue here, where, as the username I had created for my user account in the installer was not the same as the one I used in the old BE so as such there was no home directory for the user.

You probably want to fix this before you reboot, as thanks to whichever bright spark decided to remove the ‘console login’ option from GDM and worse still, disable the ctrl+alt+backspace hotkey, means you’ll need to boot back to your S10 BE to fix..

Next, unmount:

root@insomnia:/a/etc > cd /
root@insomnia:/ > umount /a

Add an entry to /rpool/boot/grub/menu.lst for the new BE:

title OpenSolaris snv_130
findroot (pool_rpool,0,a)
bootfs rpool/ROOT/snv_130
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/$ISADIR/boot_archive

Reboot and be sure to choose our new BE from the grub menu.

A short reboot later, and we’re in the OpenSolaris snv_130 BE!

bash-4.0$ uname -a
SunOS insomnia 5.11 snv_130 i86pc i386 i86pc
bash-4.0$ pfexec /usr/sbin/beadm list
BE Active Mountpoint Space Policy Created
— —— ———- —– —— ——-
s10u8_2 – – 281.5K static 2010-01-17 22:16
s10u8_1 R – 9.29G static 2009-12-02 12:43
snv_130 N / 1.69G static 2010-01-17 22:43

Notice how beadm plays with my S10 BEs.

The final result:

Any of you actually patient enough to try this, have fun! ūüôā

~h

I’ve been given the task of writing some perl scripts which will run on a Solaris 10 machine and¬†communicate with an Oracle¬†10g¬†XE database which in turn¬†is living on a RHEL5 box.

While I have some experience installing/patching Oracle, I’ve never written a script which communicates directly with it – so¬†this¬†should be a good learning exercise.

There’s a simple table in the database called “SM_USER_CONFIG” which contains a few rows just for testing.

The first step I feel, is to get the machine communicating with the database via sqlplus.

To do this, we need to install “Instant Client” – We want “Basic” “Sqlplus” and “SDK”

(available from http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/solx86soft.html)

I extracted all of these to /opt/instantclient:

(TCSUNDEV01:/opt/instantclient) sysmgr > ls
classes12.jar  libclntsh.so.10.1*  libocci.so.10.1*  libsqlplus.so*    sdk/        tnsnames.ora
glogin.sql     libnnz10.so*        libociei.so*      libsqlplusic.so*  sqlnet.log
libclntsh.so@  libocci.so@         libocijdbc10.so*  ojdbc14.jar       sqlplus*

We need to create a /opt/instantclient/tnsnames.ora file like this:

XE.WORLD =
  (DESCRIPTION =
    (ADDRESS_LIST =
        (ADDRESS =
          (COMMUNITY = tcp.world)
          (PROTOCOL = TCP)
          (Host = 10.17.58.22)
          (Port = 1521)
        )
    )
    (CONNECT_DATA = (SID = XE)
    )
  )

Lets try and connect with SQL plus:

(TCSUNDEV01:~) sysmgr > setenv TNS_ADMIN /opt/instantclient/
(TCSUNDEV01:~) sysmgr > /opt/instantclient/sqlplus username/password@XE.WORLD

SQL*Plus: Release 10.2.0.2.0 – Production on Thu Jun 25 19:16:00 2009
Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 – Production

SQL> SELECT USERNAME
  2  FROM SM_USER_CONFIG
  3  /

USERNAME
——————————
HoustonN
UserTest
TestUser 

SQL>

Cool, it works.

Next up is perl. We will build DBD::Oracle for this. Head over to cpan and download the src. We’re using CSWperl from blastwave.

(TCSUNDEV01:/var/tmp) sysmgr > gzcat /tmp/DBD-Oracle-1.23.tar.gz | gtar -xf –
(TCSUNDEV01:/var/tmp) sysmgr >cd DBD-Oracle-1.23
(TCSUNDEV01:/var/tmp/DBD-Oracle-1.23) sysmgr > setenv TNS_ADMIN /opt/instantclient/
(TCSUNDEV01:/var/tmp/DBD-Oracle-1.23) sysmgr > setenv LD_LIBRARY_PATH /opt/instantclient/
(TCSUNDEV01:/var/tmp/DBD-Oracle-1.23) sysmgr > setenv ORACLE_SID XE
(TCSUNDEV01:/var/tmp/DBD-Oracle-1.23) sysmgr > perl Makefile.PL -V 10.2.0.1

Using DBI 1.604 (for perl 5.008008 on i86pc-solaris-thread-multi) installed in /opt/csw/lib/perl/csw/auto/DBI/

Configuring DBD::Oracle for perl 5.008008 on solaris (i86pc-solaris-thread-multi)

Remember to actually *READ* the README file! Especially if you have any problems.

Trying to find an ORACLE_HOME
Found /opt/instantclient/

WARNING: Setting ORACLE_HOME env var to /opt/instantclient/ for you.
WARNING: If these tests fail you may have to set ORACLE_HOME yourself!
Installing on a solaris, Ver#2.8
Using Oracle in /opt/instantclient/
SP2-1503: Unable to initialize Oracle call interface
SP2-0152: ORACLE may not be functioning properly

            If sqlplus failed due to a linker/symbol/relocation/library error or similar problem
¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† then it’s likely that you’ve not configured your environment correctly.
            Specifically, your LD_LIBRARY_PATH environment variable
            set to include the directory containing the Oracle libraries.

Forcing Oracle version to be treated as 10.2.0.1
Oracle version 10.2.0.1 (10.2)
Looks like an Instant Client installation, okay
Your LD_LIBRARY_PATH env var is set to ‘/opt/instantclient/’
Oracle sysliblist:
Found header files in /opt/instantclient//sdk/include.

Checking for functioning wait.ph
System: perl5.008008 sunos thor 5.8 generic_117351-51 i86pc i386 i86pc
Compiler:   cc -xO3 -xtarget=generic -xarch=generic -D_REENTRANT -xO3 -xtarget=generic -xarch=generic -I/opt/csw/bdb44/include -I/opt/csw/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
Linker:     /usr/ccs/bin/ld
Sysliblist:
Linking with -lclntsh.

LD_RUN_PATH=/opt/instantclient
Using DBD::Oracle 1.23.
Using DBD::Oracle 1.23.
Using DBI 1.604 (for perl 5.008008 on i86pc-solaris-thread-multi) installed in /opt/csw/lib/perl/csw/auto/DBI/
Writing Makefile for DBD::Oracle

***¬† If you have problems…
     read all the log printed above, and the README and README.help.txt files.
¬†¬†¬†¬† (Of course, you have read README by now anyway, haven’t you?)

Notice the warning about sqlplus failing above. As we’re building this on a CLIENT, when sqlplus is invoked it doesn’t specify @XE.WORLD (default is to connect to a¬†local database)- We can just ignore this.

Go ahead and run “make install”

(TCSUNDEV01:/var/tmp/DBD-Oracle-1.23) sysmgr > pfexec gmake install
Skip blib/lib/DBD/Oracle.pm (unchanged)
Skip blib/lib/oraperl.ph (unchanged)
Skip blib/arch/auto/DBD/Oracle/dbdimp.h (unchanged)
Skip blib/arch/auto/DBD/Oracle/ocitrace.h (unchanged)
Skip blib/lib/Oraperl.pm (unchanged)
Skip blib/arch/auto/DBD/Oracle/Oracle.h (unchanged)
Skip blib/lib/DBD/Oracle/Object.pm (unchanged)
Skip blib/arch/auto/DBD/Oracle/mk.pm (unchanged)
Skip blib/lib/DBD/Oracle/GetInfo.pm (unchanged)
cc -c¬† -I/opt/instantclient//sdk/include -I/opt/csw/lib/perl/csw/auto/DBI -D_REENTRANT -xO3 -xtarget=generic -xarch=generic -I/opt/csw/bdb44/include -I/opt/csw/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xO3 -xtarget=generic -xarch=generic¬†¬† -DVERSION=\”1.23\” -DXS_VERSION=\”1.23\” -KPIC “-I/opt/csw/lib/perl/5.8.8/CORE”¬† -DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\”10.2.0.1\” Oracle.c
cc -c¬† -I/opt/instantclient//sdk/include -I/opt/csw/lib/perl/csw/auto/DBI -D_REENTRANT -xO3 -xtarget=generic -xarch=generic -I/opt/csw/bdb44/include -I/opt/csw/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xO3 -xtarget=generic -xarch=generic¬†¬† -DVERSION=\”1.23\” -DXS_VERSION=\”1.23\” -KPIC “-I/opt/csw/lib/perl/5.8.8/CORE”¬† -DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\”10.2.0.1\” dbdimp.c
cc -c¬† -I/opt/instantclient//sdk/include -I/opt/csw/lib/perl/csw/auto/DBI -D_REENTRANT -xO3 -xtarget=generic -xarch=generic -I/opt/csw/bdb44/include -I/opt/csw/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xO3 -xtarget=generic -xarch=generic¬†¬† -DVERSION=\”1.23\” -DXS_VERSION=\”1.23\” -KPIC “-I/opt/csw/lib/perl/5.8.8/CORE”¬† -DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\”10.2.0.1\” oci8.c
Running Mkbootstrap for DBD::Oracle ()
chmod 644 Oracle.bs
rm -f blib/arch/auto/DBD/Oracle/Oracle.so
LD_RUN_PATH=”/opt/instantclient” cc¬† -G -L/opt/csw/bdb44/lib -L/opt/csw/lib -L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/prod/lib -L/lib Oracle.o dbdimp.o oci8.o¬† -o blib/arch/auto/DBD/Oracle/Oracle.so¬† \
           -L/opt/instantclient/ -lclntsh       \

chmod 755 blib/arch/auto/DBD/Oracle/Oracle.so
cp Oracle.bs blib/arch/auto/DBD/Oracle/Oracle.bs
chmod 644 blib/arch/auto/DBD/Oracle/Oracle.bs
/opt/csw/bin/perl “-Iblib/arch” “-Iblib/lib” ora_explain.PL ora_explain
Extracted ora_explain from ora_explain.PL with variable substitutions.
cp ora_explain blib/script/ora_explain
/opt/csw/bin/perl “-MExtUtils::MY” -e “MY->fixin(shift)” blib/script/ora_explain
Manifying blib/man1/ora_explain.1
Manifying blib/man3/DBD::Oracle.3perl
Manifying blib/man3/DBD::Oraperl.3perl
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Writing /opt/csw/lib/perl/site_perl/auto/DBD/Oracle/.packlist
Appending installation info to /opt/csw/lib/perl/5.8.8/perllocal.pod
(TCSUNDEV01:/var/tmp/DBD-Oracle-1.23) sysmgr >

And test:

(TCSUNDEV01:/var/tmp/DBD-Oracle-1.23) sysmgr > perl -MDBD::Oracle -le ‘print $DBD::Oracle::VERSION;’
1.23

Finally, lets put togeather a little perl script to query our sample table:

 

use DBI;

$dbh = DBI->connect(‘dbi:Oracle:’, q{USER/PASSWORD@(DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.17.58.22)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
¬† )},””) or die DBI::errstr;

$dbstr = $dbh->prepare(“SELECT id, username, hostname FROM sm_user_config”);
$dbstr->execute;
$~ = TABLEHEADER;
write;

while (($rdbid, $rdbu, $rdbv) = $dbstr->fetchrow_array()) {
        $~ = TABLEENTRY;
        write;
}

$~ = TABLEBOTTOM;
write;
print “\n”;

 

format TABLEHEADER =

+——–+—————–+—————-+
| ID     |   User          |  VMName        |
+——–+—————–+—————-+
.

format TABLEENTRY =
| @<<<<< | @<<<<<<<<<<<<   | @<<<<<<<<<<<<< |
 $rdbid,   $rdbu,            $rdbv
.

format TABLEBOTTOM =
+——–+—————–+—————-+
.

 

Running it, we get:

 


(TCSUNDEV01:~) sysmgr > perl ora2.pl

+--------+-----------------+---------+
| ID | User | VMName |
+--------+-----------------+---------+
| 1 | HoustonN | VXPTEST39 |
| 3 | UserTest | VXPTEST2 |
| 2 | TestUser | VXPTEST5 |
+--------+-------------+-------------+

 

(Formatting got a bit messed up when I pasted, but you get the idea =)
Party on!

OpenSolaris 2009.06 was released a few days ago!

As it’s been a while since I’ve used this distro and I feel like creating my inaugural blog post; lets give it a spin.

The point of this exercise will be to have OpenSolaris 2009.06 and SXCE (nevada) b115 installed to the same zpool.

I’ve installed OpenSolaris 2009.06 to the 300GB disk in my machine as follows:

(insomnia:~) houst0n > zfs list
NAME                              USED  AVAIL  REFER  MOUNTPOINT
data                             93.2G  5.22G  15.2G  /data
data/scratch                      18.8G  5.22G  18.8G  /data/scratch
data/music                       52.8G  5.22G  52.7G  /data/music
data/tmp                         4.65G  5.22G  4.65G  /data/tmp
data/tools                        690M  5.22G   690M  /data/tools
rpool                            15.2G   180G  77.5K  /rpool
rpool/ROOT                       4.95G   180G    19K  legacy
rpool/ROOT/opensolaris           4.95G   180G  4.80G  /
rpool/dump¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† 1023M¬†¬† 180G¬† 1023M¬† –
rpool/export                     8.28G   180G    23K  /export
rpool/export/build                214M   180G   214M  /export/build
rpool/export/home                7.94G   180G    21K  /export/home
rpool/export/home/houst0n        7.94G   180G  7.94G  /export/home/houst0n
rpool/export/zones                136M   180G    21K  /export/zones
rpool/export/zones/z00            136M   180G    21K  /export/zones/z00
rpool/export/zones/z00/ROOT       136M   180G    19K  legacy
rpool/export/zones/z00/ROOT/zbe   136M   180G   136M  legacy
rpool/swap¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† 1023M¬†¬† 180G¬†¬† 196M¬† –

Everything went smooth, and thus far IPS hasn’t died once yet either. A definite improvement over the previous releases.

Next, we install SXCE b111 into VirtualBox
(Get it here (sun.com): http://tinyurl.com/p4bh8r )

install_snv111_2

This takes a good old while, best to find something other to do while it runs.

After that, we create a share and dump the root fs from the VM onto it:

(insomnia:~) houst0n > pfexec zfs create rpool/export/share
(insomnia:~) houst0n > pfexec zfs sharenfs=on rpool/export/share
(insomnia:~) houst0n > pfexec chmod 777 /export/share/

From the VM:

# mount -F nfs 10.0.0.12:/export/share /mnt
# zfs snapshot rpool/ROOT/snv_111@v2p
# zfs send rpool/ROOT/snv_111@v2p > /mnt/snv_111.zfs

This process takes a while, so you’ll need to find yet another way to keep yourself amused while it runs.

Once this (finally) completes, we want to recv the zfs snapshot from the file into our host’s rpool:

(insomnia:~) houst0n > pfexec zfs recv rpool/ROOT/snv_111 < /export/share/snv_111.zfs

Lets see what we have:

(insomnia:~) houst0n > zfs list
NAME                              USED  AVAIL  REFER  MOUNTPOINT
data                             93.8G  4.62G  15.2G  /data
data/scratch                      18.8G  4.62G  18.8G  /data/scratch
data/music                       52.8G  4.62G  52.7G  /data/music
data/tmp                         4.65G  4.62G  4.65G  /data/tmp
data/tools                       1.27G  4.62G  1.27G  /data/tools
rpool                            30.2G   165G  77.5K  /rpool
rpool/ROOT                       9.40G   165G    19K  legacy
rpool/ROOT/opensolaris           4.96G   165G  4.81G  /
rpool/ROOT/snv_111               4.45G   165G  4.45G  legacy
rpool/dump¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† 1023M¬†¬† 165G¬† 1023M¬† –
rpool/export                     18.8G   165G    24K  /export
rpool/export/build                214M   165G   214M  /export/build
rpool/export/home                14.1G   165G    21K  /export/home
rpool/export/home/houst0n        14.1G   165G  14.1G  /export/home/houst0n
rpool/export/share               4.34G   165G  4.34G  /export/share
rpool/export/zones                136M   165G    21K  /export/zones
rpool/export/zones/z00            136M   165G    21K  /export/zones/z00
rpool/export/zones/z00/ROOT       136M   165G    19K  legacy
rpool/export/zones/z00/ROOT/zbe   136M   165G   136M  legacy
rpool/swap¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† 1023M¬†¬† 165G¬†¬† 290M¬† –

Cool. Can we mount it?

(insomnia:~) houst0n > pfexec zfs set mountpoint=/mnt rpool/ROOT/snv_111
(insomnia:~) houst0n > pfexec zfs mount rpool/ROOT/snv_111
cannot mount ‘rpool/ROOT/snv_111’: filesystem already mounted
(insomnia:~) houst0n > ls /mnt
bin@         etc/         lib/         opt/         rpool/       typescript
boot/        export/      media/       platform/    sbin/        usr/
dev/         home/        mnt/         proc/        system/      var/
devices/     kernel/      net/         root/        tmp/
(insomnia:~) houst0n >

Now we want to make it bootable. All we should need to do is copy over some files from the opensolaris root zvol. A reconf reboot should take care of the rest:

(insomnia:/) houst0n > cd /mnt/etc
(insomnia:/mnt/etc) houst0n > pfexec mkdir vb_files
(insomnia:/mnt/etc) houst0n > pfexec mv path_to_inst zfs/zpool.cache driver_* vb_files/
(insomnia:/mnt/etc) houst0n > pfexec cp /etc/path_to_inst /etc/zfs/zpool.cache /etc/driver_* .
(insomnia:/mnt/etc) houst0n > touch /mnt/reconfigure

Next up is grub, I added an entry for snv_111 like this
to /rpool/boot/grub/menu.lst:

title SXCE b111
findroot (pool_rpool,0,a)
bootfs rpool/ROOT/snv_111
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS,disable-ehci=true
module$ /platform/i86pc/$ISADIR/boot_archive

A reboot later, and we’re booted successfully into snv111.

Now it’s time to LU to b115

Download and mount the 115 iso, upgrade the lu bits on the b111 BE:

(insomnia:~) houst0n > lofiadm -a /export/home/houst0n/isos/sol-nv-b115-x86-dvd.iso
/dev/lofi/1
(insomnia:~) houst0n > mount -F hsfs /dev/lofi/1 /mnt
(insomnia:~) houst0n > cd /mnt/Solaris_11/Product
(insomnia:/mnt/Solaris_11/Product) houst0n > pkgrm SUNWlucfg SUNWlur SUNWluu SUNWluzone
(insomnia:/mnt/Solaris_11/Product) houst0n > pkgadd -d . SUNWlucfg SUNWlur SUNWluu SUNWluzone

Next, create a new BE:

(insomnia:~) houst0n > lucreate -c snv_111 -n snv_115
Checking GRUB menu…
Analyzing system configuration.
No name for current boot environment.
Current boot environment is named <snv_111>.
Creating initial configuration for primary boot environment <snv_111>.
The device </dev/dsk/c3d0s0> is not a root device for any boot environment; cannot get BE ID.
PBE configuration successful: PBE name <snv_111> PBE Boot Device </dev/dsk/c3d0s0>.
Comparing source boot environment <snv_111> file systems with the file
system(s) you specified for the new boot environment. Determining which
file systems should be in the new boot environment.
Updating boot environment description database on all BEs.
Updating system configuration files.
Creating configuration for boot environment <snv_115>.
Source boot environment is <snv_111>.
Creating boot environment <snv_115>.
Cloning file systems from boot environment <snv_111> to create boot environment <snv_115>.
Creating snapshot for <rpool/ROOT/snv_111> on <rpool/ROOT/snv_111@snv_115>.
Creating clone for <rpool/ROOT/snv_111@snv_115> on <rpool/ROOT/snv_115>.
Setting canmount=noauto for </> in zone <global> on <rpool/ROOT/snv_115>.
Saving existing file </boot/grub/menu.lst> in top level dataset for BE <snv_115> as <mount-point>//boot/grub/menu.lst.prev.
File </boot/grub/menu.lst> propagation successful
Copied GRUB menu from PBE to ABE
No entry for BE <snv_115> in GRUB menu
Population of boot environment <snv_115> successful.
Creation of boot environment <snv_115> successful.

Lets see what we have:

(insomnia:~) houst0n > lustatus
Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status
————————– ——– —— ——— —— ———-
snv_111¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† yes¬†¬†¬†¬†¬† yes¬†¬†¬† yes¬†¬†¬†¬†¬†¬† no¬†¬†¬†¬† –
snv_115¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† yes¬†¬†¬†¬†¬† no¬†¬†¬†¬† no¬†¬†¬†¬†¬†¬†¬† yes¬†¬†¬† –

Finally, upgrade and activate it:

(insomnia:~) houst0n > luupgrade -u -n snv_115 -s /mnt

System has findroot enabled GRUB
No entry for BE <snv_115> in GRUB menu
Uncompressing miniroot
Copying failsafe kernel from media.
52479 blocks
miniroot filesystem is <lofs>
Mounting miniroot at </mnt/Solaris_11/Tools/Boot>
Validating the contents of the media </mnt>.
The media is a standard Solaris media.
The media contains an operating system upgrade image.
The media contains <Solaris> version <11>.
Constructing upgrade profile to use.
Locating the operating system upgrade program.
Checking for existence of previously scheduled Live Upgrade requests.
Creating upgrade profile for BE <snv_115>.
Checking for GRUB menu on ABE <snv_115>.
Saving GRUB menu on ABE <snv_115>.
Checking for x86 boot partition on ABE.
Determining packages to install or upgrade for BE <snv_115>.
Performing the operating system upgrade of the BE <snv_115>.
CAUTION: Interrupting this process may leave the boot environment unstable
or unbootable.
Upgrading Solaris: 100% completedeted
Installation of the packages from this media is complete.
Restoring GRUB menu on ABE <snv_115>.
Adding operating system patches to the BE <snv_115>.
The operating system patch installation is complete.
ABE boot partition backing deleted.
PBE GRUB has no capability information.
PBE GRUB has no versioning information.
ABE GRUB is newer than PBE GRUB. Updating GRUB.
GRUB update was successful.
Configuring failsafe for system.
Failsafe configuration is complete.
INFORMATION: The file </var/sadm/system/logs/upgrade_log> on boot
environment <snv_115> contains a log of the upgrade operation.
INFORMATION: The file </var/sadm/system/data/upgrade_cleanup> on boot
environment <snv_115> contains a log of cleanup operations required.
WARNING: <1> packages failed to install properly on boot environment <snv_115>.
INFORMATION: The file </var/sadm/system/data/upgrade_failed_pkgadds> on
boot environment <snv_115> contains a list of packages that failed to
upgrade or install properly.
INFORMATION: Review the files listed above. Remember that all of the files
are located on boot environment <snv_115>. Before you activate boot
environment <snv_115>, determine if any additional system maintenance is
required or if additional media of the software distribution must be
installed.
The Solaris upgrade of the boot environment <snv_115> is partially complete.
Installing failsafe
Failsafe install is complete.

(insomnia:~) houst0n > pfexec luactivate snv_115
System has findroot enabled GRUB
Generating boot-sign, partition and slice information for PBE <snv_111>
Saving existing file </etc/bootsign> in top level dataset for BE <snv_111> as <mount-point>//etc/bootsign.prev.
WARNING: <1> packages failed to install properly on boot environment <snv_115>.
INFORMATION: </var/sadm/system/data/upgrade_failed_pkgadds> on boot
environment <snv_115> contains a list of packages that failed to upgrade
or install properly. Review the file before you reboot the system to
determine if any additional system maintenance is required.

Generating boot-sign for ABE <snv_115>
Saving existing file </etc/bootsign> in top level dataset for BE <snv_115> as <mount-point>//etc/bootsign.prev.
Generating partition and slice information for ABE <snv_115>
Copied boot menu from top level dataset.
Generating direct boot menu entries for PBE.
Generating xVM menu entries for PBE.
Generating direct boot menu entries for ABE.
Generating xVM menu entries for ABE.
Disabling splashimage
Re-enabling splashimage
No more bootadm entries. Deletion of bootadm entries is complete.
GRUB menu default setting is unaffected
Done eliding bootadm entries.

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

The target boot environment has been activated. It will be used when you
reboot. NOTE: You MUST NOT USE the reboot, halt, or uadmin commands. You
MUST USE either the init or the shutdown command when you reboot. If you
do not use either init or shutdown, the system will not boot using the
target BE.

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

In case of a failure while booting to the target BE, the following process
needs to be followed to fallback to the currently working boot environment:

1. Boot from Solaris failsafe or boot in single user mode from the Solaris
Install CD or Network.

2. Mount the Parent boot environment root slice to some directory (like
/mnt). You can use the following command to mount:

mount -Fzfs /dev/dsk/c3d0s0 /mnt

3. Run <luactivate> utility with out any arguments from the Parent boot
environment root slice, as shown below:

/mnt/sbin/luactivate

4. luactivate, activates the previous working boot environment and
indicates the result.

5. Exit Single User mode and reboot the machine.

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

Modifying boot archive service
Propagating findroot GRUB for menu conversion.
File </etc/lu/installgrub.findroot> propagation successful
File </etc/lu/stage1.findroot> propagation successful
File </etc/lu/stage2.findroot> propagation successful
Deleting stale GRUB loader from all BEs.
File </etc/lu/installgrub.latest> deletion successful
File </etc/lu/stage1.latest> deletion successful
File </etc/lu/stage2.latest> deletion successful
Activation of boot environment <snv_115> successful.

And we’re done!

(insomnia:~) houst0n > beadm list
BE          Active Mountpoint Space  Policy Created
—¬†¬†¬†¬†¬†¬†¬†¬†¬† —— ———- —–¬† —— ——-
opensolaris N      /          5.28G  static 2009-06-02 21:25
snv_111¬†¬†¬†¬† –¬†¬†¬†¬†¬† –¬†¬†¬†¬†¬†¬†¬†¬†¬† 17.72M static 2009-06-07 17:41
snv_115¬†¬†¬†¬† R¬†¬†¬†¬†¬† –¬†¬†¬†¬†¬†¬†¬†¬†¬† 8.76G¬† static 2009-06-07 21:55