Solaris 10 System Administration Part I

From Got Opinion Wiki
Jump to navigation Jump to search

My Solaris 10 System Administration Part I notes.

Credits

My main source of information came from Oracle System Administration of Solaris 10 Part I from Oracle University (excellent training) & Solaris 10 man pages.

Solaris 10 OS Directory Hierarchy

File systems

Unix File System (UFS) is the default file system

Directory starts with root directory (/)

Solaris 10 OS includes alternate file system called zettabyte file system (ZFS)

Logically all directories fall below root directory (/)

Physically directories can be located on one or spread over multiple file systems

<insert graphics to show this>

Refer to filesystem man page for more information on file system organization.

$ man -s 5 filesystem

Important directories

Directory Notes
/ root of file system
/bin symbolic link to /usr/bin & location for binary files of standard system commands
/dev primary directory for logical device names & contents of directory are symbolic links to device files in /devices directory
/etc directory holds host-specific config files & databases for system administration
/export default directory for commonly shared file systems (like user home directories)
/home default directory or mount point for user home directories
/kernel
/lib
/mnt
/opt
/platform
/sbin
/usr
/var

Important in-memory system directories

/dev/fd
/devices
/etc/mnttab
/etc/svc/volatile
/proc
/system/contract
/system/object
/tmp directory for temporary files (cleared during boot sequence)
/var/run

Subdirectories of note under /dev

/dev/dsk block disk devices
/dev/fd file descriptors
/dev/md logical volume management metadisk drives
/dev/pts pseudo terminal devices
/dev/rdsk raw disk devices
/dev/rmt raw magnetic devices
/dev/term serial devices

Important subdirectories under /etc

/etc/acct config info for accounting system
/etc/cron.d config info for cron utility
/etc/default default info for various programs
/etc/inet config files for network services
/etc/init.d scripts for starting & stopping services
/etc/lib
/etc/lp config info for printer subsystem
/etc/mail config info for mail subsystem
/etc/nfs config file for NFS server logging
/etc/opt config info for optional packages
/etc/rc#.d legacy scripts that are executed when entering or leaving a specific run level
/etc/security controls files for Role Based Access Control & security privileges
/etc/skel default shell initialization files for new users
/etc/svc Service Management Facility database & log files

Important subdirectories of /usr

/usr/bin standard system commands
/usr/ccs C-compilation programs & libraries
/usr/demo demo programs & data
/usr/dt Java Desktop System (JDS) software directory or mount point
/usr/include Header files
/usr/jdk directory contains Java technology programs & libraries
/usr/kernel loadable kernel modules not generally required during boot process
/usr/lib architecture-dependent databases, libraries, & binaries that are not invoked directly by user
/usr/opt config info for optional packages
/usr/sbin sys admin coomands
/usr/spool symbolic link to /var/spool directory

Important subdirectories of /var

/var/adm log files for syslog, system accounting, etc
/var/crash crash dump storage
/var/spool spool files storage
/var/svc Service Management Facility control files and logs
/var/tmp long term storage of temp files (survives reboot)

File components

Generally a file name is associated with an inode & an inode provides access to data blocks.

<insert figure of relationship>

file names

File names are objects frequently used to manage files. A file must have a name that is associated with an inode.

inodes

Inodes are objects that Solaris OS uses to maintain info about a file. In general an inode contains:

  1. file info = file owner, permissions, & size
  2. pointers to data blocks associated with file content

inodes are numbered & each file system contains its own inode list

At UFS creation a new inode list is created

data blocks

data blocks are units of disk space that store data

Regular files, directories, & symbolic links make use of data blocks

Device files do not hold data therefore do not use data blocks

ZFS uses the following data structures: dnode data structure: the data structure contains pointers to data blocks znode data structure: this data structure contains info about file (owner, permissions, & size)

Dnode & znode data structures are called metadata & stored dynamically by ZFS. ZFS implements ZFS POSIX layer (ZPL) which is a primary interface for ZFS. ZPL allows commands you use with UFS to work with ZFS. ZFS emulates UFS inode number mechanism

Identifying file types

Solaris has four main file types:

regular or ordinary files store one or more types of data
directories store one or more types of data
symbolic links store one or more types of data
device files does not store data

Use ls command with -l option to distinguish different file types

The first character of each line indicates file type

<insert image of ls -l output with dictionary>

- regular files
d directories
l symbolic links
b block-special device files
c character-special device files

Examples on v240:

# cd /etc
# ls -l
total 650
lrwxrwxrwx   1 root     root          14 May  3 15:34 TIMEZONE -> ./default/init
drwxr-xr-x   6 root     other        512 May  3 16:15 X11
drwxr-xr-x   2 adm      adm          512 May  3 16:19 acct
-rw-r--r--   1 root     sys          253 Aug  6  2010 aggregation.conf
lrwxrwxrwx   1 root     root          14 May  3 16:03 aliases -> ./mail/aliases
drwxr-xr-x   7 root     bin          512 May  3 16:11 apache
drwxr-xr-x   2 root     bin          512 May  3 15:54 apache2
*****output truncated*****
# pwd
/devices/pci@1c,600000/scsi@2
# ls -l
total 8
drwxr-xr-x   2 root     sys          512 May  3 16:25 sd@0,0
brw-r-----   1 root     sys       32,  0 Jul  7 13:54 sd@0,0:a
crw-r-----   1 root     sys       32,  0 Jul 14 16:50 sd@0,0:a,raw

directories

directories only store information on file name to inode number relationships


A directory contains data for files that are logically located within directory

Regular files

Most common file types found in Solaris are regular files. Regular files can store different types of data including ASCII text or binary data.

Symbolic links

a symbolic link is a file that points to another file & contain only one type of data

a symbolic link contains the path name of the file to which it points & the file can be located on other file systems

the size of a symbolic link always matches the number of characters in the path name it contains

Example:

after the '->' there are 19 characters & the 19 before May is the file size.

# ls -l /etc/prtvtoc
lrwxrwxrwx   1 root     root          19 May  3 15:34 prtvtoc -> ../usr/sbin/prtvtoc

symbolic links can point to regular files, directories, other symbolic links, & device files.

symbolic links can be absolute or relative path names

ln command

ln command with -s option creates a symbolic link

<insert example of creating symbolic link>

<insert picture of relationship between link & file>

device files

device file provides access to a device

When using long listing on file the size field is populated by two numbers separated by comma

Long listing:

bash-3.00$ pwd
/devices
bash-3.00$ ls -l | grep pci
drwxr-xr-x   4 root     sys          512 May  3 16:25 pci@1c,600000
crw-------   1 root     sys      109, 767 Jul 14 16:50 pci@1c,600000:devctl
crw-------   1 root     sys      109, 764 Jul 14 16:50 pci@1c,600000:intr
crw-------   1 root     sys      109, 765 Jul 14 16:50 pci@1c,600000:reg
drwxr-xr-x   5 root     sys          512 May  3 16:25 pci@1d,700000
crw-------   1 root     sys      109, 1023 Jul 14 16:50 pci@1d,700000:devctl

You can use the file command:

bash-3.00$ file pci\@1e\,600000:devctl
pci@1e,600000:devctl:   character special (109/511)
bash-3.00$



To Solaris