Playing around with Opensolaris 2008.05 Release Candidates
Today, i upgraded my workstations at home to Opensolaris 2008.05 as the primary operating system. Went smoothly. When you don´t have to keep the Nvidia drivers out of your code because of political reasons, even installing and configuring the graphic card is a no-brainer. You have to do nothing. Correct settings out of the box.
ZFS snapshot based boot environments
I´ve started with the Release Candidate 2
jmoekamp@glamdring:~# cat /etc/release
Open Solaris 2008.05 snv_86_rc2 X86
Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 21 April 2008
Okay, now i´ve updated the package list and started the update of my installation.
jmoekamp@glamdring:~# pkg refresh
jmoekamp@glamdring:~# pkg image-update
DOWNLOAD PKGS FILES XFER (MB)
Completed 4/4 3/3 1.24/1.24
PHASE ACTIONS
Update Phase 13/13
A clone of opensolaris exists and has been updated and activated.
On next boot the Boot Environment opensolaris-1 will be mounted
on '/'. Reboot when ready to switch to this updated BE.
A really neat feature of the package manager is the automatic generation of an zfs-snapshot based boot environment:
jmoekamp@glamdring:~# zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool 2.37G 142G 56.5K /rpool
rpool@install 18.5K - 55K -
rpool/ROOT 2.28G 142G 18K /rpool/ROOT
rpool/ROOT@install 0 - 18K -
rpool/ROOT/opensolaris 122K 142G 2.23G legacy
rpool/ROOT/opensolaris-1 2.28G 142G 2.23G legacy
rpool/ROOT/opensolaris-1@install 4.66M - 2.22G -
rpool/ROOT/opensolaris-1@static:-:2008-04-29-17:59:13 562K - 2.23G -
rpool/ROOT/opensolaris-1/opt 3.60M 142G 3.60M /opt
rpool/ROOT/opensolaris-1/opt@install 0 - 3.60M -
rpool/ROOT/opensolaris-1/opt@static:-:2008-04-29-17:59:13 0 - 3.60M -
rpool/ROOT/opensolaris/opt 0 142G 3.60M /opt
rpool/export 85.8M 142G 19K /export
rpool/export@install 0 - 19K -
rpool/export/home 85.8M 142G 85.8M /export/home
rpool/export/home@install 18K - 21K -
The update automatically triggers the creation of a new boot-environment and the integration of this boot-environment to GRUB. Next time when you start your system, it will start with this boot environment.
jmoekamp@glamdring:/# beadm list
BE Active Active on Mountpoint Space
Name reboot Used
---- ------ --------- ---------- -----
opensolaris-1 yes yes legacy 2.29G
opensolaris no no - 57.37M
I rebooted here, and after the reboot the operating system came up as a Release Candidate 2a system:
jmoekamp@glamdring:~$ cat /etc/release
Open Solaris 2008.05 snv_86_rc2a X86
Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 23 April 2008
Nice … switching to the old environment is really easy
jmoekamp@glamdring:/# beadm activate opensolaris
Now we can reboot again. Et voila, after the reboot you are back in your Release Candidate 2 operating system.
jmoekamp@glamdring:~# cat /etc/release
Open Solaris 2008.05 snv_86_rc2 X86
Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 21 April 2008
When you look into the list of boot environments, you will see that the both environment swapped their roles.
jmoekamp@glamdring:~# beadm list
BE Active Active on Mountpoint Space
Name reboot Used
---- ------ --------- ---------- -----
opensolaris-1 no no - 63.57M
opensolaris yes yes legacy 2.30G
Of course, you can jump back to the newer installation again.
jmoekamp@glamdring:~# beadm activate opensolaris-1
Reboot the system and afterwards you have your Release Candidate 2a operating system online again.
jmoekamp@glamdring:~$ cat /etc/release
Open Solaris 2008.05 snv_86_rc2a X86
Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 23 April 2008
A nice side effect of snapshot based boot environments
Every now and then even a experienced admin tends to do really dumb errors. Like me …. i´ve accidentally deleted the /etc/hosts
:
jmoekamp@glamdring:/# echo "192.168.1.xxx fileserver.internal" > /etc/hosts
Fsck! But then i thought: “The system makes snapshots when upgrading packages”. Okay, snapshots are accessible by using the .zfs
directory in the root of the filesystem. So i just had to go into a snapshot directory and gather an older /etc/hosts
version.
jmoekamp@glamdring:/# cd .zfs
jmoekamp@glamdring:/.zfs# ls
snapshot
jmoekamp@glamdring:/.zfs# cd snapshot/
jmoekamp@glamdring:/.zfs/snapshot# ls
install static:-:2008-04-29-17:59:13
jmoekamp@glamdring:/.zfs/snapshot# cd static\:-\:2008-04-29-17\:59\:13/
jmoekamp@glamdring:/.zfs/snapshot/static:-:2008-04-29-17:59:13# cd etc/
jmoekamp@glamdring:/.zfs/snapshot/static:-:2008-04-29-17:59:13/etc# cat hosts
# CDDL HEADER START
#
[..]
#
::1 localhost
127.0.0.1 glamdring glamdring.local localhost loghost
jmoekamp@glamdring:/.zfs/snapshot/static:-:2008-04-29-17:59:13/etc# cp hosts /etc/hosts
jmoekamp@glamdring:/.zfs/snapshot/static:-:2008-04-29-17:59:13/etc# cd /
And now i was able to add the hostname in a correct way without deleting it:
jmoekamp@glamdring:/# echo "192.168.1.xxx fileserver.internal" >> /etc/hosts