Solaris Commands
Solaris Commands
A special area of every disk is set aside for storing information about the disk
's controller, geometry, and slices. This information is called the disk's label
. Another term that is used to described the disk label is the VTOC (Volume Tabl
e of Contents) on a disk with a VTOC label. To label a disk means to write slice
information onto the disk. You usually label a disk after you change its slices
.
The Oracle Solaris release supports the following two disk labels:
SMI
The traditional VTOC label for disks that are less than 2 TB in size.
EFI Provides support for disks that are larger than 2 TB. The Extensible Fir
mware Interface GUID Partition Table (EFI GPT) disk label is also available for
disks less than 2 TB.
If you fail to label a disk after you create slices, the slices will be unavaila
ble because the OS has no way of knowing about the slices.
STATE
ONLINE
ONLINE
STATE
ONLINE
ONLINE
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
Dimensions:
512 bytes/sector
63 sectors/track
255 tracks/cylinder
16065 sectors/cylinder
2609 cylinders
2607 accessible cylinders
Flags:
1: unmountable
10: read-only
Unallocated space:
First
Sector
Last
Sector
Count
Sector
0 2120580 2120579
First
Sector
Last
Partition Tag Flags
Sector
Count
Sector Mount Directory
0
2
00
2120580 39760875 41881454
1
3
01
16065 2104515 2120579
2
5
01
0 41881455 41881454
8
1
01
0
16065
16064
root@opensolaris:/etc#
root@opensolaris:/etc# grep /export /etc/mnttab - shows mounted fs type
rpool/export
/export zfs
rw,devices,setuid,nonbmand,exec,xattr,atime,dev=
2d90006 1384869126
root@opensolaris:/etc# grep /tmp /etc/vfstab
swap
/tmp
root@opensolaris:/etc#
tmpfs
yes
i8042, instance #0
keyboard, instance #0
mouse, instance #0
lp, instance #0
pit_beep, instance #0
pci, instance #0
pci8086,1237 (driver not attached)
pci8086,7000 (driver not attached)
pci-ide, instance #0
ide, instance #0
cmdk, instance #0
ide, instance #1
sd, instance #0
display, instance #0
pci1022,2000, instance #0
pci80ee,cafe (driver not attached)
pci8086,0 (driver not attached)
pci106b,3f, instance #0
pci8086,7113 (driver not attached)
pseudo, instance #0
agpgart, instance #0
options, instance #0
xsvc, instance #0
used-resources (driver not attached)
cpus, instance #0
cpu (driver not attached)
root@opensolaris:/etc#
----------------------------------------------------------------root@opensolaris:/# getconf -a = shows kernel parameters
----------------------------------------------------------------System Administration Commands
ndd(1M)
NAME
ndd - get and set driver configuration parameters
SYNOPSIS
ndd [-set] driver parameter [value]
root@opensolaris:/# last
reboot
system boot
reboot
system down
reboot
system boot
reboot
system down
reboot
system boot
reboot
system down
reboot
system boot
reboot
system down
reboot
system boot
reboot
system down
reboot
system boot
reboot
system down
reboot
system boot
Tue
Tue
Tue
Fri
Fri
Fri
Fri
Thu
Thu
Thu
Thu
Thu
Thu
Nov
Nov
Nov
Dec
Dec
Dec
Dec
Dec
Dec
Dec
Dec
Dec
Dec
19
19
19
5
5
5
5
4
4
4
4
4
4
08:51
08:49
08:13
09:22
09:20
09:17
09:11
21:09
21:07
21:05
21:01
21:00
20:45
root@opensolaris:/# swap -l
swapfile
dev
swaplo blocks
free
/dev/dsk/c3d0s1
102,1
8 2104504 2097560
root@opensolaris:/#
root@opensolaris:/# kstat -n pcn0 | egrep 'ifspeed | duplex'
ifspeed
0
ifspeed
0
root@opensolaris:/# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index
1
inet 127.0.0.1 netmask ff000000
pcn0: flags=201004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4,CoS> mtu 1500 ind
ex 5
inet 0.0.0.0 netmask ff000000
ether 8:0:27:b9:96:cc
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index
1
inet6 ::1/128
=============================================
root@opensolaris:/# svccfg -s system/identity:node listprop
general
framework
general/enabled
boolean true
start
method
start/exec
astring /lib/svc/method/identity-node
start/timeout_seconds
count
60
start/type
astring method
tm_common_name
template
tm_common_name/C
ustring "system identity (nodename)"
tm_man_nodename
template
tm_man_nodename/manpath
astring /usr/share/man
tm_man_nodename/section
astring 4
tm_man_nodename/title
astring nodename
restarter
framework
NONPERSISTENT
restarter/logfile
astring /var/svc/log/system-identity:node.lo
g
restarter/start_pid
count
25
restarter/start_method_timestamp time
1384869108.094310000
restarter/start_method_waitstatus integer 0
restarter/transient_contract
count
restarter/auxiliary_state
astring none
restarter/next_state
astring none
restarter/state
astring online
restarter/state_timestamp
time
1384869108.109161000
root@opensolaris:/# svccfg -s system/identity:node listprop config
root@opensolaris:/#
=================================================================
root@opensolaris:/etc# sysdef -h = shows host id
*
* Hostid
*
00484ae5
root@opensolaris:/etc# uname -mp = shows machine type (m) and processor (p)
i86pc i386
---------------------------------root@opensolaris:/etc# ls -l /sbin/rc* = runlevel scripts
-rwxr--r--rwxr--r--rwxr--r--rwxr--r--rwxr--r--rwxr--r--rwxr--r--
3
1
1
1
3
3
1
root
root
root
root
root
root
root
sys
sys
sys
sys
sys
sys
sys
2634
2893
2884
2807
2634
2634
4901
2008-11-19
2008-11-19
2008-11-19
2008-11-19
2008-11-19
2008-11-19
2008-11-19
19:13
19:13
19:13
19:13
19:13
19:13
19:13
/sbin/rc0
/sbin/rc1
/sbin/rc2
/sbin/rc3
/sbin/rc5
/sbin/rc6
/sbin/rcS
===============================================================
opens@opensolaris:~$ bootadm list-menu
The location for the active GRUB menu is: /rpool/boot/grub/menu.lst
default 0
timeout 30
0 OpenSolaris 2008.11 snv_101b_rc2 X86
1 OpenSolaris 2008.11 snv_101b_rc2 X86 text boot
opens@opensolaris:~$
opens@opensolaris:~$ eeprom
ata-dma-enabled=1
atapi-cd-dma-enabled=1
ttyb-rts-dtr-off=false
ttyb-ignore-cd=true
ttya-rts-dtr-off=false
ttya-ignore-cd=true
ttyb-mode=9600,8,n,1,ttya-mode=9600,8,n,1,lba-access-ok=1
keyboard-layout=Unknown
console=text
opens@opensolaris:~$ su - root
Password:
Sun Microsystems Inc. SunOS 5.11
snv_101b
You have new mail.
root@opensolaris:~# eeprom keyboard-layout=US-English
root@opensolaris:~# eeprom
ata-dma-enabled=1
atapi-cd-dma-enabled=1
ttyb-rts-dtr-off=false
ttyb-ignore-cd=true
ttya-rts-dtr-off=false
ttya-ignore-cd=true
ttyb-mode=9600,8,n,1,ttya-mode=9600,8,n,1,lba-access-ok=1
keyboard-layout=US-English
console=text
root@opensolaris:~#
****************************************************
318 dladm show-phys
319 kstat -n pcn0 | egrep 'ifspeed | duplex
320 '
321 kstat -n e1000g0
322 kstat -n pcn0 | egrep 'ifspeed | duplex'
323 kstat -n e1000g0 | egrep 'ifspeed | duplex'
324 netadm list
325 where netadm
326 ipadm create-ip e1000g0
327 man ipadm
November 2008
328 arch
329 cat /etc/release
330 who -r
331 uname -r
332 cat /etc/hostname.hme0
333 ls -l /etc/hostname*
334 cat /etc/hostname.pcn0
335 ifconfig pcn0 up && ifconfig -a
336 ifconfig e1000g0 up && ifconfig -a
337 dladm show-phys
338 kstat -n e1000g0 | egrep 'ifspeed | duplex'
339 ifconfig e1000g0 plumb
340 dladm show-phys
341 cat /etc/hostname.pcn0
342 cat /etc/defaultrouter
343 cat /etc/hosts
344 vi /etc/hosts
345 cat /etc/hosts
346 ping opensolaris
347 ifconfig -a
348 ifconfig e1000g0 down && ifconfig -a
349 dladm show-hys
350 dladm show-phys
351 ifconfig e1000g0 down
352 dladm show-phys
353 ifconfig pcn0 192.168.56.2 broadcast 192.168.56.1 netmask 255.255.255.0 p
lumb up
354 ifconfig pcn0 down
355 ifconfig e1000g0 192.168.56.2 broadcast 192.168.56.1 netmask 255.255.255.
0
356 ifconfig -a
357 arp -a
358 ls -ltr hostname*
359 cat hostname.pcn0
360 vi hostname.e1000g0
361 ls -ltr hostname*
362 cat /etc/inet/hosts
363 vi hosts
364 ifconfig -a
365 ifconfig e1000g0 10.0.0.10 broadcast 10.0.0.1 netmask 255.255.255.0
366 dladm show-phys
367 ifconfig
368 ifconfig -a
369 netstat -r
370 exit
371 history
372 dladm show-phys
373 ifconfig -a
374 history
375 ping 10.0.2.15
376 vi /etc/hosts
377 cat /etc/hosts
378 ping opensolaris
379 netstat -r
380 ping 10.0.2.2
381 netstat -rn
382 ping 10.0.0.1
383 history
You have new mail in /var/mail/root
root@opensolaris:~#