November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

solaris 10 reference

solaris Release

Get the release of your OS by cat /etc/release:
OpenSolaris 2009.06 Example:
OpenSolaris 2009.06 snv_111b X86
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 07 May 2009
Solaris 10
Oracle Solaris 10 9/10 s10s_u9wos_14a SPARC
Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
Assembled 11 August 2010
System administration

SMF

Enable/disable services

Since Solaris 10, the old (but nice ?) start/stop script in rc?.d have been replaced by SMF, the Service Management Facility.

svcs
svcs -x lists services encountering problems
svcs -a lists all services including disabled ones
svcs -l provides information concerning a specific service
Example:
svcs -l svc:/network/routing/ndp:default
fmri svc:/network/routing/ndp:default
name in.ndpd IPv6 neighbour discovery daemon
enabled true (temporary)
state online
next_state none
state_time July 20, 2013 07:52:23 PM CEST
logfile /var/svc/log/network-routing-ndp:default.log
restarter svc:/system/svc/restarter:default
contract_id 63
dependency require_all/refresh svc:/network/routing-setup (online)
svcadm
svcadm enable to enable a service. e.g svcadm enable svc:/network/samba:default
svcadm disable to disable a service.
svcadm enable -t temporary enabling/disabling a service (won’t persist over reboot)
svcadm refresh restart the service
svccfg
svccfg -s setprop set properties. Eg. svccfg -s svc:/application/x11/x11-server setprop options/tcp_listen = true
Or, for example, get the current keymap layout:
svc:/system/keymap:default> listprop keymap/layout
keymap/layout astring French
svc:/system/keymap:default> exit
svcprop
svcprop list properties for a given service.
eg.
$ svcprop svc:/application/x11/x11-server
options/default_depth integer 24
options/server astring /usr/openwin/bin/Xsun
options/server_args astring “”
options/stability astring Evolving
options/value_authorization astring solaris.smf.manage.x11
options/tcp_listen boolean true

OpenSolaris uses the SMF too. It (unfortunately ?) ships with many services and will probably need some tuning if your host is a bit slow. A nice reading on that behalf: Solaris 10 Benchmark v4.0.

Creating a manifest for a new service

See for example the SVN manifest I use.
Useful services

Name Service Name Comments
Apache Solaris: svc:/network/http:apache2, OpenSolaris: svc:/network/http:apache22 Enable to set up your own web server
Avahi Daemon Bridge to Bonjour svc:/system/avahi-bridge-dsd:default Disabled. Used by DNS Multicast
CDE svc:/application/graphical-login/cde-login:default Disabled on Solaris: I use gdm. Does not exist on OpenSolaris
DHCP dhcpagent disabled: I use static address
Fiber Channel svc:/system/device/fc-fabric:default Keep enabled or the system won’t reboot
GDM Solaris: svc:/application/gdm2-login:default, OpenSolaris: svc:/application/graphical-login/gdm:default enabled
GSS >API gss:default Disable. The GSS API is a security abstraction layer that is designed to make it easier for developers to integrate with different authentication schemes. It is most commonly used in applications for sites that use Kerberos for network authentication, though it can also allow applications to interoperate with other authentication schemes (quoted from Solaris 10 Benchmark v4.0).
IPFilter’s service ipmon Enabled. used for zones
IPv6 neighbour discovery daemon svc:/network/routing/ndp:default Disabled. I don’t use IPv6 at home !
Keyboard defaults svc:/system/keymap:default Enabled. If needed, set keyboard layout explicitly to fr.
svc:/system/keymap:default> listprop keymap/layout
keymap/layout astring French
svc:/system/keymap:default> exit
Kerberos svc:/network/security/ktkt_warn:default “While Kerberos can be a security enhancement, if the local site is not currently using Kerberos then there is no need to enable this service” (according to here)
metainit svc:/system/metainit:default disable. SVM initialization
metasync svc:/system/metasync:default disable. SVM initialization
MySQL svc:/application/database/mysql:version_51 if you don’t need MySQL you can safely disable
Multicast DNS and DNS Service Discovery multicast:default disable
N Port ID Virtualization svc:/network/npiv_config:default Do not disable or the syste, won’t reboot. N_Port_ID Virtualization (NPIV) is a method for virtualizing a FibreChannel Port. With NPIV, one physical FibreChannel port can obtain many N_Port_IDs.
PPD Cache Update svc:/application/print/ppd-cache-update:default disable
Rlogin network/login:rlogin enable this for rlogin
Samba Solaris: svc:/network/samba:default, OpenSolaris: svc:/network/smb/client:default enabled. On OpenSolaris, the Samba client is necessary for smbfs.
Sendmail svc:/network/smtp:sendmail I don’t need it. To remove sendmail packages, pkgrm SUNWsndmu and SUNWsndmr. Beware sendmail is required by fetchmail
Time Slider svc:/application/time-slider:default For ZFS Snapshots
VNC Configuration svc:/system/xvm/vnc-config:default disable
List of online services

