Solaris Infrequently Asked and Obscure Questions
Composed by Argoth (2010.02.11)


[ Standard | BigFont ] | ( about the author | change log | contributors | IAOQ | mirrors )


INFREQUENTLY ASKED AND OBSCURE QUESTIONS

Table of Contents ( System | Network )
  1. System ( General | Shell | Kernel | Devices | Filesystem | X11 | Crash Dump | VxVM | VxFS )

    1. General
      1. How do I untar a file with absolute paths to a relative location?
      2. How do I do a recursive grep?
      3. How do I find out the number of files used on local filesystems?
      4. How do I use a FIFO?
      5. How do I list available signals?
      6. How do I show how a process will respond to a given signal?
      7. How do I remove a file that begins with a - ?
      8. ls(1) no longer works, how can I view directory contents?
      9. How can I tell what the various ERROR codes mean?
      10. How can I create a file of arbitrary size?
      11. How can I get seconds from epoch?
      12. How do I get yesterdays date?
      13. How do I get access, modify, creation time of a file?
      14. What is load average?
      15. What is the run queue?
      16. How can I copy directory contents to a remote machine?
      17. How do I archive directories with 155+ character directory names or 100+ character file names?
      18. How do I convert hexadecimal to decimal and vice versa?
      19. How do I convert binary to decimal and vice versa?
      20. What can I do about zombie processes?
      21. How do I list just directories, but not their contents?
      22. How do I grep for multiple patterns?
      23. How do I configure the system wide dynamic linker?

    2. Shell
      1. My setuid shell script keeps running as the real user, why?
      2. Why is cd() a shell built-in rather than an executable?
      3. How do I redirect stderr into stdout?
      4. How do I rename files by extension like MS-DOS?
      5. AWK Tricks
        1. Round up number to next whole number
      6. SED Tricks

    3. Kernel
      1. Where do I put kernel configuration?
      2. How do I add more PTYs?
      3. What is shared memory?
      4. How do I know the limits for shared memory kernel tunables?
      5. What is a semaphore?
      6. How do I know the limits for semaphore kernel tunables?
      7. What is a door?
      8. add_drv(1m) fails with "add_drv/rem_drv currently busy; try later".
      9. How do I increase the number of file descriptors available to an application?
      10. What is a register window?
      11. What is the default memory page size?
      12. What is the current memory page size?
      13. What kind of binaries can my kernel run?
      14. What kind of drivers and modules can my kernel run?
      15. How do I adjust interprocess communications (IPC) variables?
      16. How do I modify strings in the running kernel?

    4. Devices
      1. How do I make the system aware of new devices?
      2. How do I know what the video configuration for my adapter/display is?
      3. How do I know what the adapter/display is capable of?
      4. How do I change color depth?
      5. How can I prevent my system from halting when my terminal server is rebooted?
      6. What does hme stand for in /dev/hme?
      7. Where are device drivers located?
      8. How do I configure a device driver?
      9. How do I configure the scsi-options for my scsi controller?
      10. How do I change the default terminal setting on the system console?
      11. What instruction set does my CPU support?

    5. Filesystem
      1. How do I get a list of superblocks on a filesystem?
      2. How do I grow/shrink a ufs filesystem?
      3. How do I determine what type of filesystem a given device has?
      4. What are inodes 0, 1, and 2 used for?
      5. What do I do if I have a corrupt boot block?
      6. What is the DNLC?
      7. How does the DNLC relate to the kernel vfs layer?
      8. How do I get statistics about DNLC performance?
      9. How do I prevent the ufs filesystem from buffering my database files?
      10. How do I disable "access time" updates for file?
      11. What is the difference between file mode 1 and 5?
      12. How can i force an unmount of a filesystem?
      13. What is the default ufs block size?
      14. What is the default zfs block size?
      15. Why is /lib/libc.so.1 showing up as a mounted filesystem?
      16. How do I mount an ISO image file?

    6. X11
      1. How do I use an alternate window manager?
      2. How do I disable X Windows from starting at boot?
      3. How do I disable that annoying beep?
      4. How do I disable the CDE front panel?
      5. How do I determine which X11 version and extensions are supported?

    7. Crash Dump
      1. When did it happen?
      2. How do I get information about what was going on?

    8. Veritas Volume Manager
      1. How do I allow a user/group to write to a managed raw volume?
      2. How do I move rootdg from one system to another?
      3. What is the difference between Disk Suite nd Veritas Volume Manager?
      4. What is the difference between RAID 0+1 and 1+0?

    9. Veritas Filesystem
      1. How do I make vxfs support large files?
      2. How do I defragment a vxfs filesystem?
      3. How do I grow/shrink a vxfs filesystem?
      4. How do I prevent the vxfs filesystem from buffering my database files?
      5. How do I create a Quick I/O file?
      6. What is the default vxfs block size?

  2. Network ( Physical Layer | Transport Layer )

    1. Physical Layer
      1. How do I find the speed my network card is at?
      2. How do I configure what my network card is capable of?
      3. How do I display what my link partner is capable of?
      4. How can I tell if my card is active on the network?
      5. How do I use multiple ethernet interfaces on the same network segment?
      6. How do I determine if local mac addresses are in use on my host?

    2. Transport Layer
      1. How do I configure stronger sequence number generation?
      2. I have a large amount of connections in state CLOSE_WAIT, what can be done to reduce this number in the future?
      3. How can I increase my TCP Window size?
      4. What do all the TCP states actually mean?


