Friday Oct 23, 2009

OpenSolaris and a V100

Buried in the depths of my loft is a well used and abused SunFire V100 which I've been meaning to see if I could get working with OpenSolaris. It was fine and dandy with the the last build of Nevada I tried (125) so technically should work with OpenSolaris. However, there is one problem in that OpenSolaris Sparc is only bootable via WAN boot...which unfortunately the V100 doesn't support. So I thought I could be a little sneaky here (and totally unsupported of course) and hack OpenSolaris onto it. :) So knowing that you can do ZFS backup and restore my plan was to install OpenSolaris 0906 on a lab system at work and then take a backup so I could restore it on my home V100. All sounds feasible according to the OpenSolaris administration guide.

So from my lab box I took a snapshot and then dumped it down to a remote NFS server:

jack@v4u-v480b-gmp03:~# zfs snapshot -r rpool@0804

jack@v4u-v480b-gmp03:~# zfs list -t snapshot
NAME                             USED  AVAIL  REFER  MOUNTPOINT
rpool@0804                          0      -    65K  -
rpool/ROOT@0804                     0      -    19K  -
rpool/ROOT/opensolaris@install  58.5M      -  3.96G  -
rpool/ROOT/opensolaris@0804      218K      -  4.05G  -
rpool/dump@0804                     0      -  2.53G  -
rpool/export@0804                   0      -    21K  -
rpool/export/home@0804              0      -    21K  -
rpool/export/home/jack@0804         0      -  21.5K  -
rpool/swap@0804                     0      -  25.3M  -

jack@v4u-v480b-gmp03:~# zfs send -Rv rpool@0804 > /mnt/rpool.0804
sending from @ to rpool@0804
sending from @ to rpool/swap@0804
sending from @ to rpool/export@0804
sending from @ to rpool/export/home@0804
sending from @ to rpool/export/home/jack@0804
sending from @ to rpool/ROOT@0804
sending from @ to rpool/ROOT/opensolaris@install

One the remote NFS server I actually compressed the rpool dump down to 2g in size as I then rsync'd the image home.

On the home system I then booted from the network:

boot net -s

# mkdir /var/tmp/a

# zpool create -f -o version=14 -O version=3 -o failmode=continue -R /var/tmp/a -m legacy -o cachefile=/etc/zfs/zpool.cache rpool mirror c0t0d0s0 c0t2d0s0

NOTE: If you happen to boot from an OS which has a newer version of ZFS and create the pool with that newer version then you might have a compatibility issue as I did and end up with a panic as follows:

Boot device: /pci@9,600000/SUNW,qlc@2/fp@0,0/disk@w21000004cf9973a1,0:a  File and args:
SunOS Release 5.11 Version snv_111b 64-bit
Copyright 1983-2009 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
NOTICE: zfs_parse_bootfs: error 48
Cannot mount root on rpool/79 fstype zfs

panic[cpu3]/thread=180e000: vfs_mountroot: cannot mount root

000000000180b950 genunix:vfs_mountroot+320 (200, 1876000, 18a3800, 18d3800, 12588f8, 1876000)
  %l0-3: 0000000000000064 000000000001d4c0 0000000000001d4c 0000000001876100
  %l4-7: 0000000001258800 0000000000000600 0000000000000200 0000000000000800
000000000180ba10 genunix:main+c4 (1815000, 180bec0, 1815388, 1838440, 1, 18393d8)
  %l0-3: 000000000180e000 0000000070002000 0000000000000000 000000000183d800
  %l4-7: 0000000000000003 000000000180c000 0000000070002000 0000000000000003

skipping system dump - no dump device configured
rebooting...

Resetting ...

So the ENOTSUP 48 error from zfs_parse_bootfs() is telling us that the pool version is too new and hence the reason when you create the pool you'll need to specify the correct version for the restoring OS.

Let's mount the remote image

# mount xxx.xxx.xxx.xxx:/backup /mnt

cd /mnt

and then restore the pool data from the compressed backup:

bzcat rpool.0804.bz2 | zfs receive -Fdu rpool &

then set the bootfs flag to the correct root location and install the boot blocks (on both mirrors):

zpool set bootfs=rpool/ROOT/opensolaris rpool

installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c0t0d0s0
installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c0t2d0s0

finally we can init 6 and boot our system into OpenSolaris 0906

yay (in a sad a geeky way).

About

I'm an RPE (Revenue Product Engineering) Engineer supporting Solaris on Exadata, Exalogic and Super Cluster. I attempt to diagnose and resolve any problems with Solaris on any of the Engineered Systems.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today