Currently, the list of online services on my OpenSolaris host are:
STATE STIME FMRI
legacy_run 20:36:20 lrc:/etc/rcS_d/S50yukonx
legacy_run 20:36:59 lrc:/etc/rc2_d/S20sysetup
legacy_run 20:36:59 lrc:/etc/rc2_d/S47pppd
legacy_run 20:36:59 lrc:/etc/rc2_d/S72autoinstall
legacy_run 20:36:59 lrc:/etc/rc2_d/S73cachefs_daemon
legacy_run 20:37:00 lrc:/etc/rc2_d/S81dodatadm_udaplt
legacy_run 20:37:00 lrc:/etc/rc2_d/S89PRESERVE
legacy_run 20:37:00 lrc:/etc/rc2_d/S98deallocate
disabled 20:36:57 svc:/system/xvm/ipagent:default
online 20:36:04 svc:/system/svc/restarter:default
online 20:36:05 svc:/network/loopback:default
online 20:36:05 svc:/network/datalink-management:default
online 20:36:06 svc:/system/filesystem/root:default
online 20:36:06 svc:/network/physical:nwam
online 20:36:07 svc:/system/scheduler:default
online 20:36:07 svc:/system/boot-archive:default
online 20:36:07 svc:/system/identity:node
online 20:36:14 svc:/system/filesystem/usr:default
online 20:36:14 svc:/system/device/local:default
online 20:36:14 svc:/system/filesystem/minimal:default
online 20:36:15 svc:/system/identity:domain
online 20:36:15 svc:/system/hostid:default
online 20:36:15 svc:/system/name-service-cache:default
online 20:36:15 svc:/system/rmtmpfiles:default
online 20:36:15 svc:/system/resource-mgmt:default
online 20:36:15 svc:/system/cryptosvc:default
online 20:36:15 svc:/network/ipfilter:default
online 20:36:15 svc:/milestone/network:default
online 20:36:15 svc:/system/sysevent:default
online 20:36:16 svc:/system/power:default
online 20:36:16 svc:/system/picl:default
online 20:36:16 svc:/network/npiv_config:default
online 20:36:16 svc:/system/device/fc-fabric:default
online 20:36:16 svc:/milestone/devices:default
online 20:36:17 svc:/system/manifest-import:default
online 20:36:17 svc:/system/coreadm:default
online 20:36:17 svc:/network/initial:default
online 20:36:18 svc:/network/service:default
online 20:36:18 svc:/network/dns/client:default
online 20:36:18 svc:/milestone/name-services:default
online 20:36:19 svc:/network/smb/client:default
online 20:36:20 svc:/system/keymap:default
online 20:36:20 svc:/milestone/single-user:default
online 20:36:24 svc:/network/routing-setup:default
online 20:36:24 svc:/network/routing/ndp:default
online 20:36:55 svc:/system/filesystem/local:default
online 20:36:56 svc:/system/sysidtool:net
online 20:36:56 svc:/network/shares/group:default
online 20:36:56 svc:/system/boot-archive-update:default
online 20:36:56 svc:/system/cron:default
online 20:36:56 svc:/network/shares/group:zfs
online 20:36:56 svc:/network/rpc/bind:default
online 20:36:56 svc:/application/stosreg:default
online 20:36:56 svc:/system/sysidtool:system
online 20:36:56 svc:/milestone/sysconfig:default
online 20:36:56 svc:/system/sac:default
online 20:36:57 svc:/system/dbus:default
online 20:36:57 svc:/system/utmp:default
online 20:36:57 svc:/system/filesystem/autofs:default
online 20:36:57 svc:/network/inetd:default
online 20:36:57 svc:/system/console-login:default
online 20:36:57 svc:/system/filesystem/zfssnap-roleadd:default
online 20:36:57 svc:/system/dumpadm:default
online 20:36:57 svc:/application/desktop-cache/mime-types-cache:default
online 20:36:58 svc:/application/desktop-cache/gconf-cache:default
online 20:36:58 svc:/system/postrun:default
online 20:36:58 svc:/application/desktop-cache/input-method-cache:default
online 20:36:58 svc:/application/desktop-cache/pixbuf-loaders-installer:default
online 20:36:58 svc:/application/opengl/ogl-select:default
online 20:36:58 svc:/network/rpc/smserver:default
online 20:36:58 svc:/network/login:rlogin
online 20:36:58 svc:/application/pkg/update:default
online 20:36:59 svc:/system/system-log:default
online 20:36:59 svc:/network/ssh:default
online 20:37:00 svc:/application/desktop-cache/desktop-mime-cache:default
online 20:37:00 svc:/milestone/multi-user:default
online 20:37:01 svc:/system/intrd:default
online 20:37:01 svc:/system/fmd:default
online 20:37:01 svc:/milestone/multi-user-server:default
online 20:37:03 svc:/system/zones:default
online 20:37:03 svc:/application/font/fc-cache:default
online 20:37:10 svc:/application/desktop-cache/icon-cache:default
online 20:37:12 svc:/system/filesystem/zfs/auto-snapshot:daily
online 20:37:13 svc:/system/filesystem/zfs/auto-snapshot:monthly
online 20:37:13 svc:/application/graphical-login/gdm:default
online 20:37:13 svc:/network/http:apache22
online 20:37:13 svc:/system/filesystem/zfs/auto-snapshot:weekly
online 20:37:19 svc:/system/hal:default
online 20:37:19 svc:/system/filesystem/rmvolmgr:default
online 20:37:28 svc:/system/filesystem/zfs/auto-snapshot:frequent
online 20:37:28 svc:/system/filesystem/zfs/auto-snapshot:hourly
online 20:37:28 svc:/application/time-slider:default
Inetadm

Get status of an inet service:
inetadm | grep ftp
disabled disabled svc:/network/ftp:default
Enable an inet service:
pfexec inetadm -e ftp
$ inetadm | grep ftp
enabled online svc:/network/ftp:default
System Admin GUIs

The host can be graphically administered using:

SMC (Solaris Management Console): user management, hosts editing, cron batches, SMF. Launch /usr/sadm/bin/smc. On Solaris only (not OpenSolaris).
Webmin: web-based administration. Pretty good.
Visual Panels: this is an additional piece of software. I’m not a fan, but it’s there if you want it.
User management

How to add a new user

To add a new user,

use the graphical Solaris Management Console (smc&)
or manually:
make sure the home dir exists and is readable by the group,
then type:
useradd -d -g -s /usr/bin/bash
Allow a user for pfexec

# cat /etc/security/exec_attr | grep “Primary”

Primary Administrator:suser:cmd:::*:uid=0;gid=0

# usermod -P’Primary Administrator’ testuser
Logs

/var/adm/messages
/var/cron/log Cron’s log. Will also log auto snapshot actions.
/var/adm/sulog Successful or failed su logins
/var/log/syslog
Authentication

Log failed logins

Set SYSLOG_FAILED_LOGINS in /etc/default/login

Password policy

The password policy is configured in /etc/default/passwd. The default settings are reasonable. Several parameters are commented out, but they have a default value. On the contrary, an unsecure setting could be as follows:

MAXWEEKS=
MINWEEKS=
PASSLENGTH=4
HISTORY=0
MINDIFF=0
MINDIGIT=0
See more information here.

Automatic login

On Solaris 10, to have the host automatically log in as a given user:

# gdmsetup & –> set up for user you wish to log in
# vi /etc/X11/gdm/gdm.conf

SystemMenu=true
# /etc/init.d/dtlogin stop
# /usr/dt/bin/dtconfig -d
# svcadm enable gdm2-login
Now, automatic login is a bit disappointing, because you still have to provide user’s password…

On OpenSolaris 2008.11, no such issue ! Use gdmsetup and it works.

Whoami

An alternative to whoami is
/usr/xpg4/bin/id -un
System Path

The default path for Solaris 10 should be set in /etc/default/login:

PATH=/usr/sfw/bin:/opt/csw/bin:/usr/sbin:/sbin:/usr/bin:/usr/openwin/bin
SUPATH=/usr/sbin:/usr/bin
PATH is the default path for users.

SUPATH is the default path for root when running su.

Both paths are overriden by user’s .profile, .login, .cshrc or .bashrc. So, check those files out too.

System Locale

Locales are a complicated matter I haven’t completely grasped yet 😉 I would recommend using UTF-8 as much as possible as it supports English and French characters, but UTF-8 will only work if the application supports it. For example, xterm do not support UTF-8 (I read there is a workaround using efonts but I haven’t tested). Urxvt does.
If setting locale to UTF-8 fails, ISO Latin 15 (ISO-8859-15) is a good alternative to display French accents and euro symbol.
The main locale environment variables are:
LANG: general language specification
LC_ALL: language setting. If not empty, overrides LANG and other LC_ variables
LC_MESSAGES: compilation warnings, errors in the specified language
Those variables are described in man 5 environ. To check your current locale:
$ locale
LANG=C
LC_CTYPE=”C”
LC_NUMERIC=”C”
LC_TIME=”C”
LC_COLLATE=”C”
LC_MONETARY=”C”
LC_MESSAGES=”C”
LC_ALL=
If a user wishes to customize its locale, he/she should usually set LANG (or individually, each LC_ variable). However, this setting is not persistent: it must be added to user’s .bashrc.
Those settings may affect locale-dependant applications. For instance, to launch Thunderbird with English menus but French accents supports, set LANG to en_US.UTF-8. To use Thunderbird with French menus: fr_FR.UTF-8.
To set the system’s locale, modify the settings in /etc/default/init and reboot:
LANG=”en_US.UTF-8″
LC_CTYPE=”C”
LC_NUMERIC=”C”
LC_TIME=”C”
LC_COLLATE=”C”
LC_MONETARY=”C”
LC_MESSAGES=”C”
To add a new locale, use localeadm
I encountered strange lags with OpenSolaris, when launching simple applications such as xclock, xeyes etc: the computer would freeze for a few seconds, and finally the application appears.
This does not occur any longer once I set all LC_ variables to C except LANG to en_US.UTF-8 in /etc/default/init.
LANG=”en_US.UTF-8″
LC_CTYPE=”C”
LC_NUMERIC=”C”
LC_TIME=”C”
LC_COLLATE=”C”
LC_MONETARY=”C”
LC_MESSAGES=”C”
Setting the System Date

