Skip navigation

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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: