Unix - Solaris NotesUnix - Solaris Notes

Posted 03 26, 2012 10:25, Filed under: System/UNIX

Solaris Notes

Boot Up/Shutdown

init 0 - power down
init S - single user, all file systems mounted
init s - single user, all file systems mounted
init 1 - administrative state, all file systems mounted, logins allowed
init 2 - multi user, all daemons running except nfs - exports not allowed
init 3 - multi user
init 4 - alternative multi user - unused
init 5 - power down - shutdown and automatically power off if supported
init 6 - reboot

PROM Prompt (ok)
  • If you abort the boot process you will get the PROM prompt
    • Abort key sequence depends on keyboard type (could be:  Stop-A, L1-A or Break)
  • Type "n" at the ">" prompt to get to the "ok" prompt.
  • boot -->  boots to multi user mode
  • boot cdrom  --> boots from cdrom
  • boot -r  --> reconfiguration boot
  • boot -a  --> interactive boot
    • specify kernel or accept default
    • specify modules or accept default
    • specify system file or accept default
    • specify root filesystem or accept default
    • specify physical name of the root device or accept default
  • boot -s --> single user mode

Bootup Files
  • /etc/inittab
  • /sbin/rc*
    • /etc/rc0 - rc5 and rcS
    • These main scripts call the appropriate S and K scripts located in /etc/rc*.d
  • /etc/init.d  -->  linked to /etc/rc.etc
  • /etc/rc*.d
    • Individual start and kill scripts

Bootup Commands
  • telinit 1  --> changes to single user mode
  • telinit 2  -->  changes to muli-user with no NFS
  • telinit 3  -->  changes to multiuser
  • <ctrl> <d>  --> changes from single user mode to multi user mode
  • Forcing a Crash Dump, then rebooting:
    • savecore must be enabled
    • type the stop key sequence
    • at the "ok" prompt type sync  -->  this synchronizes the disk and writes the crash dump, system will reboot when dump is complete
  • Booting with the Kernel debugger
    • type the stop key sequence
    • at the "ok" prompt type sync
    • when the message "syncing file systems . . . " appears, press the stop key sequence
    • at the "ok" prompt type boot kadb


Shutdown Commands
  • shutdown  --> you will be prompted to confirm the shutdown, system will shutdown to single user state
  • shutdown -y  --> you will not be prompted to confirm, system will shutdown to single user state
  • shutdown -g XXX  --> system will wait XXX seconds to start shutdown
  • shutdown -i6  --> shutdown and reboot
  • uadmin 2 0  -->  shutsdown the system to a powerdown state, PROM prompt is displayed
  • shutdown -s
  • init -s
  • telinit 0 or init 0 --> shutsdown the system from single user mode
  • telinit 6 or init 6  -->  shutsdown and reboots a single user system
  • halt  --> shutsdown immediately, not necessarily cleanly (no warning, no scripts run)
  • reboot  -->  shutsdown and reboots, but not necessarily cleanly (no warning, no scripts run)

SPARC Boot Process
  • Boot PROM  -->  self test
  • bootblk executes -->  primary boot program which loads ufsboot program from UFS filesystem
  • ufsboot executes -->  loads the kernel
  • kernel initialization
  • /sbin/init processes /etc/inittab entries
  • /sbin/rc* scripts are run
IA Boot Process
  • BIOS PROM  --> self test, low level drivers
  • BIOS looks for mboot MBR
  • pboot is loaded from active paration
  • bootblk is loaded by pboot
  • If multiple bootable partions exist bootblk displays Primary Boot Subsystem Menu
  • boobblk starts either boot.bin or ufsboot  -->  this can be interrupted to run the Configuration Assistant
  • command interpreter starts which processes /etc//bootrc script  -->  this provides a menu of boot choices
  • kernel initiailization using either boot.bin or ufsboot to read the files
  • /sbin/init processes the inittab
  • /sbin/rc* scripts are run

IA Boot Menus
  • Primary Boot Subsystem Menu --> If boot disk has multiple partitions
  • Secondary Boot Subsystem  Menu  -->  If boot process is interupted then the Solaris Device Configuration Assistant is run
  • Solaris Device Configuration Asistant Boot Diskette
  • Current Boot Parameters Menu

Console

Using tip (the serial port is connected to another Sun server)
  • tip hardwire
  • ~.  --> end's session and goes back to prompt
  • ~#  --> Stop A
  • /etc/remote is configuration file

Crontab

See unix.html for crontab basics.

Note:  Solaris defaults to ed when using crontab -e, unless the $EDITOR variable is set to something else, like vi.

ksh  -->  export EDITOR=vi

sh  -->   EDITOR=vi
              export EDITOR

See UNIX notes for safely editing crontabs.

Devices

devfsadm  -->  manages special files in /dev and /devices  (boot -r no longer required)

Process to add new hardware:
  • load the device driver
  • shutdown system
  • add new hardware
  • at the PROM ok prompt type "boot -r"
devinfo  -->  prints information about disk devices.