To set/correct time, do:

date -s 1334
to set clock to 13:34.

To set the timezone, use the tzselect utility. Alternatively, it is possible to do:
pfexec /usr/sbin/rtc -z Europe/Paris
Networking

To restart the network:
svcadm restart svc:/network/physical:nwam
To add a new computer, use the Solaris Management Console, Computers & Network, Computers, then selection Action / Add Computer. This basically adds an entry to /etc/hosts.
Check out files /etc/hostname, /etc/hostname. (hme0, yukonx…), /etc/nodename, /etc/inet/hosts, /etc/inet/ipnodes.
List possible interfaces: ifconfig -a plumb, then ifconfig
List routes: routeadm
GUI: network-admin
Set a static IP address

Specifying a static IP address consists in:

ethernet interface: an ether interface must exist and be named. I use the default name for mine: yukonx0
make sure the networking service is enabled: either physical:default or physical:nwam. The former is the most ‘basic’ networking service. The latter is a networking daemon that automatically configures your host. It’s worth a try: on my OpenSolaris host, it worked straight out of the box and I consequently did not have to configure networking manually. On Solaris u5, however, I had to do it manually.
configure a few files (with nwam, most of these steps should be automatically done):
/etc/hostname.: specify your host’s name:cify your host’s name:
$ more /etc/hostname.yukonx0
boureautic
/etc/hosts: set the loopback address and your static IP address:
$ cat /etc/hosts
#
# Internet host table
#
#::1 localhost loghost boureautic
127.0.0.1 localhost loghost
192.168.0.2 boureautic
/etc/resolv.conf: set the appropriate DNS servers (those are the ones used by Free):
nameserver 212.27.40.240
nameserver 212.27.40.241
/etc/nsswitch.conf: make sure the line hosts sets “files” before “dns”.
hosts: files dns
for physical:default, set the default gateway: route add default 192.168.0.254. And then, automatically add the route at each reboot writing a script /etc/rc2.d/S99route
For a manual try, add the network interface with ifconfig:
ifconfig yukonx0 192.168.0.2 netmask 255.255.255.0 up
Eavesdropping network packets

No need to install Ethereal: on Solaris, there’s snoop. Example 1:
pfexec snoop 192.168.0.2 and 192.168.0.3 and tcp > trace.txt
This will record all TCP packets which mention 192.168.0.2 and 192.168.0.3. Example 2:
pfexec snoop -d yukonx0 -o smbfs.snoop 192.168.0.2 and 192.168.0.3 and tcp
The output is written to smbfs.snoop, and we listen only on network card yukonx0.
Enable Rlogin

To add the rlogin network service:

svcs -l rlogin
svcadm enable network/login:rlogin
Note that svcadm enable -t network/login:rlogin only performs a temporary enable of rlogin (won’t persist over reboot).

X

Display windows remotely

This is basic on X Window, but from time to time I however encounter problems to do it.

For remote display:

export DISPLAY=:0.0
Also use /usr/openwin/bin/xauth list to list which entities are authorized.

XScreensaver

There’s a known bug on Solaris 10 u5: when you log on, a message is displayed: “failed to execute child process “xscreensaver” (no such file or directory) screesaver functionality will not work in this session”.

To get rid of this message, do

ln -s /usr/openwin/bin/xscreensaver /usr/bin/xscreensaver
GDM

To add FVWM to possible sessions, modify /usr/share/xsessions/fvwm.desktop
[Desktop Entry]
Encoding=UTF-8
Name=FVWM
Name[fr]=FVWM 2.5.26
Comment=This session logs you into FVWM 2.5.26
Exec=/usr/local/bin/fvwm
Icon=
Type=Application
On Solaris 10, stop dtlogin to use gdm:

# /etc/init.d/dtlogin stop
# /usr/dt/bin/dtconfig -d
# svcadm disable cde-login
# svcadm enable gdm2-login
On OpenSolaris 2008.11, gdm refers to the service svc:/application/graphical-login/gdm:default. There is no CDE login.

On OpenIndiana, to add FVWM as a possible session, edit .dmrc:

[Desktop]
Session=fvwm
Language=C
Layout=
XDMCP

To configure XDMCP, launch gdmsetup then click on the remote tabs and activate ‘same as local’.

The logs of XDMCP are sent to the console. Make sure that only GDM is launched not also CDE (disable service cde-login for gdm2-login).
On OpenIndiana, activate XDCMP in /etc/gdm/custom.conf
[xdmcp]
Enable=true
DisplaysPerHost=2
Fonts

To display usable fonts, use xfontsel
To use a given font in a xterm, use -fn:
xterm -fn -*-fixed-medium-*-*-*-14-*-*-*-*-*-*-* &
or create an ~/XTerm file (or in ~/.Xdefaults) and specify the fonts, size (etc) you wish to use:

XTerm*font: 9×15
corresponds to:
xterm -font 9×15 &
Fonts are typically located in /usr/X11/lib/X11/fonts/misc/
Software Management

Package management Typical install directories Local package database Comments
pkgadd etc /usr, /usr/sfw, /opt/sfw /var/sadm/pkg Default package management utility on Solaris. Does not handle dependencies. SUN’s packages are prefixed by SUNW (eg SUNWvbox).
pkg-get /opt/csw “Old” Blastwave package management. Close to apt-get. Handles dependencies. Blastwave’s package are prefixed by CSW (eg CSWperl).
pkgutil /opt/csw New Blastwave package management. Close to apt-get. Handles dependencies. Install using pkgadd -d http://get.opencsw.org/now, which fetches CSWpkgutil.
To install the new PKI:
/opt/csw/bin/cswpki –import –force
pkg New package management of OpenSolaris. I don’t like it very much, it takes ages to run. Packages are prefixed with IPS (eg IPSgnutls)

Commands Solaris pkg-get pkgutil IPS (OpenSolaris)
Add / Install pkgadd -d
1/ unzip the package (gunzip, bunzip2, unzip…) and 2/ pkgadd. pkg-get install (automatically downloads and installs dependencies) pkg install
Remove pkgrm packagename pkg-get remove packagename
Upgrade
pkg-get upgrade packagename
This will upgrade all packages for which a new version exists. It consists in uninstalling the old version (remove) and then installing the new version (install). At first, seeing a remove operation may be surprising, but in the end, it works.
Get package details pkginfo -l packagename
$ pkginfo -l SUNWopenssl-commands
PKGINST: SUNWopenssl-commands
NAME: OpenSSL Commands (Usr)
CATEGORY: system
ARCH: i386
VERSION: 11.11,REV=2008.10.30.20.37
VENDOR: Sun Microsystems, Inc.
DESC: OpenSSL Commands (Use)
HOTLINE: Please contact your local service provider
STATUS: completely installed

pkg info package
$ pkg info -l SUNWxwplt
Name: SUNWxwplt
Summary: X Window System platform software
Category: System/X11
State: Installed
Publisher: opensolaris.org
Version: 0.5.11
Build Release: 5.11
Branch: 0.111
Packaging Date: Fri May 8 16:45:51 2009
Size: 14.34 MB
FMRI: pkg:/SUNWxwplt@0.5.11,5.11-0.111:20090508T164551Z

