Solaris Tips For Linux Users e
Solaris Tips For Linux Users e
Introduction
Overview
This document is explained about the operation and the management of
Oracle Solaris for Linux users.
Notes
Oracle Solaris is sometimes referred to as 'Solaris'.
Oracle VM Server for SPARC is sometimes referred to as Oracle VM or 'OVM'.
The commands explained in this document are based on the following system
environments:
Linux
Solaris
Slide that has the Solaris mark explains the Solaris functions:
Solaris
Position
This document
Planning
Implementation
This document is for Linux users who need help to operate Solaris
2
Contents
Introduction
1. Starting up and Shutting down the OS Environment
2. Package Administration
3. User Administration
4. Network Administration
5. Service Administration
6. File System and Storage Administration
7. Monitoring
Solaris
Oracle Solaris
Physical partition
OBP
XSCF-LAN
XSCF
Hardware
5
Oracle Solaris
Remarks
Power off
OS off (*1)
* 1: OBP is on
s (S)
Single user
Single user
System Admin
Unused
Multiple users
Unused
X Window (*4)
Power off
Restart OS
Restart OS
- Run levels that are important to remember are: 0 (OS off), s (Single User), 3 (Multiple
users), 5 (Power Off), 6 (Restart OS).
- For more information about the changes to the service boot based on the run level,
please see: Section 5. Service Administration.
6
Booting the OS
Linux and Solaris OS booting
Linux
Switch on the hardware and select the boot kernel from the GRUB
environment.
Choose boot in single user mode by modifying the GRUB options.
Solaris
Switch the hardware power on, boot via the OBP (Open Boot PROM).
The OBP is a similar environment to the PC server BIOS or Linux GRUB.
Use the exclusive command displayed as ok (referred to as the ok prompt).
Example
Solaris OS boot
{0} ok boot
- The OBP environment allows you to choose the boot disk and boot options (single user
mode, etc.). In addition, you can check all of the connected devices and the settings of
the OBP parameters.
7
Solaris
Example
Terminating Solaris OS
# shutdown -y -g0 -i0
Restarting Solaris OS
# shutdown -y -g0 -i6
Oracle Solaris
Boot OS
OS shutdown
OS restart
Other Examples
-Terminate at 10:00
# shutdown -h 10:00
-Terminate in 5 minutes
# shutdown -h +5
For more details please see: Oracle Solaris command casebook for Linux users.
10
Solaris
Settings
English
Japanese (EUC)
ja_JP.eucJP ,ja
Japanese (Shit-JIS)
ja_JP.PCK
Japanese (UTF-8)
ja_JP.UTF-8
Solaris
Boot administration
Boot Environment (BE) allows you to create/delete/multiply BEs.
You can create a new BE using 'snapshots' acquired through the current BE.
Select the BE and restart the OS and you will be able to change to a new BE.
The use of snapshots means only a small amount of disk space is required.
Linux allows you to use GRUB to select booting of the pre-update kernel. In
Solaris, this can be achieved using the BE functions.
BE image
Create a new BE
BE01
BE01
BE01
BE02
BE01
BE02
BE02
BE02
BE01
BE01
Free
Space
BE01: Current BE
BE02: New BE. Because they refer to
the same area, no extra space is
required at time of creation.
12
2. Package Administration
13
Servers
Package
Media
Linux Server
or
or
Package
14
Solaris Server
Solaris
Media
External network
Unconnected servers
Local repository
server
Package offer
Repository image
Package
SRU
Add update
package
Oracle Solaris
Update confirmation
yum check-update
Package update
yum update
pkg update
Install
Search
pkg list
For more details please see: Oracle Solaris command casebook for Linux users.
16
Solaris
BE switch-back image
Failure Occurs
New operation
Operation environment
environment
Active
BE creation
(1)
Inactive
(2)
Inactive
Active
(3)
Inactive
Active
Specify rollback to
previous environment
(4)
Active
OS
restart
Inactive
Restart using
previous environment
(5)
- The BE is not a system backup. System back ups are still needed to deal with disk or
other failures.
17
Solaris
Example
# beadm list
BE
Active Mountpoint Space Policy Created
------- ---------- ------ ------- ------solaris-1
- 9.67M static 2012-11-06 15:08
solaris-2
NR /
3.82G static 2012-11-06 15:30
Active Status
N: Current BE
R: Next BE
Example
{0} ok boot -L
Boot device: /virtual-devices@100/channel-devices@200/disk@1 File and args: -L
1 solaris-1
2 solaris-2
Select environment to boot: [ 1 - 2 ]:1
3. User Administration
19
Oracle Solaris
Operations
Administration by CLI is
standard
* GUI admin is also possible
Root
User/Role
User
All users can become root
users
Group
- User administration commands (useradd, usermod, userdel, etc.) are the same as in
Linux, but care is required as the Solaris meanings and options may be different.
20
Solaris
Login parameters
Login parameter settings are stored at /etc/default/login.
Variable
Explanation
CONSOLE
Once set, only a super user can login through this device
PATH
SUPATH
TIMEOUT
SLEEPTIME
Amount of time in seconds until the login failure message is displayed on screen
RETRIES
- There is no need to edit the files (/etc/passwd or /etc/shadow) every time an account or password is
changed. Instead, this is done through the (usermod, passwd) commands.
- The encryption method (Hash) is a default setting, but can be changed.
21
Oracle Solaris
Maximum deadline
# chage -M 90 <username>
# passwd -x 90 <username>
Minimum deadline
# chage -m 30 <username>
# passwd -n 30 <username>
Display password
expiry information
# chage l <username>
# passwd -s <username>
admin PS 05/27/14 30 90
Username
Status
Date
change
Minimum
deadline
Maximum
deadline
- User password expiration settings in Linux are also available in Solaris. However, the
commands and options are different.
22
Oracle Solaris
Add
useradd <username>
useradd <username>
Update
Delete
userdel <username>
userdel <username>
chage -l <username>
passwd -s <username>
chage -m 60 <username>
passwd -x 60 <username>
chfn
passwd -g
For more details please see: Oracle Solaris command casebook for Linux users.
24
Solaris
Project A
User 1
Solaris
Parameter A: 100
Parameter B: 20
Application
Middleware
Application
Middleware
Project B
User 2
Parameter A: 200
Parameter B: 50
- Resources include: CPU run time for processes, core file sizes, maximum heap size and
IPC parameters. Project parameter settings can be changed while the OS is running.
25
4. Network Administration
26
Oracle Solaris
Set IP
address
Network
interface
name
ethXX
e.g.: eth0, eth1
ethtool command
dladm command
It is possible to create a virtual NIC at
the datalink layer via the network
virtualization function.
IP layer
admin
ifconfig command
ipadm command
Redundancy
function
Bonding
IPMP
Datalink
layer admin
- The Solaris network management system and command mechanisms have changed
significantly since Solaris 11. Network redundancy configuration via standard OS
functions and network virtualization is now possible.
27
ipadm
IP layer administration command.
IP addresses are administrated, set and deleted as address objects in the
form of an 'interface name/character string'.
Solaris
# ipadm show-addr
- Linux: After setup using ifconfig, a definition file must be created to continue using the interface.
- Solaris: The file is automatically updated by the ipadm command.
28
Solaris
show-link
CLASS MTU STATE OVER
phys 1500 up -phys 1500 up --
STATE: status
up: link up
down: link down
IP address setting
IP address confirmation
# ipadm show-addr
29
Oracle Solaris
Setting IP address
# vi /etc/sysconfig/network-scripts/ifcfg-<device>
# ipadm create-addr -T static -a local=<IP
IPADDR=<IP address>
address>/<mask> <device>
# service network restart
Setting DHCP
# vi /etc/sysconfig/network-scripts/ifcfg-<device>
BOOTPROTO=dhcp
# ipadm create-addr -T dhcp <device>
# service network restart
Confirming IP address
# ifconfig
# ipadm show-addr
Gateway settings
# vi /etc/sysconfig/network
GATEWAY=<IP address>
# service network restart
Gateway information
confirmation
# netstat -rn
# netstat -rn
Display network
devices
# ethtool eth0
# dladm show-link
# dladm show-phys (Physical NIC)
For more details please see: Oracle Solaris command casebook for Linux users.
30
Solaris
IPMP
Fault detection
Communication routes are automatically redirected if an NIC fault is detected.
Recovery detection
The communication routes automatically revert to the previous routes when the NIC
fault recovers.
Load balancing
The load is balanced across several NICs to avoid data bottlenecks.
Solaris
Set it to run in
standby mode
- As above, you can use the ipadm command to set all the IPMP settings. By using subcommands you can carry out further setting changes.
32
5. Service Administration
33
Service Administration
Linux and Solaris service administration mechanism
Linux
During OS booting, the service startup scripts (rc scripts) in the /etc/init.d
directory are executed in order, in accordance with the run level, as the OS is
booting.
The dependencies between services need to be managed on a per-service basis
(controlled using the startup scripts).
Solaris
SMF (Service Management Facility) manages all the service inter-dependencies. When a
service starts up or shuts down, the interdependent services can be started or shut down
beforehand.
If a service stops due to a system fault or failure, it will restart automatically (self-healing).
You can check the reason for a system shutdown and whether any other services are
affected.
rc scripts are called a legacy scripts, and this old service management mechanism is kept
for compatibility.
- Linux service administration is equivalent to that on Solaris 9 and prior versions.
- The Solaris SMF is not just a boot service. It monitors the status of running services and can be used
to check the cause and identify the consequences if a service stops due to a fault.
34
- - -start service
- - -stop service
- - -Enable automatic service start
- - -Disable automatic service start
Solaris
svcadm manages everything.
The configuration of services remains unchanged after OS shutdown. When the OS is
next booted the previous settings resume.
Example
#
#
#
#
svcadm
svcadm
svcadm
svcadm
enable -t httpd
disable -t httpd
enable httpd
disable httpd
- - - start service
- - -stop service
- -Enable automatic service start/service start
- -Disable automatic service start/service stop
- On Solaris, the start/stop setting for a service is retained when the OS is next booted.
- To change the start/stop setting for a service temporarily (until next OS shutdown), use the -t option.
35
Oracle Solaris
Service start
Service stop
Display services
chkconfig --list
svcs a
For more details please see: Oracle Solaris command casebook for Linux users.
- FMRI is a method for describing services in terms of category, service name and instance
name.
svc:/network/http:apache22
Category: network
Service name: http
Instance name: apache22
36
Solaris
svc.startd
A service
(dependence)
C service
multi-user
(dependence)
rcS procedure
multi-user-server
(dependence)
rc2 procedure
rc3 procedure
38
Oracle Solaris
Storage volume
administration
File system
ZFS
zfs command
16TB
256 quadrillion ZB
256 quadrillion ZB
Redundancy creation
Mount
Logical volume
(LV)
/data
/usr
---
Allocate
Physical
volume
(PV)
Physical
volume
(PV)
40
Solaris
/usr
---
Storage pool
RAID
configuration
41
Solaris
Non-redundant
Striping (RAID-0)
Storage pool
mirror
Multiple mirrors possible (RAID-1)
Physical
disk
Physical
disk
RAID-Z
Physical
disk
RAID-Z2
RAID-Z3
Triple parity
- The Solaris storage pool can improve the file system performance and reliability by
forming a RAID and registering the physical disks.
42
ZFS Snapshot
Solaris
Snapshot
Previous data's
update
(change/deletion)
Previous
data
(Update)
Snapshot
(Data before
update)
Solaris Backup/Restore
Solaris
Storage pool
Backup
Snap
shot
zfs send
Backup
Data
zfs receive
Forward
Data
Tape device /
External media
Restore
44
Oracle Solaris
Snapshot creation
Partition operation
format
For more details please see: Oracle Solaris command casebook for Linux users.
45
Solaris
Device directory
*: dsk indicates block device and rdsk character device (raw device)
46
Solaris
A Solaris partition is also known as a slice'.
The number of slices created depends upon the disk label.
s2
Put s0-s7 after the device name to specify a device path
(e.g :/dev/rdsk/c2t0d1s0).
The SMI label s2 is a special slice that represents the entire disk.
Slice settings are set with the format command.
s0
s1
s3
s4
s5
s6
s7
47
Solaris
Specify hsfs as file system format.
Example
48
Solaris
Summary
/dev
/devices
/etc
/bin
/sbin
/usr/lib
/proc
/tmp
Directory for temporary file use. tmpfs used for file systems on memory.
7. Monitoring
50
System Monitoring
Linux and Solaris log monitoring
Linux
System message log output is defined in /etc/rsyslog.conf.
Solaris
System message log outputs is defined in /etc/syslog.conf.
As under Linux, the system message is displayed to the login user and
administrator and is transferable to other servers.
As under Linux, OS commands are provided for checking the system
performance information (CPU and memory use, etc.).
Some monitoring commands are available only on Solaris.
51
Oracle Solaris
/var/log/messages
/var/adm/messages
/var/log/maillog
/var/log/syslog
/var/log/cron
/var/cron/log
Log rotation
As with Linux, Solaris will set items for each log file and is periodically
executed by cron.
Oracle Solaris
Settings for each log file to be rotated are set in
-/etc/logadm.conf
/var/adm/messages -C 4 -a '/usr/sbin/svccfg -s
svc:/system/system-log refresh '
-C : Generation to be saved
-a : After changing the log file name, execute
command enclosed in ' '.
52
Oracle Solaris
cat /proc/cpuinfo
cat /proc/meminfo
lspci
prtdiag
Oracle Solaris
Network status
ethtool, ping
dladm, ping
Service status
service
svcs
Process status
pstree, ps
ptree, ps
Process trace
strace
truss
Oracle Solaris
System uptime
uptime
uptime
mpstat, vmstat
iostat, iotop, netstat
top, pidstat
top, prstat
53
Oracle Solaris
mpstat
vmstat
iostat
mpstat
vmstat
iostat
cat /proc/cpuinfo
cat /proc/meminfo
lspci
prtdiag
ping
ping
ps -ef
ps -ef
For more details please see: Oracle Solaris command casebook for Linux users.
- Commands such as the top command used to monitor process status are also usable in
Solaris.
54
Solaris
About cron
Cron editing
cron editing is done via the crontab command.
# crontab -e
10 3 * * * /usr/sbin/logadm
- - - format
m h dd mm day command
Display settings
To display the cron settings, use the crontab command.
# crontab -l
10 3 * * * /usr/sbin/logadm
55
Reference: URL
Oracle company manual
Oracle Solaris 11.1 Information Library
http://docs.oracle.com/cd/E37932_01/
- Command Reference and Manual is available to administrators and developers.
Server manual
Fujitsu M10/SPARC M10 Systems System Operation and Administration Guide
http://jp.fujitsu.com/platform/server/sparc/manual/en/c120-e679-06en/index.html
- The manual illustrates necessary basic operations for system deployment and
administration.
56
Revision History
Revision
1.0
Release date
October, 2014
Update page
Update contents
First Edition
57
The contents of this document (images, audio and documents) are protected by intellectual
property rights, copyright, trademark rights, etc. It can be downloaded and printed out for
personal use. However, for other uses (for example, posting on personal websites or
uploading to a server) the permission of the copyright holder or Fujitsu will be required.
Warranty limits
The company will not assume any legal responsibilities that arise from the use of the
contents and does not guarantee compatibility, accuracy, merchantability to purpose of use.
Contents may be changed or discontinued without notice.
Trademarks
UNIX is an open group registered trademark in the United States and other countries.
SPARC Enterprise, SPARC64, SPARC64 Logo and all other SPARC trademarks, are used
under the United Sates SPARC International Inc. license, and are registered trademarks in
the United States and other countries.
Oracle and Java are registered trademarks of the Oracle Corporation and its subsidiaries in
the United States and other countries.
All other trademarks and trade names are properties of their respective owners. All rights
reserved.
58