Mounting a cdrom:
  • check to see if volume mangement is running -
    • ps -ef|grep vold
  • If volume management is running then cd will auto mount
  • If volume management is not running then manually mount it
    • ls /dev/dsk/c0*
    • usually t=6 is the cdrom, start with slice =0
    • mount -o ro /dev/dsk/c0t6d0s0 /cdrom
    • share -F nfs -o ro /cdrom
Manually unmounting a cdrom:
  • check to see if volume mangement is running -
    • ps -ef|grep vold
  • If volume management is running then stop it
    • /etc/init.d/volmgt stop
  • umount -f /dev/dsk/c0t6d0s0

Log Files

Directory for log files:  /var/adm, /var/log
messages  --> system messages
syslog  --> default is mail log

/usr/sbin/dmesg  --> obsolete command, can still display boot messages

/etc/cron.d/logchecker --> rotates /var/cron/log to /var/cron/olog when $LIMIT is reached

/etc/default/cron  --> configuration file for cron
  • CRONLOG=NO
    • Turns off cron logging for the server

Process to enable /var/adm/loginlog to monitor failed login attempts after minimum allowed (default = 5)
  • touch /var/adm/loginlog
  • chown root:sys /var/adm/loginlog
  • chmod 600 /var/adm/loginlog
Process to enable /var/log/authlog to monitor authentication related events
  • touch /var/log/authlog
  • chown root:sys /var/log/authlog
  • chmod 600 /var/log/authlog
  • edit /etc/syslog.conf and remove comments from authlog entries
  • Restart the syslog daemon
    • /etc/init.d/syslog stop
    • /etc/init.d/syslog start

Network Info

/etc/defaultrouter   --> contains ip address of default router
/etc/inet/netmasks  -->  contains subnet masks for each subnet connected
/etc/nodename  --> contains hostname of server
/etc/hostname.<interface>  -->  contains hostname of server for that interface

Configuring an interface from the command line:
  • Check the existing configuration
    • ifconfig -a
  • If the interface is not in the existing configuration, set it up
    • ifconfig <interface> plumb  -->  Sets up the interface for use, if the ifconfig -a does not show the interface already.
  • Bring the interface up with an ip address and subnet mask
    •  ifconfig ge0  10.212.1.241 netmask 255.255.255.0 up
Configuring a second IP address for an existing interface
  • Identify the proper interface (ifconfig -a)
  • Verify the existence of a hostname file (ls /etc/hostname*)
  • Edit /etc/hosts
    • w.x.y.z      server.domain.com   alias
  • Create a new instance of the hostname file with the host name in it
    • vi hostname.interface:1
      • server.domain.com
  • plumb the interface  (ifconfig interface:1 plumb)
  • give the interface an ip address (ifconfig interface:1 10.0.18.59)
  • bring the interface up (ifconfig interface:1 up)
  • Test it


OSI Stack

Check to see if it is running:
ps -ef|grep osi

server:/> ps -ef|grep osi
    root 17495 17484  0 13:30:42 pts/3    0:00 grep osi
    root  5443  5442  0   Sep 03 ?        0:00 /usr/sbin/osilogd
    root  5442     1  0   Sep 03 ?        0:00 /usr/sbin/osinetd


Starting/Stopping
/etc/rc2.d/S90osinet stop
/etc/rc2.d/S90osinet start


Processes

ps -e
ps -el
kill
kill -9

/usr/proc/bin  --> process analysis utilities are located here
  • pcred - credentials
  • pfiles - open files
  • pflags - tracing flags
  • pldd - dynamic libraries
  • pmap - address map
  • prun - restart the process
  • psig - signal actions
  • pstack - hex stack trace
  • pstop - stop the process
  • pstime - time the process
  • ptree - process trees
  • pwait - wait for termination of process
  • pwdx - working directory
priocntl  --> priority control
nice  -->  sets the priority
renice --> changes the priority
pgrep --> shows active processes
pkill  --> kills active processes
pkill -HUP  --> kills and restarts the process
smpatch --> CLI for Solaris Patch Manager Tool

prstat  --> lists processes and % cpu time, continuously like "top"
prstat -n 5 1 1  --> shows top 5 processes using the cpu and only prints out 1 set of statistics, not continuous.

truss <command>  --> traces the execution of a command

Root Password - Lost

  • Get the machine to the boot prom (ok prompt)
    • init 0
    • halt
    • poweroff?
  • Boot from the cdrom into single user mode
    • boot cdrom -s
  • Mount the root disk
    • mount /dev/dsk/c0t0d0s0 /a
    • If unable to mount the disk
    • fsck /dev/dsk/c0t0d0s0
  • Change to the proper directory
    • cd /a/etc
  • Edit the shadow file
    • TERM=vt100;export TERM
    • vi shadow
  • Replace the root password encryped string with nothing:
    • root:3oWleAoGjh5ls:6445::::::
    • root::6445::::::

Software/Patches

Software Packages
  • Listing installed packages
    • pkginfo
  • Installing packages
    • pkgadd -d <package name>

Solaris Flash Technology
  • Image based snapshots of OS and Patched OS
  • Similar systems are cloned