List contents of a package pkgchk -l (also lists details) pkg contents
Example:
pkg contents xsane/sane-backends
usr/lib/sane/libsane-pixma.so.1
usr/lib/sane/libsane-pixma.so.1.0.19
usr/share/man/man5/sane-pixma.5
Search in which package a command belongs to grep xxx /var/sadm/install/contents or /usr/sbin/pkgchk -l -p thecommand pkg search -r
Search for packages starting with a given name pkgutil -a blah
List all available packages on the server pkgutil -l
Locate software repositories pkg publisher
Verify an installation pkg verify package
This will tell you for instance if a link is broken:
pkg verify web/browser/firefox
PACKAGE STATUS
pkg://openindiana.org/web/browser/firefox ERROR
link: usr/bin/firefox
Target: ‘/opt/sfw/lib/firefox/firefox’ should be ‘../lib/firefox/firefox’

There’s a nice comparison between Debian’s apt-get and IPS or pkgadd / IPS: here.
Patches

On Solaris: use the Sun Connection Update Manager (last version is currently 1.0.4). To do so, it is mandatory to register Solaris. The command line tool is /usr/sbin/updatemanager (run as root). This will ask for registration if you haven’t done so yet). This is a graphical interface.
I encountered a serious problem with patches: I patched the system with security or recommended patches, some of those patches failed, and then at the next reboot: kernel crash (impossible to boot, except in single user mode). So beware… See Sun’s Forums and Google Groups: looks like others encountered the same problem…

On OpenSolaris: launch /usr/sbin/updatemanager
pkg-get

To install pkg-get,
Get pkg-get from Blastwave.
Install it: pkgadd -d pkg_get-3.8.4-SunOS5.8-all-CSW.pkg. The procedure is perfectly described on Blastwave’s site. Check its digest with:
digest -v -a md5 pkg_get.pkg
Then configure it in /opt/csw/etc/pkg-get.conf. Set up the mirror to use, the tree version (stable, unstable, testing), and the download directory (by default: /var/pkg-get/donwloads).
url=http://ibiblio.org/pub/packages/solaris/csw/unstable
PKGGET_DOWNLOAD_DIR=/tmp
Then use pkg-get to install Blastwave packages.
pkgutil

Blastwave has recently replaced pkg-get by pkgutil. To install pkgutil,

get the package
do: pkgadd -d then use pkgutil to handle other packages.
Using other packages

Unpack a debian package:

/usr/xpg4/bin/ar x package.deb
gunzip data.tar.gz
tar -xvf data.tar
Kernel module

List which kernel module is installed: modinfo
Load a kernel module: modload
Developer’s corner

Bash

A very simple .bashrc on Solaris:
export PATH=/usr/bin/amd64:$PATH:/opt/csw/bin:.
export PS1=”[\u@\w] ”
On OpenSolaris:
PS1=’${LOGNAME}@$(/usr/bin/hostname):$(
[[ “${LOGNAME}” == “root” ]] && printf “%s” “${PWD/${HOME}/~}# ” ||
printf “%s” “${PWD/${HOME}/~}\$ “)’

export PATH=$PATH:/usr/local/bin:/usr/share/bin
32-bit vs 64-bit

To know whether your architecture is 32 or 64 bit: isainfo -b

There’s a very interesting article on Blog’o thnet.

To summarize, on 64-bit processors, the kernel, device drivers and some key applications (or those with a high performance issue) are 64-bit, but all other applications are usually 32-bit. There are no emulation libraries on Solaris 64 to run 32-bit libraries: there are two different system calls.

To check whether a given application is 32 or 64 bit, run file:

$ file /usr/bin/amd64/ls
/usr/bin/amd64/ls: ELF 64-bit LSB executable AMD64 Version 1, dynamically linked, stripped
This also means that on 64-bit hosts, you should set your PATH to locate 64-bit applications before 32-bit ones. For example /usr/bin/amd64 should be set before /usr/bin.

Compilers etc

For Solaris, there’s a very interesting article on the subject here. Mainly, what I get of out it is:
no need to install a gcc package (such as CSWgcc) because gcc is usually installed by default in /usr/sfw (mine is version 3.4.3).
no need to install gmake (3.80) either: it’s already installed in /usr/sfw.
put /usr/sfw/bin at the top of your path, and remove /usr/ucb (or leave it at the end of your path – because it points to an ‘old’ cc).
install Sun Studio to get cc (among other things). Actually, cc is said to be better than gcc (faster code), but gcc is perhaps better known by GNU/Free addicts. Anyway, if cc is installed, add /opt/SUNWspro/bin to your path.
For example,

export PATH=/usr/bin/amd64:/usr/sfw/bin:/opt/csw/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/bin:/bin:.
export LD_LIBRARY_PATH=/usr/sfw/lib/amd64:/lib/amd64:/usr/lib/amd64:/usr/sfw/lib:/lib:/usr/lib:/opt/csw/lib:.
export MAKE=gmake
For OpenSolaris, install SUNWgcc and SUNWgmake.
Library path

According to Rich Teer’s article, programs should actually be linked with the -R option. This strategy reduces the need for a LD_LIBRARY_PATH.

However, in situations where the program hasn’t been linked that way, there are 2 different ways to configure your library path on Solaris:

set the common LD_LIBRARY_PATH and LD_LIBRARY_PATH_64 environment variables
or use the crle (Configuration Runtime Linker Environment) command.
To list your current paths: crle or crle -64 To set new paths: crle -l -l …

Typical required paths are: /lib, /usr/lib, /opt/csw/lib, /opt/SUNWspro/lib.

GRUB

The menu to edit is in /rpool/boot/grub/menu.lst. You get its location by typing bootadm list-menu
Modifying GRUB live

When the system starts and the GRUB selections shows, edit the boot entries by typing ‘e’. Other commands:
‘d’ to delete a line
‘b’ to boot
Those modifications are temporary.
Restoring GRUB

To restore GRUB (and be able to boot Solaris) when @## someone/something has scratched it, do:

boot from the install CD of Solaris
For Solaris 10, select “6” for a prompt, single user mode
restore the boot loader
installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0d0s0
NB. installboot is now obsolete.

See more information on BigAdmin.

Updating GRUB

The command is:
/mnt/boot/solaris/bin/update_grub -R /mnt
where /mnt is the root one wants to boot.
Booting with or without boot information text

By default, OpenSolaris configures GRUB so that there is a ‘nice’ graphical splash screen. Unfortunately, when you’re fine tuning your OS, this prevents you from seeing the messages, so you might prefer to move back to text boot.
To do so, first, locate the GRUB menu file:
$ bootadm list-menu
the location for the active GRUB menu is: /a/rpool/boot/grub/menu.lst
default 0
timeout 10
0 OpenSolaris 2008.11 snv_101b_rc2 X86 With Splash Screen
Notice in my case, the menu file is located in /a/rpool/boot/grub/menu.lst. Edit that file with your favorite text editor so that such an entry
title OpenSolaris 2009.06 snv_111b With Splash Screen
findroot (pool_rpool,1,a)
splashimage /boot/solaris.xpm
foreground d25f00
background 115d93
bootfs rpool/ROOT/opensolaris-1
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=graphics
module$ /platform/i86pc/$ISADIR/boot_archive
becomes like this:
title OpenSolaris 2009.06 snv_111b text boot
findroot (pool_rpool,1,a)
bootfs rpool/ROOT/opensolaris-1
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/$ISADIR/boot_archive
i.e remove the splashimage, foreground, background and console=graphics from the file.
It’s done ! You can reboot. However, I recommend you always backup your old GRUB menu. NB. This can be modified ‘live’ at boot time, by typing e to edit the GRUB menu when it displays.
Select the default GRUB menu

pfexec bootadm set-menu default=3
The GRUB menu can be located using bootadm list-menu.
Boot environments