Questions and Answers
  1. ^^ System

    1. ^^ General

      1. ^^ How do I untar a file with absolute paths to a relative location?
        1. Method 1 (user)
          1. /usr/bin/pax -r -s ',^/,,' -f file.tar
        2. Method 2 (root)
          1. /usr/bin/cp /usr/sbin/static/tar /tmp
          2. /usr/bin/dd if=file.tar | /usr/bin/chroot /tmp ./tar xf -

      2. ^^ How do I do a recursive grep?
        1. Method 1 (recommended)
          1. /usr/bin/find . | /usr/bin/xargs /usr/bin/grep PATTERN
          2. displays filename:match
        2. Method 2 (recommended)
          1. /usr/bin/find . -exec /usr/bin/grep PATTERN {} /dev/null \;
          2. displays filename:match

      3. ^^ How do I find out the number of files used on local filesystems?
        1. System V
          1. /usr/bin/df -F ufs -o i
        2. Berkeley
          1. /usr/ucb/df -i

      4. ^^ How do I use a FIFO?
        1. /usr/bin/mkfifo fifo
        2. /usr/bin/compress < fifo > file.Z &
        3. /usr/bin/cat file > fifo
          1. compresses file into file.Z

      5. ^^ How do I list available signals?
        1. /usr/bin/kill -l
        2. Read /usr/include/sys/signal.h
        3. Solaris 2.6 / 7
          1. /usr/bin/man -s 5 signal
        4. Solaris 8 / 9 / 10
          1. /usr/bin/man -s 3HEAD signal

      6. ^^ How do I show how a process will respond to a given signal?
        1. /usr/proc/bin/psig pid
          1. you must be root or own the process to read /proc/pid

      7. ^^ How do I remove a file that begins with a - ?
        1. This problem, contrary to popular belief, has nothing to do with the shell. It has to do with how rm(1) parses options.
        2. Method 1
          1. /usr/bin/rm ./-file
        3. Method 2
          1. /usr/bin/rm -- -file
          2. many programs use getopt(), thus they'll interpret - as an argument, to tell getopt() there are no more arguments to parse, use --

      8. ^^ ls(1) no longer works, how can i view directory contents?
        1. echo *
          1. This method uses the shell built-in echo() in conjunction with the * matching properties to generate listing of current directory.

      9. ^^ How can I tell what the various ERROR codes mean?
        1. Read /usr/include/sys/errno.h
        2. /usr/bin/man -s 2 Intro

      10. ^^ How can I create a file of arbitrary size?
        1. Method 1
          1. /usr/sbin/mkfile 10m file
            1. Creates a 10 Megabyte file
            2. For each write() operation, there is no accompanying read() operation, making this method very efficient
        2. Method 2 (recommended)
          1. /usr/bin/dd < /dev/zero > file bs=1024 seek=10240 count=1
            1. Creates a 10 Megabyte file
            2. This method does not require many reads and writes since the file is sparse.

      11. ^^ How can I get seconds from epoch?
        1. Solaris 2.6 / 7
          1. /usr/bin/truss /usr/bin/date 2>&1 | /usr/bin/awk '/^time/ {print $NF}'
        2. Solaris 8 / 9 / 10
          1. /usr/bin/perl -e 'printf "%d\n", time;'

      12. ^^ How do I get yesterdays date?
        1. Solaris 2.6 / 7
          1. TZ=timezone+shift date
            1. replace timezone with EST,CST,PST,etc
            2. replace shift with 24-(shift from GMT)
            3. Example
              1. EST=-5
              2. 24-(-5)=29
              3. TZ=EST+29 date
          2. echo `echo '*time-0t86400=Y' | /usr/bin/adb -k | tail -2`
        2. Solaris 8 / 9 / 10
          1. /usr/bin/perl -e 'printf "%s\n",scalar localtime(time-86400)'
          2. This breaks twice a year during the DST transition.
          3. From perlfaq4;
              Note very carefully that the code above assumes that your days
              are twenty-four hours each.  For most people, there are two
              days a year when they aren't: the switch to and from summer
              time throws this off.  A solution to this issue is offered by
              Russ Allbery.
                  sub yesterday {
                      my $now  = defined $_[0] ? $_[0] : time;
                      my $then = $now - 60 * 60 * 24;
                      my $ndst = (localtime $now)[8] > 0;
                      my $tdst = (localtime $then)[8] > 0;
                      $then - ($tdst - $ndst) * 60 * 60;
                  }
              # Should give you "this time yesterday" in seconds since epoch relative to
              # the first argument or the current time if no argument is given and
              # suitable for passing to localtime or whatever else you need to do with
              # it.  $ndst is whether we're currently in daylight savings time; $tdst is
              # whether the point 24 hours ago was in daylight savings time.  If $tdst
              # and $ndst are the same, a boundary wasn't crossed, and the correction
              # will subtract 0.  If $tdst is 1 and $ndst is 0, subtract an hour more
              # from yesterday's time since we gained an extra hour while going off
              # daylight savings time.  If $tdst is 0 and $ndst is 1, subtract a
              # negative hour (add an hour) to yesterday's time since we lost an hour.
              #
              # All of this is because during those days when one switches off or onto
              # DST, a "day" isn't 24 hours long; it's either 23 or 25.
              #
              # The explicit settings of $ndst and $tdst are necessary because localtime
              # only says it returns the system tm struct, and the system tm struct at
              # least on Solaris doesn't guarantee any particular positive value (like,
              # say, 1) for isdst, just a positive value.  And that value can
              # potentially be negative, if DST information isn't available (this sub
              # just treats those cases like no DST).
              #
              # Note that between 2am and 3am on the day after the time zone switches
              # off daylight savings time, the exact hour of "yesterday" corresponding
              # to the current hour is not clearly defined.  Note also that if used
              # between 2am and 3am the day after the change to daylight savings time,
              # the result will be between 3am and 4am of the previous day; it's
              # arguable whether this is correct.
              #
              # This sub does not attempt to deal with leap seconds (most things don't).
              #
              # Copyright relinquished 1999 by Russ Allbery 
              # This code is in the public domain
                  
      13. ^^ How do I get access, modify, creation time of a file?
        1. Access time (atime)
          1. /usr/bin/ls -ul filename
        2. Modify time (mtime)
          1. /usr/bin/ls -l filename
        3. Creation time
          1. There is no way to determine creation time in the ufs filesystem
        4. Change time (ctime)
          1. /usr/bin/ls -cl filename
          2. this includes status changes (like permissions)
        5. All in one (root)
          1. ufs
            1. /usr/bin/ls -i filename | /usr/bin/awk \ '{print "0t"$1":ino?i"}' | /usr/sbin/fsdb -F ufs /dev/rdsk/c0t0d0s0
              1. assumes raw device of filesystem for filename is c0t0d0s0
          2. zfs
            1. /usr/sbin/zdb -vvv path/to/pool `/usr/bin/ls -i filename`

      14. ^^ What is load average?
        1. Load average is the average number of processes currently running and waiting to run.
        2. Method 1
          1. /usr/bin/w -u
          2. displays load average over last 1, 5 and 15 minutes
        3. Method 2
          1. /usr/bin/uptime
          2. displays load average over last 1, 5 and 15 minutes
        4. Method 3
          1. Using microstate accounting
          2. Get values from kstat
            1. /usr/bin/kstat -p 'unix:0:system_misc:avenrun*'
          3. Divide by FSCALE
            1. FSCALE is found in /var/include/sys/param.h
            2. Default is 8 bits (256)
          4. Putting it together
            1. /usr/bin/kstat -p 'unix:0:system_misc:avenrun*' | sort -n -t '_' +2 | awk '{printf "%.8f ", $2 / 256 } END {printf "\b\n"}'

      15. ^^ What is the run queue?
        1. The run queue consists of processes ready to run, i.e not otherwise blocked or waiting for i/o, that are contending for cpu resources to become available.
        2. /usr/bin/vmstat 1 2
          1. Current run queue is indicated by the "r" heading
          2. First line of output is average since system boot

      16. ^^ How can I copy directory contents to a remote machine (without nfs)?
        1. Method 1
          1. /usr/bin/tar -cf - sourcepath | /usr/bin/rsh remote " cd /targetpath ; /usr/bin/tar -xBf - "
        2. Method 2
          1. /usr/bin/find sourcepath | /usr/bin/cpio -o | /usr/bin/rsh remote "cd /targetpath ; /usr/bin/cpio -id"

      17. ^^ How do I archive directories with 155+ character directory names or 100+ character file names?
        1. Solaris 2.6
          1. Sun's version of tar does not support this, use cpio
          2. /usr/bin/find . | /usr/bin/cpio -o > file.cpio
            1. -H tar produces warning on files with the aforementioned attributes
        2. Solaris 7 / 8 / 9 / 10
          1. Use the -E switch to enable extended headers

      18. ^^ How do I convert hexadecimal to decimal and vice versa?
        1. Method 1 - adb (Solaris 2.6 / 7)
          1. echo "0xff=d" | /usr/bin/adb
            1. converts ff into 255
          2. echo "0t255=x" | /usr/bin/adb
            1. converts 255 to ff
        2. Method 2 - mdb (Solaris 8 / 9 / 10)
          1. echo "0xff=d" | /usr/bin/mdb
            1. converts ff into 255
          2. echo "0t255=x" | /usr/bin/mdb
            1. converts 255 to ff
        3. Method 3 - bc
          1. echo "ibase=16; ff" | /usr/bin/bc
            1. converts ff into 255
          2. echo "obase=16; 255" | /usr/bin/bc
            1. converts 255 to FF
        4. Method 4 - dc
          1. echo "10 16 o i FF p" | dc
            1. converts FF to 255
          2. echo "16 10 o i 255 p" | dc
            1. converts 255 to FF
        5. Method 5 - printf
          1. /usr/bin/printf '%d\n' 0xff
            1. converts ff to 255
          2. /usr/bin/printf '%x\n' 255
            1. converts 255 to ff

      19. ^^ How do I convert binary to decimal and vice versa?
        1. Method 1 - bc
          1. echo "ibase=2; 11111111" | /usr/bin/bc
            1. converts 11111111 into 255
          2. echo "obase=2; 255" | /usr/bin/bc
            1. converts 255 to 11111111
        2. Method 2 - dc
          1. echo "2 10 o i 11111111 p" | dc
            1. converts 11111111 to 255
          2. echo "10 2 o i 255 p" | dc
            1. converts 255 to 11111111

      20. ^^ What can I do about zombie processes?
        1. Solaris 9 / 10
          1. /usr/bin/preap

      21. ^^ How do I list just directories, but not their contents?
        1. Method 1
          1. /usr/bin/ls -d */
          2. commonly aliased to 'lsd'
        2. Method 2 (requires read access to listed directories)
          1. /usr/bin/find /path/to/dir/* -type d -prune
          2. displays full path results

      22. ^^ How do I grep for multiple patterns?
        1. pattern1 OR pattern2
          1. /usr/bin/egrep -e '(pattern1|pattern2)'
        2. pattern1 AND pattern2
          1. Method 1 (Recommended)
            1. /usr/bin/egrep -e '(pattern1.*pattern2|pattern2.*pattern1)'
          2. Method 2 (Quick and Dirty)
            1. /usr/bin/grep pattern1 | grep pattern 2

      23. ^^ How do I configure the system wide dynamic linker?
        1. Warning: This changes the library search path, so make sure to include the default paths when making changes.
        2. Default Library Path (ELF): /lib:/usr/lib
        3. 32-bit
          1. Default configuration file: /var/ld/ld.config
          2. /usr/bin/crle -l /new/path/lib:/lib:/usr/lib
        4. 64-bit
          1. Default configuration file: /var/ld/64/ld.config
          2. /usr/bin/crle -64 -l /new/path/lib:/lib:/usr/lib
        5. Possible issues
          1. crle: /var/ld/ld.config: corrupt file, possible truncation
            1. This is usually caused by the configuration file being manually edited.
            2. The configuration file can be safely deleted and recreated (if necessary) with the above commands at anytime.


    2. ^^ Shell

      1. ^^ My setuid shell script keeps running as the real user, why?
        1. Bourne Shell
          1. The use of setuid shell scripts is discouraged
            1. If you must, protect yourself with trap()
          2. Bourne shell always sets the effective user and group IDs to the real user and group IDs.
          3. /bin/sh -p
        2. C Shell
          1. The use of setuid shell scripts is discouraged
          2. C shell does not run setuid/setgid shell scripts by default
            1. "/dev/fd/3: Bad file number" is a common error
          3. /bin/csh -b

      2. ^^ Why is cd() a shell built-in rather than an executable?
        1. Quick Answer
          1. a child process cannot modify the environment of the parent
        2. Long Answer
          1. a shell fork()s and then exec()s the requested executable. in doing so, the newly created process begins life with the environment of the parent process. the new child process then manipulates the environment in the manner requested, in this case a modification of the directory stack, and returns to the parent. however, since this change occurred in the child address space, the parent's environment was never changed, and therefore the requested operation did not take place.

      3. ^^ How do I redirect stderr?
        1. Bourne Shell
          1. to stdout
            1. command 2>&1
          2. to file
            1. command 2> file
          3. to null
            1. command 2> /dev/null
        2. C Shell
          1. to stdout
            1. command >& /dev/tty
          2. to file (without affecting stdout)
            1. ( command > /dev/tty ) >& file
          3. to null (without affecting stdout)
            1. a. ( command > /dev/tty ) >& /dev/null

      4. ^^ How do I rename files by extension like MS-DOS?
        1. DOS Example: move *.doc *.txt
        2. Korn Shell
          1. for x in *.doc; do mv $x ${x%.doc}.txt; done

      5. ^^ AWK Tricks

        1. ^^ Round up number to next whole number
          1. Example (4.1 to 5, -4.1 to -4)
          2. awk '{printf "%d\n", ($0 % 1) ? (int($0)+(($1>0)?1:0)) : $0}'

      6. ^^ SED Tricks

    3. ^^ Kernel

      1. ^^ Where do I put kernel configuration?
        1. /etc/system

      2. ^^ 2. How do I add more PTYs?
        1. Solaris 2.6 / 7
          1. Do not attempt to do this with '/usr/bin/adb -k'.
          2. Modify /etc/system
            1. set pt_cnt=X
          3. /usr/sbin/reboot -- -r
        2. Solaris 8 / 9 / 10
          1. Dynamically allocated.
          2. Do not attempt to do this with '/usr/bin/mdb -k'.
          3. Limit is forced by modifying /etc/system
            1. set pt_cnt=X
          4. /usr/sbin/reboot -- -r

      3. ^^ What is shared memory?
        1. Just as it sounds. Shared memory is an Interprocess Communication (IPC) mechanism used by multiple processes to access common memory segments.

      4. ^^ How do I know the limits for shared memory kernel tunables?
        1. Read /usr/include/sys/shm.h

      5. ^^ What is a semaphore?
        1. A non-negative integer that is incremented or decremented relative to available resources.

      6. ^^ How do I know the limits for semaphore kernel tunables?
        1. Read /usr/include/sys/sem.h

      7. ^^ What is a door?
        1. A door is a file descriptor that describes a method for interprocess communication between client and server threads.
        2. A door file appears with file mode D---------.

      8. ^^ add_drv(1m) fails with "add_drv/rem_drv currently busy; try later".
        1. /usr/bin/rm /tmp/AdDrEm.lck

      9. ^^ How do I increase the number of file descriptors available to an application?
        1. File descriptors are used for more than just open files, they also provide the framework for socket i/o.
        2. The kernel dynamically allocates resources for open files. There is no maximum number of file descriptors per system.
        3. Depending on the programming interface used, an application may not be able to reach the file descriptor limit.
        4. API limits (ref:Solaris Internals)
          1. Solaris 2.6
            1. stdio(3S) - 256
              1. From stdio(3S); no more than 255 files may be opened using fopen(), and only file descriptors 0 through 255 can be used in a stream.
            2. select(3c) - 1024
              1. From select(3c); The default value for FD_SETSIZE (currently 1024) is larger than the default limit on the number of open files. It is not possible to increase the size of the fd_set data type when used with select().
          2. Solaris 7 / 8 / 9 / 10
            1. stdio(3s) - 256 (32-bit) / 65536 (64-bit)
            2. select(3c) - 1024 (32-bit) / 65536 (64-bit)
              1. 65536 limit is attainable on 32-bit Solaris 7
              2. #define FD_SETSIZE 65536 ; prior to includes
        5. System defaults
          1. Solaris 2.6 / 7
            1. rlim_fd_max 1024
            2. rlim_fd_cur 64
          2. Solaris 8
            1. rlim_fd_max 1024
            2. rlim_fd_cur 256
          3. Solaris 9 / 10
            1. rlim_fd_max 65536
            2. rlim_fd_cur 256
        6. Modify /etc/system
          1. set rlim_fd_max=8192 ; hard limit (per process)
          2. set rlim_fd_cur=1024 ; soft limit (per process)

      10. ^^ What is a register window?
        1. A register window is used by the operating system to store the current local and in registers upon a system interupt, exception, or trap instruction.
        2. register windows are important to preserve the state of the stack between function calls.

      11. ^^ What is the default memory page size?
        1. x86
          1. 4096 bytes
        2. sun4u
          1. 8192 bytes
        3. sun4c/sun4m/sun4d
          1. 4096 bytes

      12. ^^ What is the current memory page size?
        1. /usr/bin/pagesize

      13. ^^ What kind of binaries can my kernel run?
        1. /usr/bin/isainfo -v

      14. ^^ What kind of kernel modules can my kernel run?
        1. /usr/bin/isainfo -kv

      15. ^^ How do I adjust interprocess communications (IPC) variables?
        1. Solaris 2.6 / 7 / 8 / 9
          1. Message Queue
            1. Modify /etc/system
              1. msgsys:msginfo_msgmap
                1. Number of entries in the message map
                2. Defaults
                  1. Solaris 2.6 / 7 / 8 / 9
                    1. 100
              2. msgsys:msginfo_msgmax
                1. Maximum message size
                2. Defaults
                  1. Solaris 2.6 / 7 / 8 / 9
                    1. 2048
              3. msgsys:msginfo_msgmnb
                1. Maximum bytes in queue
                2. Defaults
                  1. Solaris 2.6 / 7 / 8 / 9
                    1. 4096
              4. msgsys:msginfo_msgmni
                1. Number of message queue identifiers
                2. Defaults
                  1. Solaris 2.6 / 7 / 8 / 9
                    1. 50
              5. msgsys:msginfo_msgssz
                1. Message segment size
                2. Defaults
                  1. Solaris 2.6 / 7 / 8 / 9
                    1. 8
              6. msgsys:msginfo_msgtql
                1. Number of system message headers
                2. Defaults
                  1. Solaris 2.6 / 7 / 8 / 9
                    1. 40
              7. msgsys:msginfo_msgseg
                1. Number of message segments
                2. Defaults
                  1. Solaris 2.6 / 7 / 8 / 9
                    1. 1024
                    2. Must be less than 32768
          2. Semaphores
            1. Modify /etc/system
              1. semsys:seminfo_semmap
                1. Number of entries in the semaphore map
                2. Defaults
                  1. Solaris 2.6 / 7 / 8 / 9
                    1. 10
              2. semsys:seminfo_semmni
                1. Number of identifiers
                2. Defaults
                  1. Solaris 2.6 / 7 / 8 / 9
                    1. 10
              3. semsys:seminfo_semmns
                1. Number of semaphores in the system
                2. Defaults
                  1. Solaris 2.6 / 7 / 8 / 9
                    1. 60
              4. semsys:seminfo_semmnu
                1. Number of processes in the undo facility
                2. Defaults
                  1. Solaris 2.6 / 7 / 8 / 9
                    1. 30
              5. semsys:seminfo_semmsl
                1. Maximum semaphores per id
                2. Defaults
                  1. Solaris 2.6 / 7 / 8 / 9
                    1. 25
              6. semsys:seminfo_semopm
                1. Maximum operations per call
                2. Defaults
                  1. Solaris 2.6 / 7 / 8 / 9
                    1. 10
              7. semsys:seminfo_semume
                1. Number of undo structures per process
                2. Defaults
                  1. Solaris 2.6 / 7 / 8 / 9
                    1. 10
          3. Shared Memory
            1. Modify /etc/system
              1. shmsys:shminfo_shmmax
                1. Maximum size of a shared memory segment.
                2. Defaults
                  1. Solaris 2.6 / 7 / 8
                    1. 1,048,576
                  2. Solaris 9
                    1. 8,388,608
              2. shmsys:shminfo_shmmin
                1. Minimum size of a shared memory segment.
                2. Changing this value is not recommended as high values can cause application failure
                3. Defaults
                  1. Solaris 2.6 / 7 / 8 / 9
                    1. 1
              3. shmsys:shminfo_shmmni
                1. Maximum number of total shared memory segments that can be created
                2. Defaults
                  1. Solaris 2.6 / 7 / 8 / 9
                    1. 100
              4. shmsys:shminfo_shmseg
                1. Maximum number of shared memory segments per process
                2. Defaults
                  1. Solaris 2.6 / 7 / 8 / 9
                    1. 6
        2. Solaris 10
          1. New project facility. In addition to global settings, as in prior Solaris releases, it can also handle configuration per project, and per process. Controls are also now available while system is running.
          2. Dynamic
            1. Message Queue
              1. project.max-msg-ids
                1. Replaces msgsys:msginfo_msgmni
                2. Maximum number of message queue ids
                3. Defaults
                  1. Solaris 10
                    1. 128
                4. Maximums
                  1. Solaris 10
                    1. 16777216 (2^24)
                5. Example
                  1. prctl -n project.max-msg-ids -r -v 1024 -i project 3
              2. project.max-msg-qbytes
                1. Replaces msgsys:msginfo_msgmnb
                2. Maximum number of bytes of messages on a queue
                3. Defaults
                  1. Solaris 10
                    1. 65536
                4. Maximums
                  1. Solaris 10
                    1. 32-bit
                      1. 4294967295(ULONG_MAX, 32-bit)
                    2. 64-bit
                      1. 18446744073709551615 (ULONG_MAX, 64-bit)
                5. Example
                  1. prctl -n project.max-msg-qbytes -r -v 1024 -i project 3
              3. project.max-msg-messages
                1. Replaces msgsys:msginfo_msgtql
                2. Maximum number of messages in queue
                3. Defaults
                  1. Solaris 10
                    1. 8192
                4. Maximums
                  1. Solaris 10
                    1. 4294967295 (UINT_MAX)
                5. Example
                  1. prctl -n project.max-msg-messages -r -v 16384 -i project 3
            2. Semaphore
              1. project.max-sem-ids
                1. Replaces semsys:seminfo_semmni
                2. Maximum number of semaphore ids allowed
                3. Defaults
                  1. Solaris 10
                    1. 128
                4. Maximums
                  1. Solaris 10
                    1. 16777216 (2^24)
                5. Example
                  1. prctl -n project.max-sem-ids -r -v 256 -i project 3
              2. project.max-sem-nsems
                1. Replaces semsys:seminfo_semmsi
                2. Maximum number of semaphores per set
                3. Defaults
                  1. Solaris 10
                    1. 512
                4. Maximums
                  1. Solaris 10
                    1. 32767 (SHRT_MAX)
                5. Example
                  1. prctl -n project.max-sem-nsems -r -v 1024 -i project 3
              3. project.max-sem-ops
                1. Replaces semsys:seminfo_semopm
                2. Maximum number of semaphore operations allowed
                3. Defaults
                  1. Solaris 10
                    1. 512
                4. Maximums
                  1. Solaris 10
                    1. 2147483647 (INT_MAX)
                5. Example
                  1. prctl -n project.max-sem-ops -r -v 1024 -i project 3
            3. Shared Memory
              1. project.max-shm-ids
                1. Replaces shmsys:shminfo_shmmni
                2. Maximum number of shared memory ids allowed a project.
                3. Defaults
                  1. Solaris 10
                    1. 128
                4. Maximums
                  1. Solaris 10
                    1. 16777216 (2^24)
                5. Example
                  1. prctl -n project.max-shm-ids -r -v 256 -i project 3
              2. project.max-shm-memory
                1. Replaces shmsys:shminfo_shmmax
                2. Total amount of shared memory allowed a project (not merely per segment, as in previous versions)
                3. Defaults
                  1. Solaris 10
                    1. 1/4 Memory
                4. Maximums
                  1. Solaris 10
                    1. 18446744073709551616 (UINT64_MAX)
                5. Example
                  1. prctl -n project.max-shm-memory -r -v 4G -i project 3
          3. Persistent
            1. Configuration file is /etc/project
            2. Message Queue
            3. Semaphore
            4. Shared Memory
              1. max-shm-memory
              2. Example (4G):
                1. projmod -sK "project.max-shm-memory=(priv,4G,deny)" default

      16. ^^ How do I modify strings in the running kernel?
        1. Example: Changing sysname and release of current system (uname -sr)
        2. This requires changing values in utsname kernel structure
        3. Read /usr/include/sys/utsname.h
                  #define _SYS_NMLN       257     /* 4.0 size of utsname elements */
                  struct utsname {
          	    char	sysname[_SYS_NMLN];
          	    char	nodename[_SYS_NMLN];
          	    char	release[_SYS_NMLN];
          	    char	version[_SYS_NMLN];
          	    char	machine[_SYS_NMLN];
                  }; 
        4. Get information about current structure
          1. echo "utsname::print" | mdb -k
        5. Determine offset
          1. echo "0t257=x" | mdb
          2. 101
        6. Convert string
          1. echo "FunOS" | od -t x1
          2. 0000000 46 75 6e 4f 53 0a
        7. Commit change
          1. Warning: Modifying live kernel
          2. echo "utsname/v 46 75 6e 4f 53" | mdb -kw
        8. Convert string
          1. echo "5.12" | od -t x1
          2. 0000000 35 2e 31 32 0a
        9. Commit change
          1. Warning: Modifying live kernel
          2. echo "utsname+0x202/v 35 2e 31 32" | mdb -kw
        10. Verify Results
          1. Directly from kernel
            1. echo "utsname::print" | mdb -k
          2. From utility in example
            1. /usr/bin/uname -sr
            2. FunOS 5.12

    4. ^^ Devices

      1. ^^ How do I make the system aware of new devices?
        1. Disks
          1. While the system is up ( no fcal )
            1. Solaris 2.6 / 7
              1. Generate /devices structure
                1. /usr/sbin/drvconfig
              2. Generate /dev/dsk and /dev/rdsk links
                1. /usr/sbin/disks
            2. Solaris 8 / 9
              1. Generate /devices and /dev/dsk, /dev/rdsk links
                1. /usr/sbin/devfsadm
            3. Solaris 10
              1. Generate /devices
                1. /devices is now dynamic and managed by the devfs filesystem
                2. If necessary, new devices can be configured using /usr/sbin/cfgadm
              2. Generate /dev/dsk, /dev/rdsk links
                1. /usr/sbin/devfsadm
          2. While the system is up ( fcal )
            1. Get the enclosure name
              1. /usr/sbin/luxadm probe
            2. Add the disk
              1. /usr/sbin/luxadm insert_device enclosure,slot
          3. With a reboot
            1. Method 1
              1. /usr/sbin/shutdown -g0 -i0 "disk addition"
              2. Reconfigure Boot (From OpenBoot PROM monitor)
                1. boot -r
            2. Method 2
              1. /usr/bin/touch /reconfigure
              2. /usr/sbin/shutdown -g0 -i6 "disk addition"
        2. Ports
          1. While the system is up
            1. Solaris 2.6 / 7
              1. Generate /devices structure
                1. /usr/sbin/drvconfig
              2. Generate /dev links
                1. /usr/sbin/ports
            2. Solaris 8 / 9
              1. Generate /devices structure and /dev links
                1. /usr/sbin/devfsadm
            3. Solaris 10
              1. Generate /devices
                1. /devices is now dynamic and managed by the devfs filesystem
                2. If necessary, new devices can be configured using /usr/sbin/cfgadm
              2. Generate /dev links
                1. /usr/sbin/devfsadm
        3. Tapes
          1. While the system is up
            1. Solaris 2.6 / 7
              1. Generate /devices structure
                1. /usr/sbin/drvconfig
              2. Generate /dev and /dev links
                1. /usr/sbin/tapes
            2. Solaris 8 / 9
              1. Generate /devices structure and /dev links
                1. /usr/sbin/devfsadm
            3. Solaris 10
              1. Generate /devices
                1. /devices is now dynamic and managed by the devfs filesystem
                2. If necessary, new devices can be configured using /usr/sbin/cfgadm
              2. Generate /dev links
                1. /usr/sbin/devfsadm
        4. Misc. Devices
          1. While the system is up
            1. Solaris 2.6 / 7
              1. Generate /devices structure
                1. /usr/sbin/drvconfig
              2. Generate /dev links
                1. /usr/sbin/devlinks
            2. Solaris 8 / 9
              1. Generate /devices structure and /dev links
                1. /usr/sbin/devfsadm
            3. Solaris 10
              1. Generate /devices
                1. /devices is now dynamic and managed by the devfs filesystem
                2. If necessary, new devices can be configured using /usr/sbin/cfgadm
              2. Generate /dev links
                1. /usr/sbin/devfsadm

      2. ^^ How do I know what the video configuration for my adapter/display is?
        1. M64 Adapter
          1. /usr/sbin/m64config -propt
        2. Creator 3D Adapter
          1. /usr/sbin/ffbconfig -propt

      3. ^^ How do I know what the adapter/display is capable of?
        1. M64 Adapter
          1. Display what the card is capable of
            1. /usr/sbin/m64config -res \?
          2. Display what the card and display are capable of
            1. /usr/sbin/m64config -prconf
        2. Creator 3D Adapter
          1. Display what the card is capable of
            1. /usr/sbin/ffbconfig -res \?
          2. Display what the card and display are capable of
            1. /usr/sbin/ffbconfig -prconf

      4. ^^ How do I change color depth?
        1. M64 Adapter
          1. /usr/sbin/m64config -depth 24
            1. Attempts to set the default color depth to 24.
        2. Creator 3D Adapter
          1. /usr/sbin/ffbconfig -depth 24
            1. Attempts to set the default color depth to 24.

      5. ^^ How can I prevent my system from halting when my terminal server is rebooted?
        1. Patches
          1. Solaris 2.6
            1. Install patch 105924-10 or later
          2. Solaris 7
            1. Install patch 107589-02 or later
          3. Solaris 8 / 9 / 10
            1. Integrated
        2. Method 1 (persistent)
          1. Modify /etc/default/kbd
            1. KEYBOARD_ABORT=alternate
          2. /usr/sbin/init 6
          3. New break sequence is "~^b"
        3. Method 2 (not persistent, system up)
          1. Solaris 2.6 / 7
            1. /usr/bin/kbd -a disable
            2. This disables keyboard abort (L1-A / Stop-A) until you perform Method 1
          2. Solaris 8 / 9 / 10
            1. /usr/bin/kbd -a alternate
            2. This allows for the alternate sequence to be immediately available until you perform Method 1

      6. ^^ What does hme stand for in /dev/hme?
        1. Happy Meal Ethernet

      7. ^^ Where are device drivers located?
        1. /kernel/drv/<driver>

      8. ^^ How do I configure a device driver?
        1. w/<driver>.conf
          1. man <driver>
          2. vi /kernel/drv/<driver>.conf
        2. w/o <driver>.conf
          1. man <driver>
          2. man driver.conf

      9. ^^ How do I configure the scsi-options for my scsi controller?
        1. /usr/sbin/prtconf -v
          SUNW,fas, instance #0
              Driver properties:
                  name <target6-TQ> length <4>
                      value <0x00000000>.
                  name <target6-wide> length <4>
                      value <0x00000000>.
                  name <target6-sync-speed> length <4>
                      value <0x00002710>.
                  name <target0-TQ> length <4>
                      value <0x00000001>.
                  name <target0-wide> length <4>
                      value <0x00000000>.
                  name <target0-sync-speed> length <4>
                      value <0x00002710>.
                  name <pm_norm_pwr> length <4>
                      value <0x00000001>.
                  name <pm_timestamp> length <4>
                      value <0x3549c8e0>.
                  name <scsi-options> length <4>
                      value <0x000007f8>.
                                    ^^^
              
        2. Convert to current hexadecimal value to binary
          1. echo 'obase=2;ibase=16;7F8' | /usr/bin/bc
            11111111000
                 
        3. From /usr/include/sys/scsi/conf/autoconf.h;
          #define SCSI_OPTIONS_LINK       0x10    /* Global linked commands */
          #define SCSI_OPTIONS_TAG        0x80    /* Global tagged command support */
          #define SCSI_OPTIONS_DR         0x8     /* Global disconnect/reconnect  */
          #define SCSI_OPTIONS_SYNC       0x20    /* Global synchronous xfer capability */
          #define SCSI_OPTIONS_PARITY     0x40    /* Global parity support */
          #define SCSI_OPTIONS_FAST       0x100   /* Global FAST scsi support */
          #define SCSI_OPTIONS_WIDE       0x200   /* Global WIDE scsi support */
          #define SCSI_OPTIONS_FAST20     0x400   /* Global FAST20 scsi support */
              
        4. Order bits descending
          #define SCSI_OPTIONS_FAST20     0x400   /* Global FAST20 scsi support */
          #define SCSI_OPTIONS_WIDE       0x200   /* Global WIDE scsi support */
          #define SCSI_OPTIONS_FAST       0x100   /* Global FAST scsi support */
          #define SCSI_OPTIONS_TAG        0x80    /* Global tagged command support */
          #define SCSI_OPTIONS_PARITY     0x40    /* Global parity support */
          #define SCSI_OPTIONS_SYNC       0x20    /* Global synchronous xfer capability */
          #define SCSI_OPTIONS_LINK       0x10    /* Global linked commands */
          #define SCSI_OPTIONS_DR         0x8     /* Global disconnect/reconnect  */
              
        5. Check if turned on or off
          Global FAST20 scsi support                 1
          Global WIDE scsi support                   1
          Global FAST scsi support                   1
          Global tagged command support              1
          Global parity support                      1
          Global synchronous xfer capability         1
          Global linked commands                     1
          Global disconnect/reconnect                1
                                                     0
                                                     0
                                                     0
              
        6. Example: Disabling Tagged Queuing on FAS SCSI controller Target 0
          1. Determine bit order to turn off tag queuing
            Global FAST20 scsi support                 1
            Global WIDE scsi support                   1
            Global FAST scsi support                   1
            Global tagged command support              0
            Global parity support                      1
            Global synchronous xfer capability         1
            Global linked commands                     1
            Global disconnect/reconnect                1
                                                       0
                                                       0
                                                       0
                 
          2. Convert current binary value to hexadecimal
            1. echo "obase=16;ibase=2;1101111000" | /usr/bin/bc
              378
                    
          3. Add to /kernel/drv/fas.conf
            target0-scsi-options=0x378;
            scsi-options=0x7f8;
                 
      10. ^^ How do I change the default terminal setting on the system console?
        1. Solaris 2.6 / 7 / 8 / 9 / 10
          1. Edit the "co:" line in /etc/inittab
          2. Change "-T sun" to "-T vt100" or whatever your preferred terminal is
          3. Example:
            1. echo "g/^co:/s/sun/vt100/1\nw" | ed -s /etc/inittab
        2. Solaris 10
          1. Configure the service with svccfg
            1. SVC> select svc:/system/console-login:default
            2. svc:/system/console-login:default> setprop ttymon/terminal_type = "vt100"
            3. svc:/system/console-login:default> quit

      11. ^^ What instruction set does my CPU support?
        1. Solaris 10
          1. /usr/bin/file /lib/libc.so.1 | /usr/bin/sed 's/.*\[\(.*\)\].*/\1/'

    5. ^^ Filesystem

      1. ^^ How do I get a list of superblocks on a filesystem?
        1. assumes filesystem was created with default parameters
        2. /usr/sbin/newfs -N device | awk '/^ [0-9]/'

      2. ^^ How do I grow/shrink a ufs filesystem?
        1. Grow
          1. Unmounted filesystem (not /, /usr, /var)
            1. Allocate additional contiguous disk space with format(1m)
              1. Unnecessary if you are using a volume manager
            2. /usr/lib/fs/ufs/mkfs -G rawdevice newsize
          2. Mounted filesytem (not /, /usr, /var)
            1. Allocate additional contiguous disk space with format(1m)
              1. Unnecessary if you are using a volume manager
            2. /usr/lib/fs/ufs/mkfs -G -M mountpoint rawdevice newsize
        2. Shrink
          1. You cannot shrink a ufs filesystem

      3. ^^ How do I determine what type of filesystem a given device has?
        1. /usr/sbin/fstyp blockdevice

      4. ^^ What are inodes 0, 1, and 2 used for?
        1. Inode 0 is unusable. It is used to mark unused inodes.
        2. Inode 1 is unusable. Use of this inode for bad block information is deprecated.
        3. Inode 2 is "/" or "root" of the filesystem.

      5. ^^ What do I do if I have a corrupt boot block?
        1. ok boot cdrom -s
        2. /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c#t#d#s#

      6. ^^ What is the DNLC?
        1. DNLC is the directory name look up cache
        2. It is a hash table bucket structure of name cache entries for fast lookup. The elements in this cache are directory vnode, file name, and credential.
        3. Solaris also employs a directory cache mechanism for large directories. This is an unordered linked list of free space entries.
        4. Solaris caches names up to 30 characters. Longer names are read using the standard, slower method, by traversing the directory structure.
        5. Read /usr/include/sys/dnlc.h

      7. ^^ How does the DNLC relate to the kernel vfs layer?
        1. Since the DNLC is a reference to recently used vnodes, the filesystem will read from the DNLC prior to the underlying filesystem. This is due to the fact that every inode/rnode has a corresponding vnode. vfs is a layer of abstraction in the kernel that allows the kernel to support multiple filesystem types by presenting all filesystems in a uniform manner.

      8. ^^ How do I get statistics about DNLC performance?
        1. A value of 90% or less requires tuning.
        2. Method 1 (recommended)
          1. /usr/bin/vmstat -s | /usr/bin/grep "name lookup"
        3. Method 2
          1. Solaris 2.6 / 7
            1. echo '*ncstats*0t100%(*ncstats+*(ncstats+4)+*(ncstats+14))=D' | /usr/bin/adb -k
          2. Solaris 8 / 9 / 10
            1. echo '*ncstats*0t100%(*ncstats+*(ncstats+4)+*(ncstats+14))=D' | /usr/bin/mdb -k

      9. ^^ How do I prevent the ufs filesystem from buffering my database files?
        1. ufs now has the ability to provide direct access to a file. This new method is not as effective as RAW access because the filesystem still allocates the file by indirect blocks which can fragment.
        2. this is done on a per filesystem, rather than per file basis
        3. direct i/o can be dangerous when used on filesystems that are accessed by applications that do not buffer data internally
        4. Method 1 (persistent)
          1. Add "forcedirectio" to mount options in /etc/vfstab
        5. Method 2 (not persistent, system up)
          1. /usr/sbin/mount -o remount,forcedirectio,(other options) /mountpoint

      10. ^^ How do I disable "access time" updates for file?
        1. This is useful for web servers and news servers to prevent unnecessary file I/O.
        2. Add "noatime" to mount options in /etc/vfstab

      11. ^^ What is the difference between file mode 1 and 5?
        1. mode 1 allows exec() of the binary
        2. mode 5 allows exec() of the binary and processes to mmap() pages from within userspace
        3. this is why shared libraries generally need to be PROT_READ and PROT_EXEC at page level and -r-x at file level

      12. ^^ How can I force an unmount of a filesystem?
        1. Solaris 2.6 / 7
          1. there is no special flag to the umount() system call that allows this
        2. Solaris 8 / 9 / 10
          1. /usr/sbin/umount -f /mount

      13. ^^ What is the default ufs block size?
        1. 8192 bytes logical block, 1024 bytes fragment size
        2. Block size is only modifiable at creation

      14. ^^ What is the default ZFS block size?
        1. Solaris 10
          1. 8192 bytes
          2. Block size is only modifiable at creation
          3. Valid sizes are 512 to 131072 bytes in powers of 2

      15. ^^ Why is /lib/libc.so.1 showing up as a mounted filesystem?
        1. Solaris 10
          1. This is a lofs filesystem that allows for an optimized C library by hardware architecture and capabilities
          2. See I.D11 to determine what these capabilites are
      16. ^^ How do I mount an ISO image file?
        1. Solaris 8 / 9 / 10
          1. /usr/sbin/lofiadm -a /path/to/file.iso /dev/lofi/1
          2. /usr/sbin/mount -F hsfs /dev/lofi/1 /mountpoint
        2. OpenSolaris
          1. /usr/sbin/mount -F hsfs /path/to/file.iso /mountpoint

    6. ^^ X11

      1. ^^ How do I use an alternate window manager?
        1. Bypassing CDE
          1. echo "exec /path/to/alternate/window/manager" > .xsession
        2. Maintaining CDE
          1. Xresources
            1. cd /usr/dt/config/C/Xresources.d
            2. /usr/bin/cp Xresources.ow Xresources.wm
            3. Modify Xresources.wm
              1. Dtlogin*altDtName: Alternate WindowManager
              2. Dtlogin*altDtKey: /path/to/alternate/window/manager
              3. Dtlogin*altDtStart: /usr/dt/config/Xsession.wm
              4. Dtlogin*altDtLogo: WMlogo
          2. Xsession
            1. cd /usr/dt/config
            2. /usr/bin/cp Xsession.ow Xsession.wm
            3. Modify Xsession.wm
              1. Place windowmanager environment
          3. Logo (for display in CDE login)
            1. cd /usr/dt/appconfig/icons/C
            2. /usr/bin/cp OWlogo.pm WMlogo.pm
              1. Replace this with your own XPM file

      2. ^^ How do I disable X Windows from starting at boot?
        1. Method 1 (recommended)
          1. /usr/dt/bin/dtconfig -d
        2. Method 2
          1. /usr/bin/mv /etc/rc2.d/S99dtlogin /etc/rc2.d/s99dtlogin

      3. ^^ How do I disable that annoying beep?
        1. Method 1
          1. /usr/openwin/bin/xset b 0
        2. Method 2
          1. /usr/openwin/bin/xset b off
        3. Method 3
          1. /usr/openwin/bin/xset -b

      4. ^^ How do I disable the CDE front panel?
        1. Modify $HOME/.Xdefaults
          1. Dtwm*useFrontPanel: false

      5. ^^ How do I determine which X11 version and extensions are supported?
        1. /usr/openwin/bin/xdpyinfo -v

    7. ^^ Crash Dump

      1. ^^ When did it happen?
        1. Method 1 (to the minute)
          1. /usr/bin/who -b
        2. Method 2 (to the second)
          1. Solaris 2.6 / 7
            1. Become root
            2. echo '*time-(*lbolt%64)=Y' | /usr/bin/adb -k
          2. Solaris 8 / 9 / 10
            1. Become root
            2. echo '*time-(*lbolt%64)=Y' | /usr/bin/mdb -k

      2. ^^ How do I get information about what was going on?
        1. Enable savecore
          1. Solaris 2.6
            1. disabled by default
            2. Modify /etc/init.d/sysetup
              1. Uncomment last 6 lines
          2. Solaris 7 / 8 / 9 / 10
            1. Enabled by default
            2. Enable with '/usr/bin/dumpadm -y'
        2. Default file locations
          1. Corefile is /var/crash/`uname -n`/vmcore.n
          2. Namelist is /var/crash/`uname -n`/unix.n
        3. Process status
          1. Solaris 2.6 / 7
            1. Open the crash interpreter
            2. /usr/sbin/crash -d corefile -n namelist
              1. p -e
                1. The "p" command reads the process table
          2. Solaris 8 / 9 / 10
            1. Open the modular debugger
            2. /usr/bin/mdb namelist corefile
              1. ::ps
                1. The "::ps" command reads the process table
        4. Network status
          1. /usr/bin/netstat namelist corefile
        5. IPC status
          1. /usr/sbin/ipcs -C corefile -N namelist

    8. ^^ Veritas Volume Manager

      1. ^^ How do I allow a user to write to a managed raw device?
        1. /usr/bin/chown is not persistent across reboots
        2. /usr/sbin/vxedit set user=oracle group=dba mode=600 volume

      2. ^^ How do I move rootdg from one system to another?
        1. without this procedure, you will get error messages at boot because the system sees two instances of rootdg
        2. /etc/vx/diag.d/vxprivutil list /dev/rdsk/c#t#d#s# | awk '/^group/'
          1. note the disk group id number
        3. /usr/sbin/vxdg -C -n newdg import dgid
          1. dgid is group id from (a)
          2. this command creates disk group newdg and imports the disk

      3. ^^ What is the difference between Disk Suite and Veritas Volume Manager?
        1. Veritas Volume Manager logs metadata and filesystem data, whereas Disk Suite logs only metadata

      4. ^^ What is the difference between RAID 0+1 and 1+0?
        1. Diagram A (RAID 0+1)
          1.                                    [ v]
                                                ||
                                               [ p]
                                                ||
                                               [sv]
                                                ||
                        =======================[v2]=======================
                        |                                                |
                        ==========[p2]==========  ==========[p2]==========
                        |                      |  |                      |
                        =[s2]==[s2]==[s2]==[s2]=  =[s2]==[s2]==[s2]==[s2]=
                 
          2. Striping occurs at the subvolume(p2) layer.
          3. Mirroring occurs at the subplex (v2) layer.
        2. Diagram B (RAID 1+0)
          1.                                      [ v]
                                                  ||
                                                 [ p]
                                                  ||
                       ==========================[sv]==========================
                       |                                                      |
                       ===========[v2]===========    ===========[v2]===========
                       |                        |    |                        |
                       ====[p2]====  ====[p2]====    ====[p2]====  ====[p2]====
                       |          |  |          |    |          |  |          |
                       =[s2]==[s2]=  =[s2]==[s2]=    =[s2]==[s2]=  =[s2]==[s2]=
                 
          2. Striping occurs at the subvolume(sv) layer.
          3. Mirroring occurs at the subplex (p2) layer.
        3. The diagrams above use the Veritas 3.x nomenclature.
        4. Volume Resynchronization
          1. There is an additional layer of abstraction in RAID 1+0 that allows for isolation of the subdisks into subplexes. Since the subplexes are smaller than the plexes in RAID 0+1, time to resynchronize is reduced.
        5. Fault Tolerance
          1. There is an additional layer of abstraction in RAID 1+0 that allows for isolation of the subdisks into subplexes. Since the subplexes now contain reduced amounts of disks, and are composed solely of single subdisk mirrors, the RAID 1+0 volume can sustain the loss of multiple disks pending all of the disks within a given subplex do not fail.

    9. ^^ Veritas Filesystem

      1. ^^ How do I make vxfs support large files?
        1. /usr/lib/fs/vxfs/fsadm -o largefiles /mountpoint

      2. ^^ How do I defragment a vxfs filesystem?
        1. Determine if necessary
          1. Method 1
            1. /usr/lib/fs/vxfs/df -o s /mountpoint
          2. Method 2
            1. /usr/lib/fs/vxfs/fsadm -ED /mountpoint
              1. reports on both extent and directory fragmentation
        2. /usr/lib/fs/vxfs/fsadm -ed /mountpoint
          1. reorganizes extents and directories

      3. ^^ How do I grow/shrink a vxfs filesystem?
        1. vxfs, unlike ufs, filesystems can be shrunk.
        2. Mounted filesystem (not /, /usr, /var)
          1. /usr/lib/fs/vxfs/fsadm -b size /mountpoint

      4. ^^ How do I prevent the vxfs filesystem from buffering my database files?
        1. Method 1 (persistent)
          1. Add "mincache=direct,convosync=direct" to mount options in /etc/vfstab
        2. Method 2 (not persistent, system up)
          1. /usr/sbin/mount -o remount,mincache=direct,convosync=direct,<other options> /mountpoint
          2. [UNVERIFIED] please email if you can confirm
        3. Method 3 (Quick I/O)
          1. This is presented as an add-on module for filesystem and ships with Veritas Database Edition.
          2. Quick I/O presents files with preallocated extents as character devices to the application in the form of ".filename::cdev:vxfs" by use of the vxqio device driver
          3. Quick I/O is enabled per filesystem, by default, but is configured on a per file basis

      5. ^^ How do I create a Quick I/O file?
        1. Oracle
          1. /usr/sbin/qiomkfile -h <header size> -s <extent size> /path/to/dbfile
            1. <header size> should correspond to DB_BLOCK_SIZE, 32k by default
            2. <extent size> should correspond to the size of the database. by allocating appropriate extents you can prevent fragmentation

      6. ^^ What is the default vxfs block size?
        1. Filesystem size <= 8GB
          1. 1024 bytes
        2. Filesystem size 8GB <= 16GB
          1. 2048 bytes
        3. Filesystem size 16GB <= 32GB
          1. 4096 bytes
        4. Filesystem > 32GB
          1. 8192 bytes

  2. ^^ Network

    1. ^^ Physical Layer

      1. ^^ How do I find the speed my network card is at?
        1. Solaris 2.6 / 7 / 8 / 9
          1. /usr/sbin/ndd -set /dev/hme instance 0
            1. Instance 0 - hme0
            2. Instance 1 - hme1
          2. /usr/sbin/ndd -get /dev/hme transciever_inuse
            1. 0 - onboard
            2. 1 - offboard card (mii)
          3. /usr/sbin/ndd -get /dev/hme link_status
            1. 0 - down
            2. 1 - up
          4. /usr/sbin/ndd -get /dev/hme link_speed
            1. 0 - 10Mb
            2. 1 - 100Mb
            3. 1000 - 1Gb
          5. /usr/sbin/ndd -get /dev/hme link_mode
            1. 0 - half duplex
            2. 1 - full duplex
        2. Solaris 10 / OpenSolaris
          1. /usr/sbin/dladm show-dev e1000g0

      2. ^^ How do I configure what my network card is capable of?
        1. Method 1
          1. /etc/system
            1. this sets global defaults for the driver, therefore it is effective for all instances of the card
            2. HME/QFE/GE interfaces
              1. set hme:hme_adv_autoneg_cap=0
                1. Advertise auto negotiate capability
                2. 0 - off
                3. 1 - on
              2. set hme:hme_adv_100T4=0
                1. Advertise deprecated 100Mbit T4 capability
                2. 0 - off
                3. 1 - on
              3. set hme:hme_adv_100fdx=0
                1. Advertise 1000Mbit full duplex capability
                2. 0 - off
                3. 1 - on
              4. set hme:hme_adv_100hdx=0
                1. Advertise 100Mbit half duplex capability
                2. 0 - off
                3. 1 - on
              5. set hme:hme_adv_10fdx=0
                1. Advertise 10Mbit full duplex capability
                2. 0 - off
                3. 1 - on
              6. set hme:hme_adv_10hdx=0
                1. Advertise 10Mbit half duplex capability
                2. 0 - off
                3. 1 - on
            3. ERI interfaces
              1. set eri:adv_autoneg_cap=0
                1. Advertise auto negotiate capability
                2. 0 - off
                3. 1 - on
              2. set eri:adv_100T4=0
                1. Advertise deprecated 100Mbit T4 capability
                2. 0 - off
                3. 1 - on
              3. set eri:adv_100fdx=0
                1. Advertise 100Mbit full duplex capability
                2. 0 - off
                3. 1 - on
              4. set eri:adv_100hdx=0
                1. Advertise 100Mbit half duplex capability
                2. 0 - off
                3. 1 - on
              5. set eri:adv_10fdx=0
                1. Advertise 10Mbit full duplex capability
                2. 0 - off
                3. 1 - on
              6. set eri:adv_10hdx=0
                1. Advertise 10Mbit half duplex capability
                2. 0 - off
                3. 1 - on
            4. E1000 interfaces
              1. set e1000g:adv_autoneg_cap=0
                1. Advertise auto negotiate capability
                2. 0 - off
                3. 1 - on
              2. set e1000g:adv_100fdx=0
                1. Advertise 100Mbit full duplex capability
                2. 0 - off
                3. 1 - on
              3. set e1000g:adv_100hdx=0
                1. Advertise 100Mbit half duplex capability
                2. 0 - off
                3. 1 - on
              4. set e1000g:adv_10fdx=0
                1. Advertise 10Mbit full duplex capability
                2. 0 - off
                3. 1 - on
              5. set e1000g:adv_10hdx=0
                1. Advertise 10Mbit half duplex capability
                2. 0 - off
                3. 1 - on
              6. set e1000g:adv_1000fdx=0
                1. Advertise 1Gbit full duplex capability
                2. 0 - off
                3. 1 - on
              7. set e1000g:adv_1000hdx=0
                1. Advertise 1Gbit half duplex capability
                2. 0 - off
                3. 1 - on
        2. Method 2
          1. Solaris 2.6 / 7 / 8 / 9
            1. /usr/sbin/ndd -set /dev/hme instance 0
              1. Instance 0 - hme0
              2. Instance 1 - hme1
            2. /usr/sbin/ndd -set /dev/hme adv_autoneg_cap 0
              1. Advertise auto negotiate capability
              2. 0 - off
              3. 1 - on
            3. /usr/sbin/ndd -set /dev/hme adv_100fdx_cap 0
              1. Advertise 100Mbit full duplex capability
              2. 0 - off
              3. 1 - on
            4. /usr/sbin/ndd -set /dev/hme adv_100hdx_cap 0
              1. Advertise 100Mbit half duplex capability
              2. 0 - off
              3. 1 - on
            5. /usr/sbin/ndd -set /dev/hme adv_100T4_cap 0
              1. Advertise deprecated 100Mbit T4 capability
              2. 0 - off
              3. 1 - on
            6. /usr/sbin/ndd -set /dev/hme adv_10fdx_cap 0
              1. Advertise 10Mbit full duplex capability
              2. 0 - off
              3. 1 - on
            7. /usr/sbin/ndd -set /dev/hme adv_10hdx_cap 0
              1. Advertise 10Mbit half duplex capability
              2. 0 - off
              3. 1 - on
          2. Solaris 10 / OpenSolaris
            1. /usr/sbin/dladm set-linkprop -p adv_autoneg_cap=0 e1000g0
              1. Advertise auto negotiate capability
              2. 0 - off
              3. 1 - on
            2. /usr/sbin/dladm set-linkprop -p adv_100fdx_cap=0 e1000g0
              1. Advertise 100Mbit full duplex capability
              2. 0 - off
              3. 1 - on
            3. /usr/sbin/dladm set-linkprop -p adv_100hdx_cap=0 e1000g0
              1. Advertise 100Mbit half duplex capability
              2. 0 - off
              3. 1 - on
            4. /usr/sbin/dladm set-linkprop -p adv_10fdx_cap=0 e1000g0
              1. Advertise 10Mbit full duplex capability
              2. 0 - off
              3. 1 - on
            5. /usr/sbin/dladm set-linkprop -p adv_10hdx_cap=0 e1000g0
              1. Advertise 10Mbit half duplex capability
              2. 0 - off
              3. 1 - on
            6. /usr/sbin/dladm set-linkprop -p adv_1000fdx_cap=0 e1000g0
              1. Advertise 1Gbit full duplex capability
              2. 0 - off
              3. 1 - on
            7. /usr/sbin/dladm set-linkprop -p adv_1000hdx_cap=0 e1000g0
              1. Advertise 1Gbit half duplex capability
              2. 0 - off
              3. 1 - on

      3. ^^ How do I display what my link partner is capable of?
        1. Solaris 2.6 / 7 / 8 / 9
          1. /usr/sbin/ndd -set /dev/hme instance 0
            1. Instance 0 - hme0
            2. Instance 1 - hme1
          2. /usr/sbin/ndd -get /dev/hme lp_autoneg_cap
            1. link partner has auto negotiate capability
            2. 0 - off
            3. 1 - on
          3. /usr/sbin/ndd -get /dev/hme lp_100fdx_cap
            1. link partner has 100Mbit full duplex capability
            2. 0 - off
            3. 1 - on
          4. /usr/sbin/ndd -get /dev/hme lp_100hdx_cap
            1. link partner has 100Mbit half duplex capability
            2. 0 - off
            3. 1 - on
          5. /usr/sbin/ndd -get /dev/hme lp_100T4_cap
            1. link partner has deprecated 100Mbit T4 capability
            2. 0 - off
            3. 1 - on
          6. /usr/sbin/ndd -get /dev/hme lp_10fdx_cap
            1. link partner has 10Mbit full duplex capability
            2. 0 - off
            3. 1 - on
          7. /usr/sbin/ndd -get /dev/hme lp_10hdx_cap
            1. link partner has 10Mbit half duplex capability
            2. 0 - off
            3. 1 - on
        2. Solaris 10 / OpenSolaris
          1. KSTAT uses form MODULENAME:INSTANCE:NAME:STATISTIC
          2. Network interface e1000g0 is the e1000g kernel module, instance 0
          3. kstat -p 'e1000g:0:mac' | awk '/lp_cap_autoneg/ {print $NF}'
            1. link partner has auto negotiate capability
            2. 0 - off
            3. 1 - on
          4. kstat -p 'e1000g:0:mac' | awk '/lp_cap_100fdx/ {print $NF}'
            1. link partner has 100Mbit full duplex capability
            2. 0 - off
            3. 1 - on
          5. kstat -p 'e1000g:0:mac' | awk '/lp_cap_100hdx/ {print $NF}'
            1. link partner has 100Mbit half duplex capability
            2. 0 - off
            3. 1 - on
          6. kstat -p 'e1000g:0:mac' | awk '/lp_cap_10fdx/ {print $NF}'
            1. link partner has 10Mbit full duplex capability
            2. 0 - off
            3. 1 - on
          7. kstat -p 'e1000g:0:mac' | awk '/lp_cap_10hdx/ {print $NF}'
            1. link partner has 10Mbit half duplex capability
            2. 0 - off
            3. 1 - on
          8. kstat -p 'e1000g:0:mac' | awk '/lp_cap_1000fdx/ {print $NF}'
            1. link partner has 1Gbit full duplex capability
            2. 0 - off
            3. 1 - on
          9. kstat -p 'e1000g:0:mac' | awk '/lp_cap_1000hdx/ {print $NF}'
            1. link partner has 1Gbit half duplex capability
            2. 0 - off
            3. 1 - on

      4. ^^ How can I tell if my card is active on the network?
        1. Method 1 (Openboot PROM)
          1. watch-net

      5. ^^ How do I use multiple ethernet interfaces on the same network segment?
        1. Method 1 (modern cards, 1997+)
          1. Modern Sun Adapters have unique mac addresses encoded in the FCode Prom.
          2. /usr/sbin/eeprom local-mac-address?=true
        2. Method 2 (older cards)
          1. From InfoDoc 16733;
                    Section 3.2.3(4) of the IEEE 802.3 spec defines a reserved bit in the
                    Ethernet Address that can be used to administer a universally assigned
                    ethernet addresses. A Locally administered address (LAA) can be
                    implemented to ensure a unique HW address.
                  
          2. Setting the LAA bit can be done by using a 0A hex as the first digit instead of 08.
          3. /usr/sbin/ifconfig hme1 ether 0a:0:20:00:01

      6. ^^ How do I determine if local mac addresses are in use on my host?
        1. /usr/sbin/prtconf -pv | /usr/bin/grep local-mac-address

    2. ^^ Transport Layer

      1. ^^ How do I configure stronger sequence number generation?
        1. From RFC 1948;
                  The initial sequence numbers are intended to be more or less random.
                  More precisely, RFC 793 specifies that the 32-bit counter be incremented
                  by 1 in the low-order position about every 4 microseconds.  Instead,
                  Berkeley-derived kernels increment it by a constant every second, and by
                  another constant for each new connection.  Thus, if you open a
                  connection to a machine, you know to a very high degree of confidence
                  what sequence number it will use for its next connection.  And therein
                  lies the attack.
               
        2. /usr/sbin/ndd -set /dev/tcp tcp_strong_iss 2
          1. 0 - Sequential
          2. 1 - Random increment variance (Default)
          3. 2 - RFC 1948, unique-per-connection-ID.
        3. Modify /etc/default/inetinit.
          1. 1. TCP_STRONG_ISS=2

      2. ^^ I have a large amount of connections in state CLOSE_WAIT, what can be done to reduce this number in the future?
        1. Increase Connection Hash Table
          1. Used for faster connection lookups
          2. Must be set at boot time
          3. Defaults
            1. Solaris 2.6 / 7
              1. Default is 256, Max is 262144
            2. Solaris 8 / 9
              1. Default is 512, Max is 1073741824
            3. Solaris 10
              1. Parameter Removed in Solaris 10
          4. Modify /etc/system
            1. set tcp:tcp_conn_hash_size=8192
          5. /usr/sbin/init 6
        2. Decrease Close Wait / Time Wait Interval
          1. Solaris 2.6 / 7
            1. Can be modified on the fly at any time
            2. Default is 240000, Minimum Recommended is 60000, Range 1 to 600000
            3. Measured in 1/1000ths of a second, default is 4 minutes
            4. /usr/sbin/ndd -set /dev/tcp tcp_close_wait_interval 60000
          2. Solaris 8
            1. Can be modified on the fly at any time
            2. Default is 240000, Minimum Recommended is 60000, Range 1 to 600000
            3. Measured in 1/1000ths of a second, default is 4 minutes
            4. /usr/sbin/ndd -set /dev/tcp tcp_time_wait_interval 60000
          3. Solaris 9 / 10
            1. Can be modified on the fly at any time
            2. Default is 60000, Minimum Recommended is 60000, Range 1 to 600000
            3. Measured in 1/1000ths of a second, default is 1 minute
            4. /usr/sbin/ndd -set /dev/tcp tcp_time_wait_interval 60000

      3. ^^ How can I increase my TCP Window size?
        1. Increase Transmit Window
          1. Increasing this value in excess of the 16bit window defined in RFC793, as SEG.WND, causes the Window Scaling option as defined in RFC1323.
          2. Increasing this value takes additional memory
          3. Solaris 8
            1. Default is 16384
          4. Solaris 9 / 10
            1. Default is 49152
          5. /usr/sbin/ndd -set /dev/tcp tcp_xmit_hiwat 65536
        2. Increase Receive Window
          1. Increasing this value in excess of the 16bit window defined in RFC793, as SEG.WND, causes the Window Scaling option as defined in RFC1323.
          2. Increasing this value takes additional memory
          3. Solaris 8
            1. Default is 24576
          4. Solaris 9 / 10
            1. Default is 49152
          5. /usr/sbin/ndd -set /dev/tcp tcp_recv_hiwat 65536

      4. ^^ What do all the TCP states actually mean?
        1. CLOSED (0)
          1. Socket is closed
        2. LISTEN (1)
          1. Socket is passive, awaiting a connection request
        3. SYN_SENT (2)
          1. Socket is active, has sent a SYN
          2. Session not yet active
        4. SYN_RECEIVED (3)
          1. Socket is active, has sent and received SYN
          2. Session not yet active
        5. ESTABLISHED (4)
          1. Socket is active
          2. Session is active, has completed handshake
        6. CLOSE_WAIT (5)
          1. Socket is closed, received FIN, waiting for close
          2. Session is terminating
        7. FIN_WAIT (6)
          1. Socket is closed, sent FIN, waiting for FIN ACK
          2. Session is terminating
        8. CLOSING (7)
          1. Socket is closed, exchanged FIN, waiting for FIN ACK
          2. Session is terminating
        9. LAST_ACK (8)
          1. Socket is closed, received FIN, waiting for FIN ACK
          2. Session is terminating
        10. FIN_WAIT_2 (9)
          1. Socket is closed, received FIN ACK
          2. Session is complete
        11. TIME_WAIT (10)
          1. Socket is closed, waits for ( 2 * max segment life )
          2. Session is complete

Disclaimer: This document is not supported by Sun Microsystems. Errors in certain commands executed as root can cause system failure and data corruption. Please exercise caution and remember to backup your data.