patchadd -p  --> lists patches on the system
showrev -p --> lists patches on the system

install_mu - script to install maintenance update using patchadd

Get patches from:  http://www.sun.com/sunsolve/patches

Swap Space

/usr/sbin/swap -l   --> lists swap space

swap -s  -->  shows swap space usage

How to add more swap space
  • Create the swap space
    • mkfile <size>[k|b|m] <filename>
  • Activate the swap space
    • swap -a <path><filename>
  • Add entry to /etc/vfstab
    • <path><swapfile> -   -   swap    -       no      -  
    • (mount dev,  fsck dev, mount point, fstype, fsck pass, mount at boot,  mount options)


System Information

cat /etc/release  <-- shows version of Solaris and the type of hardware such as SPARC

eeprom  -->  displays and allows the administrator to alter the contents of the eeprom configuration variables

uname -X  -->  display os version, kernel id, number of processors and type of machine

prtconf   --> prints system configuration

prtconf -vp| grep banner-name:  --> prints model of server

prtconf -vp| grep Memory  --> prints amount of memory

dmesg -->  collects system error messages

psrinfo  --> prints information about processors
psrinfo -v | grep MHz   -->  prints speed of each processor

sysdef -->  prints current system definition in table form
sysdef -i

modinfo  --> displays information about loaded kernel modules

/usr/platform/`uname -i`/sbin/prtdiag  -->  displays system diagnostic information

isainfo -v   --> displays whether the kernel supports 32 bit or 64/32 bit architecture (64 bit kernel is available on Solaris 7 and up)

Local Hard Disk Info
format:
       0. c0t10d0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133>
          /sbus@3,0/SUNW,fas@3,8800000/sd@a,0
       1. c0t11d0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133>
          /sbus@3,0/SUNW,fas@3,8800000/sd@b,0
       2. c3t5d1 <Symbios-StorEdgeA3500FCd-0301 cyl 8615 alt 2 hd 64 sec 64>    <-- NOT Local, but on an external A3500FC array
          /pseudo/rdnexus@3/rdriver@5,1
       3. c3t5d3 <Symbios-StorEdgeA3500FCd-0301 cyl 8615 alt 2 hd 64 sec 64>
          /pseudo/rdnexus@3/rdriver@5,3

 cfgadm -alv


SunOS to Solaris Mapping:
SunOS
Solaris

1.0
5.0
2.0
5.1
2.1
5.2
2.2
5.3
2.3
5.4
2.4
5.5
2.5
5.5.1
2.5.1
5.6
2.6
5.7
7
5.8
8

9


Tuning/Kernel Parameters


/etc/system

Resources

http://www.wright.edu/~mike.corcoran/htmldocs/systems/solaris/-CIPCZQX01aa9e9de1=02002b0214a8858100000000

[출처] Solaris Notes|작성자 pewar




※ 위 내용은, 여러 자료를 참고하거나 제가 주관적으로 정리한 것입니다.
   잘못된 정보나 보완이 필요한 부분을, 댓글 또는 메일로 보내주시면 많은 도움이 되겠습니다.
03 26, 2012 10:25 03 26, 2012 10:25


Trackback URL : http://develop.sunshiny.co.kr/trackback/714

Leave a comment
[로그인][오픈아이디란?]
오픈아이디로만 댓글을 남길 수 있습니다

« Previous : 1 : ... 257 : 258 : 259 : 260 : 261 : 262 : 263 : 264 : 265 : ... 648 : Next »

Recent Posts

  1. HDFS - Python Encoding 오류 처리
  2. HP - Vertica ROS Container 관련 오류...
  3. HDFS - Hive 실행시 System Time 오류
  4. HP - Vertica 사용자 쿼리 이력 테이블...
  5. Client에서 HDFS 환경의 데이터 처리시...

Recent Comments

  1. 안녕하세요^^ 배그핵
  2. 안녕하세요^^ 도움이 되셨다니, 저... sunshiny
  3. 정말 큰 도움이 되었습니다.. 감사합... 사랑은
  4. 네, 안녕하세요. 댓글 남겨 주셔서... sunshiny
  5. 감사합니다 많은 도움 되었습니다!ㅎㅎ 프리시퀸스

Recent Trackbacks

  1. clock synchronization software clock synchronization software 2 06
  2. print and mailing services print and mailing services 2 06
  3. print and mail service print and mail service 1 06
  4. clocks large facilities clocks large facilities 1 06
  5. print and mail service print and mail service 31 05

Calendar

«   06 2020   »
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        

Bookmarks

  1. 위키피디아
  2. MysqlKorea
  3. 오라클 클럽
  4. API - Java
  5. Apache Hadoop API
  6. Apache Software Foundation
  7. HDFS 생태계 솔루션
  8. DNSBL - Spam Database Lookup
  9. Ready System
  10. Solaris Freeware
  11. Linux-Site
  12. 윈디하나의 솔라나라

Site Stats

TOTAL 2968388 HIT
TODAY 93 HIT
YESTERDAY 1325 HIT