It is possible to create several boot environments and boot different versions of Solaris, using a utility named beadm. In particular, the upgrade process actually creates a new boot environment for the new upgrade. Beadm seamlessly handles the tasks of copying all relevant file systems and updating GRUB. To list boot environments
$ beadm list
BE Active Mountpoint Space Policy Created
— —— ———- —– —— ——-
opensolaris – – 7.57G static 2009-01-03 13:18
opensolaris-1 NR / 3.59G static 2009-07-20 22:38
To mount an unmounted boot environment, do
$ beadm mount name /some/where
To destroy a boot environment (deletes the corresponding dataset with all files in it, but only unshared files):
beadm destroy name
For instance, if you destroy opensolaris,
$ beadm destroy opensolaris
$ beadm list
BE Active Mountpoint Space Policy Created
— —— ———- —– —— ——-
opensolaris-1 NR / 11.80G static 2009-07-20 22:38
You can also get information on disk space using:
$ df /
Filesystem 1K-blocks Used Available Use% Mounted on
rpool/ROOT/opensolaris-1
14266663 7646247 6620416 54% /
reboot

Quick reboot:
reboot -f
This command should be faster… To transition between BEs, use the init 6 / luactivate command.
Partitioning

Solaris cuts partition into slices. Those slices are numbered 0 to 7 and they correspond to the ‘s’ of the device (c0t0d0s3 refers to slice number 3). Slice number 2 is reserved and refers to the entire disk by convention.

Slices of a given partition may be listed with format.

On Solaris 10, use the command ‘print’ to show the current layout of a given disk.
partition> print
Current partition table (unnamed):
Total disk cylinders available: 39691 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 – 27046 13.00GB (27047/0/0) 27263376
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 – 39690 19.08GB (39691/0/0) 40008528
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0

partition> 3

Part Tag Flag Cylinders Size Blocks
3 unassigned wm 0 0 (0/0/0) 0

Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl[0]: 27047
Enter partition size[0b, 0c, 27047e, 0.00mb, 0.00gb]: 39690e
partition> print
Current partition table (unnamed):
Total disk cylinders available: 39691 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 – 27046 13.00GB (27047/0/0) 27263376
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 – 39690 19.08GB (39691/0/0) 40008528
3 unassigned wm 27047 – 39690 6.08GB (12644/0/0) 12745152
4 unassigned wm 0 0 (0/0/0) 0

5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0

partition> label
Ready to label disk, continue? yes

partition> quit

format> volname
Enter 8-character volume name (remember quotes)[“”]:secondar
Ready to label disk, continue? yes

On OpenSolaris, use verify.
axelle@boureautic:~# format
Searching for disks…done
AVAILABLE DISK SELECTIONS:
0. c3d0

To show the disk partitions (not slices), use parted (or gparted).
$ parted /dev/dsk/c5t1d0p0
GNU Parted 1.8.8
Using /dev/dsk/c5t1d0p0
Welcome to GNU Parted! Type ‘help’ to view a list of commands.
(parted) print
print
Model: Generic Ide (ide)
Disk /dev/dsk/c5t1d0p0: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 1049kB 106MB 105MB primary ntfs boot
2 106MB 115GB 115GB primary ntfs
3 115GB 273GB 157GB primary
4 273GB 500GB 227GB extended lba
5 273GB 377GB 105GB logical
6 377GB 500GB 123GB logical solaris
ZFS

ZFS is awesome !
Pools

Pool creation

The good news about ZFS is that it’s as great as expected. Storage units may span over partitions: several disks, devices, partitions and even files can be gathered in a single zfs pool, and then, from that pool virtual disk spaces can be provided the way you want.

zpool create -f pool c0d0s6 c0d0s7
Devices can easily be set for mirroring or RAIDZ. It’s as simple as adding a keyword to the command. However, make sure mirroring or raidz is what you need. For instance, my c0d0s6 slice has 15G and c0d0s7 has 17G. If I mirror them, I basically “lose” 2G in the second array. That’s not something I want at home (at work, the answer might be different).

zpool create -f pool raidz c0d0s6 c0d0s7
zfs list
NAME USED AVAIL REFER MOUNTPOINT
pool 87K 15,3G 24,5K /pool
zfs destroy pool
zpool create -f pool c0d0s6 c0d0s7
zfs list
NAME USED AVAIL REFER MOUNTPOINT
pool 87K 32,5G 24,5K /pool
Trying ZFS on simulated disks

Don’t have any available disk slices but want to try ZFS ? It’s possible to simulate pools with a file:
mkfile 100m /disk1
Compression

It’s very easy to set compression

zfs set compression=on pool
For example:

# zpool create -f pool c0d0s6 c0d0 s7
# zfs create pool/axelle
# zfs create pool/opt
# zfs set mountpoint=/opt pool/opt
# zfs set compression=on pool
# zfs set mountpoint=/export/home/axelle pool/axelle
Note before creating the pool, the two slices c0d0s6 & c0d0s7 should be backuped, unmounted and removed from /etc/vsftab. Then, once the pool is created, the original content can be restored. Also, mountpoints are acceptable only if they exist: make sure /export/home/axelle exists first. To see if a given pool has compression on,
$ zfs list -o name,compression
NAME COMPRESS
backup off
backup/backup1 on
rpool off
Quota, Reservations

To see if there is a quota on a ZFS pool:
$ zfs get quota rpool
NAME PROPERTY VALUE SOURCE
rpool quota none default
It’s a good idea to set quotas to make sure your partitions are not 100% full which is a problem (I tested…). To do so, ZFS talks of “reservations”: you reserve a given amount on the partition that should always be free.
$ pfexec zfs set reservation=500m rpool
$ zfs get reservation rpool
NAME PROPERTY VALUE SOURCE
rpool reservation 500M local
Share a pool on NFS

To share a pool on NFS:
zfs set sharenfs=on mypool
zfs get sharenfs mypool
sharemgr show -vp
Pool Status

$ zpool status
pool: rpool
state: ONLINE
status: The pool is formatted using an older on-disk format. The pool can
still be used, but some features are unavailable.
action: Upgrade the pool using ‘zpool upgrade’. Once this is done, the
pool will no longer be accessible on older software versions.
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
c3d0s0 ONLINE 0 0 0
Listing file systems

This is the configuration I currently use on OpenSolaris:
# zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool 41.3G 6.71G 1.42G /a/rpool
rpool/ROOT 5.78G 6.71G 18K legacy
rpool/ROOT/opensolaris 5.78G 6.71G 5.32G /
rpool/dump 895M 6.71G 895M –
rpool/export 32.3G 6.71G 19K /export
rpool/export/home 32.3G 6.71G 551M /export/home
rpool/export/home/axelle 31.7G 6.71G 31.3G /export/home/axelle
rpool/swap 895M 7.50G 88.3M –
The REFER column is the size of the file system if it stood alone.
The MOUNTPOINT column indicates where the file system is to be mounted. It does not indicate the file system is actually mounted. To list more options, such as whether the file system is mounted or not, mountable or not etc, do:
$ zfs list -o name,mountpoint,canmount,mounted
NAME MOUNTPOINT CANMOUNT MOUNTED
rpool /a/rpool on yes
rpool/ROOT legacy off no
rpool/ROOT/opensolaris / noauto no
rpool/ROOT/opensolaris-1 / noauto yes
rpool/dump – – –
rpool/export /export on yes
rpool/export/home /export/home on yes
rpool/export/home/axelle /export/home/axelle on yes
rpool/swap
Snapshots

