Monday, June 1, 2009

OpenSolaris 2009.06 quick guide

OpenSolaris 2009.06 was released today! I have written a very quick guide for customizing and adding some basic services to an OSOL 2009.06 server from the shell.

Package operations

Install the storage-nas cluster (CIFS,iSCSI, NDMP etc.)
$ pfexec pkg install storage-nas
Add compilers (sunstudio, it can be replaced with e.g. gcc-dev-4)
$ pfexec pkg install sunstudio
Add the contrib repository for contributed packages
$ pfexec pkg set-publisher -O contrib
Other packages that can be of interest:
SUNWmysql51, ruby-dev, SUNWPython26, SUNWapch22m-dtrace, amp-dev, gcc-dev-4

List available and installed packages with search string
$ pkg list -a SUNWgzip
SUNWgzip 1.3.5-0.111 installed ----
$ pkg list -a '*Python26*'
SUNWPython26 2.6.1-0.111 known ----
SUNWPython26-extra 0.5.11-0.111 known ----

Create a ZFS filesystem with compression enabled
$ pfexec zfs create -o compression=on rpool/export/share
Share with NFS

Enable NFS service:
$ pfexec svcadm enable -r nfs/server
Enable sharing over NFS for the share filesystem
$ zfs set sharenfs=on rpool/export/share
Share with CIFS
$ pfexec svcadm enable smb/server
$ pfexec zfs set sharesmb=on rpool/export/share
$ pfexec zfs set sharesmb=name=mysharename rpool/export/share
To enable users to access the CIFS share add the following line to /etc/pam.conf and reset users pw with passwd(1):
other password required nowarn
Enable auto ZFS-snapshots

Disable snapshots globally for the whole pool:
$ pfexec zfs set com.sun:auto-snapshot=false rpool
Enable snapshots for the share:
$ pfexec zfs set com.sun:auto-snapshot=true rpool/export/share
Enable daily snapshots (can be frequent, hourly, daily, weekly or monthly):
$ pfexec svcsadm enable auto-snapshot:daily
List snapshots:
$ zfs list -t snapshot

If you are unfamiliar with Solaris, read the manual pages for the following commands:
prstat, fsstat, pkg, powertop, zfs, zpool, sharemgr, ipfilter, dladm, fmdump

NOTE: There are graphical options for snapshot setup and the package manager that can be used from graphical console, VNC or forwarded X. Launch them with with "time-slider-setup" or "packagemanager".

1 comment:

Matt said...

Hey Henkis - great to see you're enjoying the upgrade!

I work with Sun's PR team, so if you come across any questions/issues you'd like answered - just drop me a note at matt.mclernon[at] and I'll take care of it!