This is a great feature of ZFS:
Setting up snapshots: time-slider-setup
Mounting a ZFS pool:
zfs import -r Listing snapshots in a given pool:
zfs list -t snapshot
or even: zfs list -t snapshot -o name,used
Destroying a given snapshot (if your system is 100% full and you absolutely need some space):
zfs destroy thesnapshot
Restoring a given snapshot:
zfs rollback -rRf
Troubleshooting ZFS pools

If disks in the pool have changed names (sda, sdb…), the pool won’t be available. To fix, that:
export the pool: sudo zpool export pool
get the id of the disk (if you want to import by disk-id):
$ sudo zpool import
pool: pool
id: 12116846563890507123
state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:

pool ONLINE
ata-WDC_WD5000AADS-00S9B0_WD-WCAV90510116-part6 ONLINE
import the disk by id:
$ sudo zpool import -d /dev/disk/by-id 12116846563890507123
System crash dump

$ pfexec dumpadm
Dump content: kernel pages
Dump device: /dev/zvol/dsk/rpool/dump (dedicated)
Savecore directory: /var/crash/boureautic
Savecore enabled: no
To set the size for the dump on ZFS
zfs set volsize=2G rpool/dump
Swap

$ swap -l
swapfile dev swaplo blocks free
/dev/zvol/dsk/rpool/swap 182,2 8 1832952 1832952
Mounting partitions

To mount existing partitions:

UFS: default file system for Solaris, no need to specify file system type: mount /dev/dsk/… /mountpoint
FAT: use ‘pcfs’ file system type. If the partition is located in a primary partition (number N – for PCs between 1 and 4), you can simply mount that partition:
mount -F pcfs /dev/dsk/c0d0pN /mountpoint
where p0 means the whole disk and p1 to p4 refer to the primary fdisk partitions.
However, there’s another way to mount that partition: c0d0p0:. The letter ranges from c to z, and the number starts at 1. To select the first FAT partition: c0d0p0:1 or c0d0p0:c will do the trick. To select the second partition: c0d0p0:2 or c0d0p0:d. Note it’s always p0. Beware: the letter won’t always match the Windows unit drive. If your first unit drive (C:\) is a NTFS, then D:\ is FAT and E:\ is FAT, the first FAT partition is D:\ … but to mount it in Solaris use c0d0p0:1 or c0d0p0:c !

This method is particularly useful to mount partitions located within extended partition, because there’s no way to address the partition directly with a c0d0pN.

NFS: useful command: sharemgr show -vp
NTFS: not supported by Solaris
For automatic mounting, add an entry to /etc/vfstab:

/dev/dsk/c0d0p3 /dev/rdsk/c0d0p3 /mnt/win_e pcfs 3 yes
To mount a file as a filesystem, use lofiadm (loopback file driver). I haven’t tried that yet, but see instructions here.

Samba: this is a nice solution to mount remote Windows shares.
pfexec mount -F smbfs -o uid=username //host/share /mntpoint
The partition will be mounted for the specified username.
To do so, the samba client service must be started:

pfexec svcadm enable svc:/network/smb/client:default
NB. Samba uses the following packages:
system SUNWsmbau samba – A Windows SMB/CIFS fileserver for UNIX (Usr)
system SUNWsmbfskr SMB/CIFS File System client support (Kernel)
system SUNWsmbfsr SMB/CIFS File System client support (Root)
system SUNWsmbfsu SMB/CIFS File System client support (Usr)
for server:
system SUNWsmbskr SMB Server (Kernel)
system SUNWsmbsr SMB Server (Root)
system SUNWsmbsu SMB Server (Usr)
system SUNWsmbau samba – A Windows SMB/CIFS fileserver for UNIX (Usr)
Mounting a USB card

Plug it in, and then check where it has been mounted using df -h. My mobile phone is mounted in /rmdisk/noname .

Mounting a USB IOMEGA drive

Plug it in. It automatically mounts in /media/IOMEGA_HDD on my system.

Zones

Zones are sorts of virtual environments. You can run different ‘branded’ OS in each zones, in particular other Solaris or… a Linux. The zones (normally) don’t communicate with each other, so it’s a safe (or safer) way to isolate systems. This page explains how to install a Linux Zone on OpenSolaris. Below, I shall rather detail a few common zone commands. Listing zones:
$ zoneadm list -vc
ID NAME STATUS PATH BRAND IP
0 global running / native shared
– lzonelinux installed /a/rpool/zones/lzonelinux lx shared

$ zoneadm list -vc
ID NAME STATUS PATH BRAND IP
0 global running / native shared
1 lzonelinux running /a/rpool/zones/lzonelinux lx shared
running: means the OS in the zone is up and running
installed: means the zone is operational, but it is not running currently
Viewing the configuration for a zone:
$ zonecfg -z lzonelinux
zonecfg:lzonelinux> export
create -b
set zonepath=/rpool/zones/lzonelinux
set brand=lx
set autoboot=false
set ip-type=shared
add net
set address=x.y.z.w/24
set physical=yukonx0
end
add attr
set name=kernel-version
set type=string
set value=2.6
end
Other solution: zonecfg, then info.
zonecfg -z lzonelinux
WARNING: you do not have write access to this zone’s configuration file;
going into read-only mode.
zonecfg:lzonelinux> info
zonename: lzonelinux
zonepath: /a/rpool/zones/lzonelinux
brand: lx
autoboot: false
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: shared
hostid:
net:
address: x.y.z.w/24
physical: yukonx0
defrouter not specified
attr:
name: kernel-version
type: string
value: 2.6
Note that it is not possible to modify the zone path for an installed zone. The zone must first be uninstalled:
pfexec zoneadm -z lzonelinux uninstall
Are you sure you want to uninstall zone lzonelinux (y/[n])? y
To boot an (installed) zone:
pfexec zoneadm -z lzonelinux boot
Then login:
pfexec zlogin lzonelinux
[Connected to zone ‘lzonelinux’ pts/7]
Welcome to your shiny new Linux zone.

To stop (halt) a zone:
pfexec zoneadm -z lzonelinux halt

Detecting hardware

To scan PCI devices, do scanpci (as root).

# /usr/X11/bin/scanpci -v
or
# prtconf -v -p
or
# prtdiag
To list connected hardware

cfgadm -al
To get status of hardware

iostat -En

To detect new hardware

touch /reconfigure
To list USB devices (or removable devices):
$ rmformat -l
Adding a hard disk

When adding a new hard disks, the following tasks should be done:

connect the hard disk and detect it (touch /reconfigure). It is detected when new entries in /dev/rdsk appear, such as c0t1d0*. This can also be confirmed by the format command, which displays all visible disks.
make sure the disk is formatted using the format command: the message “disk formatted” should be displayed
partition the hard disk as desired, using the format command. To list partitions, use the format command. The flag wm means “writable and mountable”, wu “writable but unmountable”, rm “read-only and mountable”.
label the disk once partitions are correct. Use the format command. Then, the prtvtoc command should display the correct layout of partitions.
create a new file system, using newfs (newfs /dev/rdsk/c0t1d0s0). This creates a UFS file system.
mount it ! (using mount) (mount /dev/dsk/c0t1d0s0 /backup)
Network card installation

My network card:

pci bus 0x0002 cardnum 0x00 function 0x00: vendor 0x11ab device 0x4364
Marvell Technology Group Ltd. Device unknown
CardVendor 0x105b card 0x0e0a (Card unknown)
STATUS 0x0010 COMMAND 0x0047
CLASS 0x02 0x00 0x00 REVISION 0x20
BIST 0x00 HEADER 0x00 LATENCY 0x00 CACHE 0x01
BASE0 0x00000000fddfc004 addr 0x00000000fddfc000 MEM 64BIT
BASE2 0x0000ee01 addr 0x0000ee00 I/O
MAX_LAT 0x00 MIN_GNT 0x00 INT_PIN 0x01 INT_LINE 0x0a
BYTE_0 0x00 BYTE_1 0x00 BYTE_2 0xf0 BYTE_3 0x01
Download the Solaris package (I tried version 8.19.2.3), gunzip it, untar. Finally, do pkgadd -d . YUKONXsolx. Then, configure the network.

/etc/rcS.d/S50yukonx
/kernel/drv/amd64/yukonx
/kernel/drv/yukonx.conf
/usr/sbin/yukonx_vlan_config
/usr/share/man/man7d/yukonx.7d
[ verifying class ]
[ verifying class ]
## Executing postinstall script.
add_drv yukonx
starting network interfaces …
yukonx0 started
My Firewire card:

pci bus 0x0003 cardnum 0x06 function 0x00: vendor 0x104c device 0x8024
Texas Instruments TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)
CardVendor 0x105b card 0x0e0a (Foxconn International, Inc., Card unknown)
STATUS 0x0210 COMMAND 0x0006
CLASS 0x0c 0x00 0x10 REVISION 0x00
BIST 0x00 HEADER 0x00 LATENCY 0x40 CACHE 0x01
BASE0 0xfdbff000 addr 0xfdbff000 MEM
BASE1 0xfdbf8000 addr 0xfdbf8000 MEM
MAX_LAT 0x04 MIN_GNT 0x02 INT_PIN 0x01 INT_LINE 0x0a
MAC address

$ arp -a
Apple Time Capsule

Time Capsules are shared using Samba. To discover an existing time capsule, do:
$ smbclient –no-pass -L 192.168.0.13
Domain=[WORKGROUP] OS=[Apple Base Station] Server=[CIFS 4.32]
Sound card

My sound card:

pci bus 0x0000 cardnum 0x14 function 0x02: vendor 0x1002 device 0x4383
ATI Technologies Inc SB600 Azalia
CardVendor 0x105b card 0x0e0a (Foxconn International, Inc., Card unknown)
STATUS 0x0410 COMMAND 0x0006
CLASS 0x04 0x03 0x00 REVISION 0x00
BIST 0x00 HEADER 0x00 LATENCY 0x40 CACHE 0x01
BASE0 0x00000000fe024004 addr 0x00000000fe024000 MEM 64BIT
MAX_LAT 0x00 MIN_GNT 0x00 INT_PIN 0x01 INT_LINE 0x0b
BYTE_0 0x00 BYTE_1 0x00 BYTE_2 0x02 BYTE_3 0x00
On Solaris 10, I use the OSS driver oss-solaris-v4.1-rc2-i386.pkg. On OpenSolaris, the sound card is automatically recognized 🙂
pkgadd -d oss-solaris-v4.1-rc2-i386.pkg
[…]
## Installing part 1 of 1.
/etc/oss/devices.list
/etc/oss
/etc/oss/version.dat
/kernel/drv/amd64/oss_hdaudio
/usr/bin/osstest
/usr/bin/ossxmix
/usr/include/oss/oss_userdev_exports.h
/usr/include/oss
/usr/include/sys/soundcard.h
/usr/man/man1/ossinfo.1
/usr/man/man7d/oss_hdaudio.7d
/usr/sbin/ossdetect
/usr/sbin/ossdevlinks
/usr/sbin/osslic
/usr/sbin/ossupdate
/usr/sbin/savemixer
/usr/sbin/soundoff
/usr/sbin/soundon
/usr/sbin/vmixctl
## Executing postinstall script.
Setting up Open Sound System….please wait
unloaded osscommon
can’t unload the module: Device busy
add_drv -m ‘* 0666 root sys’ osscore
add_drv -m ‘* 0666 root sys’ -i ‘”pci1002,4383″‘ oss_hdaudio
devfsadm: driver failed to attach: oss_hdaudio
Warning: Driver (oss_hdaudio) successfully added to system but failed to attach
add_drv -m ‘* 0666 root sys’ -i ‘”usbif,class1″‘ oss_usb
devfsadm: driver failed to attach: oss_usb
Warning: Driver (oss_usb) successfully added to system but failed to attach
add_drv -m ‘* 0666 root sys’ oss_sadasupport
devfsadm: driver failed to attach: oss_sadasupport
Warning: Driver (oss_sadasupport) successfully added to system but failed to attach

Then reboot, and try /usr/bin/osstest and see which devices works correctly.

Sound subsystem and version: OSS 4.2 (b 2005/201108060332) (0x00040100)
Platform: SunOS/i86pc 5.11 snv_111b

*** Scanning sound adapter #-1 ***
/dev/oss/oss_hdaudio0/pcm0 (audio engine 0): HD Audio play front
– Performing audio playback test…
left OK OK OK
/dev/oss/oss_hdaudio0/pcm1 (audio engine 1): HD Audio play rear
– Performing audio playback test…

Then, rename /dev/dsp:
ln -sf /dev/oss/oss_hdaudio0/pcm4 /dev/dsp
See Tips and tricks of OSS for more details.

To disable the system beep: xset -b

To set volume: if you have Gnome: gnome-volume-control

On OpenSolaris, I experienced after a while some warning messages when booting (the OSS driver was complaining about undefined symbols). To solve this issue,
backup /etc/oss/installed_drivers
remove the line with ossusb in that file (it’s old and obsolete and one reason for the errors — see this forum
remove the oss driver:
pfexec rem_drv oss_usb
If you do modinfo, you should not see oss_usb any longer.
then, restart the oss driver:
chmod u+x /etc/init.d/oss
pfexec ./oss stop
pfexec ./oss start
To get some information on what’s installed concerning OSS sound drivers:
$ ossinfo
Version info: OSS 4.2 (b 2006/201202040133) (0x00040100)
Platform: SunOS/i86pc 5.11 snv_111b (boureautic)

Number of audio devices: 8
Number of audio engines: 12
Number of MIDI devices: 0
Number of mixer devices: 1

Device objects
0: osscore0 OSS common devices
1: oss_hdaudio0 ATI HD Audio interrupts=855 (1871)
HD Audio controller ATI HD Audio
Vendor ID 0x10024383
Subvendor ID 0x105b0e0a
Codec 3: ALC888 (0x10ec0888/0x105b0e0a)
2: oss_sadasupport SADA compatibility layer
Video card

OpenSolaris
For the ATI card:
remove any xorg.conf you may have (unless specific settings), the default settings are fine for this card
remove NVidia drivers if any (pkgrm NVDAgraphicsr NVDAgraphics)
reboot — -r
For the NVidia card (I have a Nvidia PCI Express N9400GT 512M DDR2)
get Solaris drivers from NVidia’s site (NVDAgraphicsr and NVDAgraphics) and install them
configure X for Nvidia: nvidia-xsettings
reboot — -r
NVidia provides helpful documentation to install its drivers on Solaris.
Screen resolution

Solaris:
Show acceptable screen configurations (SPARC ONLY):

ffbconfig -prconf
Try a given resolution (SPARC ONLY):

ffbconfig -res xxyyz try
If ffbconfig fails to set the correct resolution (bug), use eeprom:

eeprom ouput-device=r1024x768x60
To set 24 bit mode:

ffbconfig -deflinear true
Keyboard

To change the keyboard layout, do:
# svccfg
svc:> select keymap:default
svc:/system/keymap:default> setprop keymap/layout = German
svc:/system/keymap:default> exit
# svcadm refresh keymap:default
Printers

On OpenIndiana: Canon Pixma MP160 is automatically recognized (at hot plug) by CUPS using driver: Canon PIXMA MP160 – CUPS+Gutenprint v5.2.4.

I still can’t get Canon Pixma MP230 to work on OpenIndiana though.
Scanners

On OpenIndiana: My scanner is found, but I can’t manage to scan 🙁
$ sane-find-scanner
found USB scanner (vendor=0x04a9 [Canon], product=0x1714 [MP160]) at libusb:/dev/usb:4a9.1714/0
$ scanimage -L
device `pixma:04A91714_75413F’ is a CANON Canon PIXMA MP160 multi-function peripheral
Advanced Lights Out Manager

Copyright 2007 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.

Sun(tm) Advanced Lights Out Manager 1.6.6

Please login: USERNAME
Please Enter password: **************

astra_> poweron
SC Alert: Host System has Reset

astra_> console
Misc commands

Getting the location of the CD or DVD burner:
cdrecord -scanbus
scsibus5:
5,0,0 500) ‘HL-DT-ST’ ‘DVD-RW_GSA-H41N ‘ ‘RA00’ Removable CD-ROM
Ejecting a CD: eject
Boot prompt: stop-A at any moment to get there
boot -m verbose -> to understand what’s happening
boot cdrom -> to boot on CD-ROM !

Installing Solaris

On a Sparc

on prompt ‘ok’ (stop-A to get there), type ‘boot cdrom’… to boot the Solaris 10 CDs !
check the compatibility list with Sun’s Device Detection Tool: download the Sun Download Manager first, then launch the detection tool: javaws sddtool_20.jnlp &
make sure all network interfaces (hme0, hme1…) are plugged to the local network
for network configuration, beware that using DHCP means the network interfaces are expected to receive their IP address AND hostname from the DHCP server. If hostname is not sent, a script is mandatory to set it at each boot. Otherwise use static IP addresses, setting the gateway and the network mask.
default install is okay to use. It creates 3 partitions
c0t0d0s0 for / (5059 MB in my case)
c0t0d0s1 for the swap (512 MB)
c0t0d0s7 for /export/home (13885MB)
for software installation, select the Entire Group of Solaris 10 Software. Companion Software (freeware utilities such as gcc, make, xpdf etc) are nice to have.
On x86

The first thing to do is check one’s hardware is compatible with Solaris. Sun offers a Java based detection tool . It requires installation of a JRE 1.5. This tool worked fine on my host.

Then, the installation basically goes as follows. Most of the time, default selects are appropriate and there are no changes to do. That’s cool.

GNU Grub install : select Solaris (default)
Select Solaris interactive installation (default).
Select English as language. Actually, I usually hate to chose any other language, because translations are so poor I have to ‘reverse’ back to English to hope to understand what’s going on… My advice here is definitely, select English, unless you really don’t understand English (but then, I wonder how you cope everyday as a computer science engineer).
Set your hostname.
Set timezone, and root password
Ask for a Standard Installation (not Flash)
Configure for automatic eject and reboot
Then, select Locale: initial locale POSIX C looks fine
select solaris software: entire distribution (4740 MB)
select disks to install Solaris (they are labeled cXdY). It’s possible to use fdisk to create a Solaris Partition.
Installing OpenSolaris

Download and burn the latest CD of OpenSolaris. The current release (2008.11) fits on a single CD. It is both an installation CD and a Live CD. Let OpenSolaris boot from the CD, then click on “Install OpenSolaris” to get the work started.

Upgrading OpenSolaris

The only thing you need to do is:
pfexec pkg install SUNWipkg
Then, relaunch the update manager from a GNOME environment, and have it download all updates. It’ll download approximately 800Mb, so depending on your bandwidth, it may take time. Once all packages are downloaded, it’s quite quick to update. It’ll configure a new boot environment. Reboot, everything’s fine ! Yeeeaaah !
The upgrade process actually creates a new boot environment so that, once the upgrade is complete, you can still boot the old (or the new) version.
$ beadm list
BE Active Mountpoint Space Policy Created
— —— ———- —– —— ——-
opensolaris – – 7.57G static 2009-01-03 13:18
opensolaris-1 NR / 3.59G static 2009-07-20 22:38
On a ZFS point of view, the boot environments correspond to two different file systems:
$ zfs list -o name,mountpoint,canmount,mounted
NAME MOUNTPOINT CANMOUNT MOUNTED

rpool/ROOT/opensolaris / noauto no
rpool/ROOT/opensolaris-1 / noauto yes
Note that, of course, only one of these file systems is actually mounted. In my case, the new file system with 2009.06 is rpool/ROOT/opensolaris-1.
$ zfs list
NAME USED AVAIL REFER MOUNTPOINT

rpool/ROOT/opensolaris 7.18G 5.42G 6.75G /
rpool/ROOT/opensolaris-1 3.43G 5.42G 7.40G /
There are shared blocks between both file systems, because not all files change when a system is upgraded, so they are not updated, and get shared between both file systems. Keeping both boot environments takes disk place. If you are short of disk space, you can safely remove the old boot environment and will get back the size of the unshared, no longer used files (don’t expect 7G back). The command is :
$ beadm destroy opensolaris
$ beadm list
BE Active Mountpoint Space Policy Created
— —— ———- —– —— ——-
opensolaris-1 NR / 11.80G static 2009-07-20 22:38
$ zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool 42.2G 5.76G 1.42G /a/rpool
rpool/ROOT 10.3G 5.76G 18K legacy
rpool/ROOT/opensolaris-1 10.3G 5.76G 7.41G /
rpool/dump 895M 5.76G 895M –
rpool/export 28.7G 5.76G 19K /export
rpool/export/home 28.7G 5.76G 654M /export/home
rpool/export/home/axelle 28.1G 5.76G 27.7G /export/home/axelle
rpool/swap 895M 6.55G 88.3M –
Which version of OpenSolaris do I have ?

Do uname -a, and have a look at the “snv” version.
Version uname label
2008.05 snv_86_rc3
2008.11 snv_101b
2009.06 snv_111b
Another solution is to cat /etc/release.
Release or Developer versions ?

Like Ubuntu and Debian have stable and unstable versions, OpenSolaris has a release version (stable) and a developer branch (unstable). To install and download packages from the release version, have the package manager (/usr/bin/packagemanager) use this URL:
http://pkg.opensolaris.org/release
or this one for the developer version:
http://pkg.opensolaris.org/dev
Updating OpenSolaris

pfexec pkg image-update -v
or updatemanager. or packagemanager (for packages).
Upgrading Solaris 10

u4 to u5

You need the u5 DVD (available from Sun’s website). The other alternative is to perform a live upgrade, but it seems somewhat complicated, you need a backup disk etc: try it for servers you can’t stop.

With the u5 DVD, it’s very simple:

boot on the DVD
the beginning is like a normal installation: set hostname, timezone, root password…
specify this is an upgrade and not a full re-install. The upgrade procedure will remove your u4 patches and proceed with u5 installation.
let the system install reboot (remove the DVD)
After reboot, the system failed to mount my ZFS partitions (/usr/sbin/zfs mount -a). It complained /opt wasn’t empty: indeed, the installation procedure had put Star Office 8 in /opt, whereas I already have a ZFS /opt partition: so the ZFS /opt failed to mount. This has been easily fixed by temporarily moving Star Office to /, mounting the ZFS partition, and then moving back Star Office to the new ZFS /opt.

Apart from this slight problem, upgrade proceeded without any problem. It even kept my specific network driver, and of course did not overwrite any other partition than /.

u5 to u6

The nice thing with u6 is that it supports ZFS boot. If possible, do not use CDs but DVDs: there’s a known bug on CD 2 that occurs from time to time.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>