53
Solaris commands 1. Directory Hierarchy S.No Directory Description 1. / The overall file system 2. /bin The binary files of standard system commands 3. /dev The directory for logical device names. This directory are symbolic links that point to device files in the /devices directory. 4. /devices The primary directory for physical device names. 5. /etc Host-specific configuration files and databases for system administration. 6. /export Shared file systems such as users home directories. 7. /home User’s home directory 8. /kernel Platform-independent loadable kernel modules that are required as part of the boot process. 9. /mnt Temporary mount point for file system. 10. /opt Mount point for add-on application packages. 11. /platform Platform dependent loadable

new- solaris commands - sekar.doc

Embed Size (px)

Citation preview

Page 1: new- solaris commands - sekar.doc

Solaris commands

1. Directory Hierarchy

S.No Directory Description1. / The overall file system 2. /bin The binary files of standard system commands3. /dev The directory for logical device names. This

directory are symbolic links that point to device files in the /devices directory.

4. /devices The primary directory for physical device names.

5. /etc Host-specific configuration files and databases for system administration.

6. /export Shared file systems such as users home directories.

7. /home User’s home directory8. /kernel Platform-independent loadable kernel modules

that are required as part of the boot process.9. /mnt Temporary mount point for file system.10. /opt Mount point for add-on application packages.11. /platform Platform dependent loadable kernel modules.12. /sbin Essential executables that are used during the

booting process and in manual system-failure recovery.

13. /tmp Temporary files 14. /usr That contains programs, scripts, and libraries

that are used by all system users.15. /var Varying files, which usually includes

temporary, logging, or status files.

Page 2: new- solaris commands - sekar.doc

2. Managing local disk devices

S.No. Command Description1. Ls /dev/dsk Logical device name2. Ls /devices Physical device names.3. Ls-l /dev/dsk/c0t0d0s0 A physical device name contains the H/W info4. /etc/path_to_inst The system records its physical name and

instance name in the command.This file is read only at boot time.

5. Prtconf To display system’s configuration information.6. Prtconf | grep –v not Whether the device is attached or not attached

to the system. To view a list of only attached devices on the system.

7. Format To display both logical and physical device names for all currently available disks.

8. /reconfiguration This file causes the system to check for the presence of any newly installed devices the nest time it is powered on or booted.

9. Devfsadm The devfsadm command performs the device reconfiguration process and updates the /etc/path_to_inst file and the /dev and /devices directories during reconfiguration events.The devfsadm command also maintains the /etc/path_to_inst file.

10. Prtvtoc To print the VTOC information. 11. Fmthard

Page 3: new- solaris commands - sekar.doc

Solaris OE File System

S.no Command Description1. Newfs As the root user, you can construct a ufs file

system on a disk slice by using the newfs command.This command is located in the /usr/sbin directory.

2 Fstyp3. Tunefs Minfree space change4. Fsck File system check.5. Lost + found6. Df –k To display the capacity of file systems.7. Df –h The same file system displayed with the –h

option would appear in human-readable format.

8. Du option- -k,-s,-a To display the number of disk blocks used by directories and files.

9. Du –ak To display disk usage including files.10. Du –sk To display only a summary of disk usage.11. Quot To display how much disk space, in kilobytes,

is being used by users.12. Quot –a Reports on all mounted file systems13. Quot –f Includes the number of files.14. Quot –af To display disk space being used by users on

all mounted file systems.

Page 4: new- solaris commands - sekar.doc

Performing Mounts and Unmounts

S.no Command Description1. /etc/vfstab This file lists all the file systems to be

automatically mounted at system boot time, with the exception of the /etc/mnttab and /var/run file systems/

2. /etc/mnttab This file is really an mntfs file system that provides read-only information directly from the kernel about mounted file systems on the local host.

3. mount You can mount file systems manually buy logging in as the root user and running the mount command, or the system can automatically mount file systems at boot time after consulting the /etc/vfstab file.

4. Mountall The root user can use the mountall command to mount manually every file system in the /etc/vfstab file that has a yes in the mount at boot field.

5. /etc/vfstab To view the FS type field6. /etc/default/fs To view a local file system type.7. /etc/dfs/fstypes To view a remote file system type.8. Fstyp We can also use the fstyp command with the

raw device name of the disk slice to determine a file system’s type. Ex; fstyp /dev/rdsk/c0t0d0. => Ufs.

9. Hsfs To mount a file system that resides on a CD-ROM when the volume management services are stopped, as the root user perform the command.# mount –F hsfs –o ro /dev/dsk/c0d0t0s0 /cdrom.

10. Pcfs To mount a file system that resides on a diskette when the volume management services are stopped. As the root user, perform the commands. # mkdir /pcfs# mount –F pcfs /dev/diskette /pcfs.

11. Unmount Unmounting afile system by using the umount command removes it from the file system mount point and deletes its entry from the

Page 5: new- solaris commands - sekar.doc

/etc/mnttab file.

12. Unmountall The /etc/mnttab file is read by the /usr/sbin/umountall command during the system shutdown sequence or when umountall is invoked from the command line. The umountall unmounts all file systems specified in the vfstab file except / (root), /usr, /proc, /dev/fd, /var, /var/run, and /tmp.

13. Fuser To stop all processes that are currently accessing a file system. Better u ref: 4-18 page.

14. Umount –f As the root user, you can unmount a file system , even if it is busy , by using the –f (force) option with the umount command.

6. Package Administration

S.No Command Description1. /var/sadm/install/contents This file is a complete record of all the

software packages installed on the local system disk. It references every file and directory belonging to every software package and shows the configuration of each product installed.

2. Pkgadd Installs software packages to the system 3. Pkgrm Removes a package from the system.4. Pkginfo Displays software package information

installed on the local system’s. The /var/sadm/pkg directory maintains a record of all installed packages.

5. Pkgchk Checks package installation state.6. Pkginfo | more To display information about software

packages installed on the local system’s disk.

Page 6: new- solaris commands - sekar.doc

7. Pkginfo –l | more To view additional information about each software package installed on the local ystems hard drive .

8. Pkginfo –l SUNWman To display the information for a specific software package, specify its name on the command line.

9. Pkginfo | wc –l To determine how many packages are currently installed on disk.

10. Pkginfo –d /cdrom/cdrom0/s0/solaris_9/product |more

To view information about packages that are located on solaris 9 software 1 of 2 CD – ROM.

11. Pkgchk SUNWcarx Checks the contents and attributes of the SUNWcarx software package currently installed on the system.

12. Pkgchk –v SUNWcarx To list the files contained in a software package, use the –v option.

13. Pkgche –p /etc/shadow To determine if the contents and attributes of a file have changed since it was installed with its software package, use the –p option.

14. Pkgchk –l -p /usr/bin/showrev The -l opton with the pkgchk command list information about selected files that makes up a package.

15. Pkgrm SUMWapchr This command removes the sunwapchr software package from the system.

16. Spool directory To ref: page no: 6-11&12.

Page 7: new- solaris commands - sekar.doc

7. Managing Software patches.

S.No Command Description1. Showrev –p & patchadd –p

(Showrev is a binary and patchadd is a script.)

The showrev and patchadd command provide useful information about currently installed patches. This command takes longer to display patch information.

2. Ls /var/sadm/patch Historical information about all patches that are currently installed on a system and that can be uninstalled using the patchrm command is stored in the directory.

3. Patchadd Installs patches to the Solaris OE4. Patchrm Removes patches installed on the Solaris OE5. # cd /var/tmp

# patchadd 105050-01How to installing a patch.

6 Number Patchadd Error Codes1. 0 No error.2. 1 Usage error.3. 2 An attempt to apply a patch that has already

been applied.4. 3 The effective user ID is not root.5. 5 The pkgadd command failed.6. 7 An invalid package directory.7. 8 An attempt to patch a package that is not

installed.8. 10 Package validation errors.

7 Patchrm 105050-01 How to remove patch.

Page 8: new- solaris commands - sekar.doc

8.Boot PROM Commands

S.No Command Description1. Banner Displays the power-on banner2. Boot Boots the system3. Help Lists the main help categories4. Printenv Displays all parameters’ current and default

values5. Setenv Sets the specified NVRAM parameter to some

value6. Reset-all Reset the entire system;similar to a power

cycle.7. Probe-ide Identifies devices on the internal integrated

device electronics bus.8. Probe-scsi Identifies devices on the internal integrated

small computer system interface bus. 9. Probe-scsi-all Identifies the devices on all scsi buses.10. Probe-fcal-all Identifies devices on all fibre channel loops.11. .version Displays the version and the date of the boot

PROM.12. Test Runs self-tests on specified devices13. .enet-addr Displays the Ethernet address14. .idprom Displays the ID PROM contents 15. .speed Displays the speed of the processor and of the

buses attached to the system.16 .registers Displays the contents of the registers.17. Boot –s18 Boot –a19 Boot –r20. Boot –v21. Boot –rv22. Boot –sv23. Show-devs This command to view the entire device tree.24. Devalias To identify the current boot device alias for

the system.25. Navlias You use the nvalias command to create a new

device alias name to access a newly attached external device. Format is :Nvalias aliasname dcvice_path.

26. Nvunalias This command to remove an alias name. format is: ok nvunalias aliasname.

Page 9: new- solaris commands - sekar.doc

27. /usr /sbin/eeprom Viewing and changing NVRAM Parameter from the shell.

28. Eeprom To view and change nvram parameters & to list all of the parameters with their current values.

29. Sync Manually synchronize the file systems by using the open boot prom sync command.

30.

9. Performing Boot and Shutdown Procedures.

S.No Command Description1. Run level Function

a. 0 System is running the prom monitorb. S or s Single-user mode with critical file systems

mounted and accessible.c. 1 Single-user administrative state with access to

all available file systems.d. 2 The system is supporting multiuser

operations.e. 3 Multiuser operations and has NFS resource

sharing and other network resource servers available specified as the default run level in the /etc/inittab file.

f. 4 This level is currently not implemented.g. 5 Shut down and the system is powered off.h. 6 Shut down and the system reboots to the

default run level.2. Who –r To determine the current run level of a system.

Page 10: new- solaris commands - sekar.doc

10. Performing User Administration.

S.No Command Description1. /etc/passwd Authorized system users (have login)account

entries in the file.2. /etc/shadow This file is a separate file that contains the

encrypted passwords.3. /etc/group This file defines the default system group

entries.4. Useradd Adds a new user account on the local system.5. Usermod Modifies a user’s account on the local system.6. Userdel Deletes a user’s account from the local system.7. Groupadd Adds a new group entry to the system.8. Groupmod Modifies a group entry on the system.9. Groupdel Deletes a group entry from the system.10.

11. Performing System Security.

S.No Command Description1. Who To display a list of users currently logged in

to the local system. The command reads the binary file /var/adm/utmpx.

2. Rusers the full path to this n/w server daemon is /usr/lib/netsvc/rusers/rpc.rusersd.

This command produces output similar to that of the who command, but it displays a list of the users logged in on local and remote hosts.

3. Finger To display information about user activity that is either local or remote.

4. Last To display a record of all logins and logouts with the most recent activity at the top of the out put. This file reads the binary file /var/adm/wtmpx.

5. Su This command to switch to the superuser or another user without logging out and back in as that user.

Page 11: new- solaris commands - sekar.doc

6. Whoami To display the login name of the EUID.7. Who am I To determine the login name of the original

user use this command.8. /etc/default/su For security reasons, you must monitor who

has been using the su command, especially those users who are trying to gain root access on the system.

14. Controlling System Processes

S.No Command Description1. Prstat To displays information about active processes

on the system.2. Clearing frozen processes

Kill and pkill We use the kill or pkill commands to terminate one or more processes.

3. At Use the at command to automatically execute a job only once at a specified time.

4. Option Descriptiona. -m Sends mail to the user after the job has

finished.b. -r job Removes a scheduled at job from the queue.c. -q queuename Specifies a specific queue. d. Time Specifies a time for the command to execute e. -l Reports all jobs scheduled for the invoking

user.5. Crontab Users can submit a command to the cron

facility by modifying their crontab file. All crontab files are maintained in the /var/spool/cron/crontabs directory.

6. Crontab –l To view the contents of the root crontab file, run this command as the root user.

7. Crontab –e This command to open your crontab file and add the appropriate entry.

8. Crontab –r username The correct way to remove a crontab file is to invoke the command.

9.

Page 12: new- solaris commands - sekar.doc

15. Performing File System Backups

S.No Command Description1. Mt Commands that you can use to control a

magnetic tape drive.2. Mt status Displays status information about the tape

drive 3. Mt rewind Rewinds the tape.4. Mt offline Rewinds the rape and, if appropriate, takes the

drive unit offline and if the hardware supports it, unloads.

5. Mt fsf count Moves the forward count records.6. (Mt –f tape-device-name

command count)Mt –f /dev/rmt/0n fsf 2

This command positions the tape at the beginning of the third tape record.

7. Ufsdump –s The number of tapes for a backup according to the size of the file system we are backing up

8. /etc/dumpdates This file shows the file system that was backed up and the level of the last backup. It also shows the day, the date, and the time of the backup.

9. /usr/sbin/ufsdumpufsdump option(s) argument(s) filesystem_name

The standard Solaris OE command for ufs file system backups.

10. Ufs dump option Description a. 0 – 9 Back up level. Level 0 is a full backup of the

file system. Levels 1 through 9 are incremental backups of files that have changed since the last lower-level backup.

b. V Verify.c. S (upper case) Size estimate. d. 1 (ONE) Auto load.e. 0 Off line f. U Update the system, creates an entry in the

/etc/dumpdates file with the device name for the file system disk slice, the backup level (0 – 9), and the date.

g. N Notify.h. F device Specify. The system specifies the device name

of the file system backup.

Page 13: new- solaris commands - sekar.doc

16. Performing File System Restores

S.No Command Description1. Ufsrestore To restore a regular file system, such as the

/export/home or /opt file sytem.

Inodes:Inodes are the objects the solaris OE uses to record information about a file.

Inodes contain two parts. 1. inodes contain information about the file, including its owner, its permissions,

and its size.2. inodes contain pointers to data blocks associated with the file.

Data Blocks

Data blocks are units of disk space that are used to store data. Regular files, directories, and symbolic links make use of data blocks. Device files do not hold data.

File types

1. Regular or ordinary files - 2. Directories d3. Symbolic links files l4. Device files

a. Block – special device files –bb. Character – special device files - c

(Regular files, directories, and symbolic links all store one or more types of data. Device file do not store data.)

Page 14: new- solaris commands - sekar.doc

Regular files There are many ways to create regular

The vi editor to create an ASCII text file or a user could use a Compiler to create a file that contains binary data.

The touch command with a nonexistent file name to create a new, empty regular file

The cat command creates a text file.

Directories

Directories store information that associates file names with inode numbers. The mkdir command is one way to create new directories

Symbolic links

A symbolic link is a file that points to another file. Like directories which contain only directory information, symbolic links contain only one type of data.

Same file name different inode.

Major & minor number

The inode information for dad @0,0: a contains manor number 134 and minor number 0. Major number 134 identifies the dad device driver. The dad device driver controls integrated device electronics (IDE) disk drives. Minor number 0, in this case, identifies slice.

Page 15: new- solaris commands - sekar.doc

Hard links

Every entry in a directory constitutes a hard link. Think of every file name as a hard link to an inode. When you create a file, using the touch commands, for example, a new director entry is created that links the file name you specified with a particular inode. In this way, creating a new file creates a hard link.

Sector The smallest addressable unit on a platter. One sector can hold

512 bytes of data. Sectors are also known as disk blocks.

TrackA series of sectors positioned end-to-end in a circular path.

CylinderA stack of tracks.

Disk slices

Disks are logically divided into individual partitions known as disk slices. Disk slices are groupings of cylinders that are commonly used to organize data by function.

Disk slice naming convention

Controller number

Identifies the host bus adapter which control communications between the system and disk unit.

Target number

A unique hardware address that is assigned to each disk, tape, or CD-ROM.

Disk number

The disk number is also known as the logical unit number (LUN)

Page 16: new- solaris commands - sekar.doc

Slice number

A slice number ranging from 0 to 7.

Logical device names

Logical disk device names are symbolic links to the physical device names kept in the /devices directory. All logical device names are kept in the /dev directory. The logical device names contain the controller number, target number, disk number, and slice number.

Physical device names

A physical device names uniquely identify the physical location of the hardware devices on the system and are maintained in the /devices directory. A physical device name contains the hardware information.

Instance names

Instance names are abbreviated names assigned by the kernel for each device on the system.

An instance name is a shortened name for the physical device name. 2

1. sdn => where sd is the disk name and n is the number, such as sd0 for the first SCSI disk device.

2. dadn=> where dad (direct access device) is the disk name and n is the number, such as dad0 for the first IDE disk device.

Solaris OE file systems

Disk – based file systems

Distributed file systems

Pseudo file systems

Disk based file systems Ufs – The UNIX file system in the Solaris OE is based on the Berkeley fast file system.

Hsfs – The high sierra file system is a special – purpose file systems developed for use on CD – ROM media.

Pcfs – The pc file system is a UNIX implementation of the disk operating system (DOS) file allocation table (FAT32) file system.

Page 17: new- solaris commands - sekar.doc

Udfs – The universal disk format file systems is used for optical storage targeted at DVD and CD – ROM media.

Distributed file systems

Nfs – The network file system allows users to share files among many types of systems on the network.

Pseudo file systems

Pseudo file systems are memory based. These file systems provide for better system performance, in addition to providing access to kernel information and facilities.

Tmpfs – The temporary file system stores files in memory, which avoids the overhead of writing to a disk-based file system.

Swapfs – The swap file system is used by the kernel to manage swap space on Disks.

Fdfs – The fiddle descriptor file system provides explicit names for opening files by using file descriptor in the /dev/fd directory.

Procfs – The process file system contains a list of active processes in the /proc directory. The processes are listed by process number.

Mntfs – The mount file system provides read-only information from the kernel about locally mounted file systems.

Disk label (VTOC)

The disk label contains the partition table for the disk. The VTOC resides in the first disk sector (512 – byte blocks). Only the first disk slice contains a VTOC, although file systems created on any slice skip the first sector in case it might contain a VTOC.

Boot Block

The bootstrap program resides in the 15 disk sectors (sectors 1 – 15) that follow the VTOC. Only the / file system has an active boot block.

Page 18: new- solaris commands - sekar.doc

Primary Super block

The super block resides in the 16 disk sectors (sectors 16-31) that follow the boot block. The superblock is a table of information that describes the file system.

a. The number of data blocks

b. The number of cylinder groups

c. The size of a data block and fragment

d. A description of the hardware, derived from the label

e. The name of the mount point

f. File system state flag: clean, stable, active, logging, or unknown.

Backup Supserblocks

When the file system is created, each cylinder group replicates the superblock beginning at sector 32. This replication protects the critical data ;in the superblock against catastrophic loss.

Cylinder Groups

Each file system is divided into cylinder groups with a minimum default size of 16 cylinders per group. Cylinder groups improve disk access.

The file system stores large files across several cylinder groups.

Cylinder Group Blocks

The cylinder group block is a table in each cylinder group that describes the cylinder group.

a. The number of inodes

b. The number of data blocks in the cylinder group.

Page 19: new- solaris commands - sekar.doc

c. The number of directories.

d. Free blocks, free inodes, and free fragments in the cylinder group.

e. The free block map.

f. The used inode map.

The ufs inode

An inode contains the following information about a file:

a. The type of file and the access modes

b. The user identification (UID) and group identification (GID) number of the file’s owner and group

c. The size of the file.

d. The link count

e. The time the file was last accessed and modified and the inode changed.

f. The total number of data blocks used by or allocated to the file

g. Two types of pointers: direct pointers and indirect pointers.

Direct Pointers

Inside the inode there are 12 direct pointers, which contain addresses for the file’s fist 12 data blocks. The 12 direct pointers can each reference 8-kbyte data blocks for a file that is up to 96 kbytes.

Indirect Pointers

The three types of indirect pointers within an inode are:

Single indirect pointer Refers to a file system block that contains pointers to data

Blocks. This file system block contains 2048 additional addresses of 8-kbyte data blocks, which can point to an additional 16 mbytes of data.

Page 20: new- solaris commands - sekar.doc

Double indirect pointer Refers to a file system block that contains single indirect

pointers. Each indirect pointer refers to a file system block that contains the data that contains the data block pointers. Double indirect pointers point to an additional 32 gbytes of data.

Triple indirect pointer Can reference up to an additional 64 tbytes of data.

However, the maximum size of a ufs file system is limited to 1 tbyte due to the maximum address space of 32 - bits for the device drivers.

Data Inconsistencies checked by the fsck command

The fsck command makes several passes through a file system. During 3each pass, the fsck command checks for several types of file system inconsistencies.

Superblock Consistency

The file system supesrblock is checked for inconsistencies involving such parameters as file system size, free block count, and free inode count.

Cylinder Group Block Consistency

The fsck command checks any unallocated data blocks claimed by inodes, the unallocated data block count, and the unallocated inode count.

Inode Consistency

The fsck command checks for the allocation state of inodes, as well as the type, the link count, duplicate blocks, bad blocks, the inode size, and the block count for each inode. Any unreferenced inode with a nonzero link count is linked to the file system’s lost + found directory.

Data Block Consistency

Page 21: new- solaris commands - sekar.doc

The fsck command cannot check ordinary data blocks, but it can check directory data locks. In directory data blocks, the fsck command checks for inodes that point to unallocated blocks, unallocated blocks tagged as in use, allocated blocks tagged as free and directories not connected to the file system. These directories are linked back to the file system in its lost + found directory.

The lost + found Directory

The fsck command puts files and directories that are allocated but unreferenced in the lost +found directory located in that file system. The inode number of each file is assigned as the file name. if the lost + found directory does not exist, the fsck command creates it. If not enough space exists in the lost + found directory, the fsck command increases the directory’s size.

/etc/vfstab this file information This file is 7 fields:

1. Device to mount

2. Device to fsck

3. Mount point

4. Fs type

5. Fsck pass

6. Mount at boot

7. Mount options

/etc/mnttab this file information This file is 5 fields

1. Mount point

2. Device name

Page 22: new- solaris commands - sekar.doc

3. Mount options

4. Dev=number

5. Date and time mounted.

There are a number of ways to install the Solaris 9 OE on your system.

1. Solaris sun install program

2. Solaris web start installation software.

3. Custom jumpstart procedure

4. Solaris web start flash installation

5. Standard upgrade.

6. 6. Solaris live upgrade method.

The entire boot process is described by four distinct phases.

1. The boot PROM phasePROM Runs POSTBoot Locates boot-deviceBoot Reads bootblkBoot Loads bootblk

2. Boot programs phaseBootblk Loads secondary Boot program (ufsboot)Ufsboot loads kernel: 32 bit or 64 bit kernel

3. Kernel initialization phaseKernel reads configuration file /etc/systemKernel initializes itself and loads modules

4. init phaseKernel starts /etc/initinit starts

The requirements for each of the seven fields in the /etc/passwd file.

1. Login ID: Represents the user’s login name.2. Xxx : The user’s encrypted password.3. UID : The UID number used by the system to identify the user.4. GID : The GID number used by the system to identify the user’s primary Group.5. Comment: Typically contains the user’s full name.

Page 23: new- solaris commands - sekar.doc

6. Home_ directory: The full path name to the user’s home directory.7. Login shell: The user’s login shell.

The requirements for each of the eight fields in the /etc/shadow file.

1. LoginID: the user’s name2. Password : a 13 character encrypted password.3. Lastchg : the number of days between January 1, 1970, and the last password

Modification date.4. Min : the minimum number of days required between password changdes.5. Max : the maximum number of days the password is valid before the user is

Prompted to enter a new password at login.6. Warn : the number of days the user is warned before the password expires.7. Inactive : the number of inactive days allowed for the user before the user’s

Account is locked.8. Expire : the date when the user account expires. After the date is exceeded

The user can no longer

The requirements for each of the four fields in the /etc/group file.

1. Group name: the name assigned to the group. Group names contain up to a Maximum of eight characters.

2. Group-password: usually contains an empty field or an asterisk. This is a relic of Earlier versions of UNIX.

3. GID : Contains the group’s GID number. It is unique on the local system And should be unique across the organization.

4. Username-list: contains a comma-separated list of user names that represent the The user’s secondary group memberships.

Who command

The who command displays a list of users currently logged in to the local system. It displays each user’s login name, the login device (TTY port), the login date and time.

Page 24: new- solaris commands - sekar.doc

If a user is logged in remotely, the who command displays the remote host name, or internet protocol address in the last column of the output.

The finger command displays:

1. The user’s login name2. The home directory path3. The login time4. The login device name5. The date contained in the comment filed of the /etc/passwd file 6. The login shell7. The name of the host, if the user is logged in remotely, and any idle time.

Prstat command

The prstat command examines and displays information about active processes on the system.

Prstat Report

The PID number of the process. The login name or UID of the owner of the process. The total virtual memory size of the process. The resident set size of the process in kilobytes, megabytes, or gigabytes. The state of the process:

Cup -the process is running on the CPU Sleep – the process is waiting for an event to complete. Run – the process is in the run queue. Zombie – the process terminated, and the parent is not waiting. Stop – the process is stopped.

The priority of the process. The value used in priority compaction The cumulative execution time for the process. The percentage of recent CPU time used by the process. The name of the process/ the number of lightweight processes in the process.

Page 25: new- solaris commands - sekar.doc

First five fields in a crontab file:-

The minute field can hold values between 0 and 59. The hour field can hold values between 0 and 23. The day-of –month filed can hold values between 1 and 31. The month field can hold values between 1 and 12, January to December. The day-of-week field can hold values between 0 and 6. Sunday is 0 The command field contains the full path name to the command to be run by the

Cron utility.

S. no Type of backup Advantage Disadvantage1. Full backup Restore is the fastest. Baking up is the slowest.

The storage space requirements are the highest.

2. Incremental backup Backing up is the fastest. The storage space requirements are the lowest.

Restore is the slowest.

3. Differential backup Restore is faster than restoring from incremental backup. Backing up is faster than a full backup. The storage space requirements are lower than for full backup

Restore is slower than restoring from full backup. Backing up is slower than incremental backup.The storage space requirements are higher than for incremental backup.

4. Mirror backup The fastest backup type, especially in conjunction with the “fast mirror” option. It creates a snapshot of selected files and folders in the destination which you can browse and access later

It needs more storage space than any other backup type.Password protection is not possible. Cannot track different versions of files.

Page 26: new- solaris commands - sekar.doc

without needing to run backup4all.

File system backups

To back up file systems, you copy file systems to removable media, such as a tape. You perform backups on a regular basis to prevent loss of data due to:

Accidental deletion of files. Hardware failures. Problems with re-installations or system upgrades. System crashes System break-ins by unauthorized uses, compromising data integrity. Natural disasters.

To set up a backup schedule, determine:-

The file systems to back up. A backup device (for example, tape drive) The number of tapes to use for the backup. The type of backup. The procedures for marking and storing tapes. The time it takes to perform a backup.

When you are restoring data to a system, consider the following questions:

Can the system boot on its own (regular file system restore)? Do you need to boot the system from CD-ROM (critical file system restore)? Do you need to boot the system from CD-ROM and repair the boot drive (special

case recovery)?

To restore files or file systems, determine the following:

The file system backup tapes that are needed. The device name to which you will restore the file system. The name of the temporary directory to which you will restore individual files. The type of backup device to be used (local or remote) The backup device name (local or remote)

Page 27: new- solaris commands - sekar.doc

NFS – Network File System

Nfs is a client-server application that lets users view, store, and update files on a remote computer as though they were on the their own local computer.

The fundamentals of the NFS distributed file system, manage an NFS server and NFS client, nfs server logging, and troubleshoot nfs errors.

Some of the benefits of the NFS:-

Allows multiple computers to use the same files, because all users on the network can access the same data, reduces storage costs by sharing applications on computers instead of allocating local disk space for each user application, provides data consistency and reliability, supports heterogeneous environments, and reduces system administration overhead.

NFS Server Files.

S.No File Description1. /etc/dfs/dfstab Lists the local resources to share at boot time.2. /etc/dfs/sharetab Lists the local resources currently being shared

by the nfs server. Do not edit this file.3. /etc/dfs/fstypes List the default file systems types for remote

file systems.4. /etc/rmtab Lists file systems remotely mounted by nfs

clients. Do not edit this file.5. /etc/nfs/nfslog.conf Lists information defining the location of

configuration logs used for nfs server logging. 6. /etc/default/nfslogd Lists configuration information describing the

behavior of the nfslogd daemon.

Page 28: new- solaris commands - sekar.doc

The /etc/dfs/dfstab File:-

This file contains the commands that share local directories. Each line of the dfstab file consists of a share command.

The /etc/dfs/sharetab file:-

This file stores the results of the share commands. This file contains a table of local resources currently being shared. The following example shows that two nfs resources are shared in read only mode.

The /etc/dfs/fstypes File:-

http://www.vmware.com/download/ws/ws5.html

Jumpstart Procedure

Purpose of the jumpstart procedure

Page 29: new- solaris commands - sekar.doc

System administrators who need to install multiple systems with similar configurations can use the jumpstart procedure to automate the installation process. The jumpstart procedure eliminates the need for operator intervention during the installation process.

The advantages of using the jumpstart procedure include:-

It lets system administrators avoid the lengthy question-and-answer session that is part of the interactive installation process.

It lets system administrations install different types of systems simultaneously.

It allows automatic installation of the Solaris 9 OE and unbundled software.

It simplifies administration tasks when widely used applications must be updated frequently.

Four main services support the software installation process using the jumpstart procedure:

Boot services Identification services Configuration services Installation services

Boot Services

To boot the jumpstart client using the network clients require support from a server that can respond to their reverse address resolution protocol (RARP), Trivial Rile Transfer Protocol (TFTP), and bootparams file requests. A system that provides these services is called a boot server. You can configure a boot server to provide any of the other required jumpstart services, or to only provide boot services.

If other severs provide identification, configuration, and installation services, the boot server identifies those servers for the jumpstart client. To support client RARP requests, the boot server must reside on the same subnet as the client, but the servers that provide these other services can reside on other network segments.

For boot operations to proceed, the following files must be properly configured on the boot server:

Page 30: new- solaris commands - sekar.doc

The /etc/ethers file The /etc/inet/hosts file The /tftpboot file The /etc/inet/inetd.conf file The /etc/bootparams file The /etc/dfs/dfstab file

Identification services

Jumpstart clients require support from a server to automatically get the answers to system identification questions that the client systems issue. The identification service is often provided by any network server configured to provide identification.

Jumpstart clients can obtain identification information from different sources, including the /etc/inet/hosts file on the boot server, the sysidcfg file, and a name service such as network information service (NIS) or (NIS+).

Jumpstart client identification items:

Name service, domain name, host name, IP address, net mask, root password, time zone, date and time.

Configuration services

Jumpstart clients require support from a server to automatically obtain answers for system configuration questions that they issue. A system that provides this service is called a configuration server.

A configuration server provides information that specifies how the Solaris OE installation will proceed on the jumpstart client. Configuration information can include:

Installation type System type Disk partitioning and file system specifications Configuration cluster selection Software package additions or deletions.

On the configuration server, files known as profile files store the configuration Information. A file called rules on the configuration server allows jumpstart clients to select an appropriate profile file.

Associating a configuration with a client

Page 31: new- solaris commands - sekar.doc

A configuration server shares a directory (typically the /export/config directory)That minimally contains the files,

The files in the /export/config directory

The rules files, the profile (class) files, the check script, the rules.ok file, optional begin and finish scripts.

Installation services

Jumpstart clients require support from a server to find an image of the Solaris OE-to install. A system that provides this service is called an install server. An install server shares a Solaris OE image from a CD-ROM, from a DVD, or from a local disk. Jumpstart clients use the NFS service to mount the installation image during the installation process.

Implementing a basic jumpstart server:

A jumpstart server configuration includes:

A single server that provides boot, identification, configuration, and installatin services.

Boot and installation services provided by the Solaris 9 OE boot and installation images spooled to the local disk of the server

Identification services provided by files on the server and a sysidcfg file, with no name service in place.

Configuration services provided by a rules file that contains an entry for a single jumpstart client, and a profile file that installs the entire Solaris 9 OE distribution into a single slice on the jumpstart client.

The following tasks are required to configure a single jumpstart server to provide basic software installation services using the jumpstart procedures:

Spool the operating system image. Edit the sysidcfg file. Edit the rules and profile files. Run the check script. Run the add_install_client scrip. Boot the client.

Page 32: new- solaris commands - sekar.doc

Next: The Program Header Table Up: The ELF File Format Previous: The ELF File Format   The ELF Header The ELF Header is the only section that has a fixed position in the object file. It is always the first section of the file. The other sections are not guaranteed to be in any order or to even be present. The ELF Header describes the type of the object file (relocatable, executable, shared, core), its target architecture, and the version of ELF it is using. The location of the Program Header table, Section Header table, and String table along with associated number and size of entries for each table are also given. Lastly, the ELF Header contains the location of the first executable instruction. The specific fields along with their size requirements that are present in the ELF header are shown in Figure 2.6.

Figure: The Program Header

RE: What are the Different types of backup ?

There are mainly three types of backup.

1. Full backup or Normal backup. This backs ups the entire contents including the systemstate data of the server from where the backup is being run. you have the option to choose this.

After backup is done, the attribute of the backed up file/folder is reset.

2. Incremental backup - This backups up files and folders that have been modified or created after the previous backup. After this backup, the attribute is again reset.

3. Differential backup - This backs up files and folders that have been modified or created after a previous full or incremental backup. The difference here is that the attributes are not

Page 33: new- solaris commands - sekar.doc

reset. Hence every time it backups all the files whose attributes have not been reset or changed.

RE: What are the Different types of backup ?

Normal—Backs up the files you select, and marks the files as backed up.

Incremental—Backs up the files that changed since the last backup, and marks the files as backed up.

Differential—Backs up the files that changed since the last backup, but doesn’t mark the files as backed up.

Copy—Backs up the files you select, but doesn’t mark the files as backed up.

Daily—Backs up the files that changed that day, but doesn’t mark the files as backed up.

 

Full: Full backup means backing up everything.

Incremental: Incremental backup means backing up everything that has changed since last full backup.

Differential: Differential seems to be another name for incremental.

Network: Network backup usually means backing up a client to a backup server, this means the client sends the files to the server and the server

writes them to backup medium.

Dump: Dump backups are not ordinary file by file backups. The whole disk partition or file system is "dumped" to the backup medium as is. This means

it is also necessary to restore the whole partition or file system at one go. The dump backup may be a disk image, which means it must be restored to a

similar disk with same disk geometry and bad blocks in same places.

Page 34: new- solaris commands - sekar.doc

Level 0 -- 9: Level 0 to 9 backups are a finer grained version of incremental backups. Level N backup means backing up everything that has changed

since a same or lower lever backup.

 

Table of Contents Generic API X window Linux Solaris HP-UX Compaq (Digital) Unix AIX SGI Windows

Generic uname get sysinfo from http://www.cise.ufl.edu/depot/software-

solaris.shtml#sysinfo-3.3.1 or ftp://usc.edu/pub/sysinfo/sysinfo.tar.gz

refer to the unix rosetta stone.

API POSIX #include <sys/utsname.h> int uname(struct ustsname *name); Windows: GetVersionEx

Page 35: new- solaris commands - sekar.doc

X window xdpyinfo

Linux /proc/cpuinfo hinv Red Hat Hardware Discovery Program (hwdiag)

Solaris dmesg prtconf psrinfo (in /usr/sbin) arch version (part of Sun Workshop) fpversion (part of Sun Workshop) sysinfo showrev

HP-UX model Use SAM as root:

echo itick_per_tick/D | adb /hp-ux /dev/kmem | tail -n1 \| awk '{print $2 / 10000, "MHZ"}'

cat /opt/langtools/lib/sched.models A simple program that gives you useful information follows (use cc -Ae).

#include <stdio.h> #include <sys/utsname.h> extern int _SYSTEM_ID; extern int _CPU_REVISION; struct utsname uts; int main(void) { uname(&uts); printf("Release = %s\n", uts.release); printf("_SYSTEM_ID = %x\n", _SYSTEM_ID); printf("_CPU_REVISION = %x\n", _CPU_REVISION);

Page 36: new- solaris commands - sekar.doc

}

The uts.release is the release of HP-UX on the system where you run the program. The _SYSTEM_ID is the kind of code the compiler generated. The _CPU_REVISION is the architecture type.

If you compile this program on a PA1.1 system, then run it on a PA2.0 system running HP-UX Release 11.0, you get results like the following:

Release = B.11.00_SYSTEM_ID = 210_CPU_REVISION = 214

The release, 11.00, is easy to decipher. To decode the other results, search the file /usr/include/sys/unistd.h:

$ grep 210 /usr/include/sys/unistd.h# define CPU_PA_RISC1_1 0x210 /* HP PA-RISC1.1 */$ grep 214 /usr/include/sys/unistd.h/# define CPU_PA_RISC2_0 0x214 /* HP PA-RISC2.0 */

The compiler generated PA1.1 code, which is running on a PA2.0 system.

Compaq (Digital) Unix sizer psrinfo (try psrinfo -v) uerf(try uerf -r 300 -R | more) build this code

/* To Make: cc -std1 -O3 -tune programname.c */ #include <stdio.h> #include <errno.h> #include <unistd.h> #include <sys/sysinfo.h> #include <machine/hal_sysinfo.h> int main(int argc, char *argv[]) { int TotalMemory; if (getsysinfo(GSI_PHYSMEM,&TotalMemory,(unsigned long)

(sizeof(int)),0,NULL) !=-1) { TotalMemory += 512; fprintf(stdout,"Total Memory = %d MB\n",TotalMemory/1024);

exit(0); } perror("PHYSMEM"); exit(1);

Page 37: new- solaris commands - sekar.doc

}

AIX lscfg memory: lsattr -E -l sys0 -a realmem memory: lsdev -C -c memory; lsattr -E -lmem0 Use SMIT AIX tools do web search with "Determining CPU Speed" and "AIX"

(you should hit the "Performance Management Guide") build this code

/*----------------------------------------------------------------*/

/* NOTE: this version times a simple integer-intensive loop to */

/* "measure" the clock frequency. This works on power-2, power-pc,*/

/* and power-3 architectures; but the code MUST be compiled with */

/* "cc qcpu.c -o qcpu -lxlf90" without optimization or debugging. */

/* Use of any other compiler flags might give wrong answers for */

/* the apparent clock frequency, and the apparent frequency might */

/* be wrong for other chip architectures. */

/*----------------------------------------------------------------*/

#include <sys/types.h> #include <fcntl.h> #include <sys/systemcfg.h> #include <stdio.h> #include <nlist.h> struct nlist info; double rtc(void); void main() { int fd; int nprocs, imp; int i, isum; int iter, maxiter; double freq, maxfreq; double time1, time2; info.n_name = "_system_configuration";

Page 38: new- solaris commands - sekar.doc

fd = open("/dev/kmem",O_RDONLY); knlist(&info,1,sizeof(struct nlist)); lseek(fd,info.n_value,0); read(fd,&_system_configuration,sizeof(_system_configuration)); nprocs = _system_configuration.ncpus; printf("number of cpus: %d\n", nprocs); imp = _system_configuration.implementation; if (imp == POWER_RS1) printf("processor class: POWER_RS1\n"); else if (imp == POWER_RSC) printf("processor class: POWER_RSC\n"); else if (imp == POWER_RS2) printf("processor class: POWER_RS2\n"); else if (imp == POWER_601) printf("processor class: POWER_601\n"); else if (imp == POWER_603) printf("processor class: POWER_603\n"); else if (imp == POWER_604) printf("processor class: POWER_604\n"); else if (imp == POWER_630) printf("processor class: POWER_630\n"); else printf("processor class: unknown\n"); printf("L1 Inst Cache Size in KB: %d\

n",_system_configuration.icache_size / 1024); printf("L1 Data Cache Size in KB: %d\

n",_system_configuration.dcache_size / 1024); printf("L1 Data Cache Line Sz (B): %d\

n",_system_configuration.dcache_line ); printf("L2 Cache Size in KB: %d\

n",_system_configuration.L2_cache_size / 1024); printf("L2 Cache Associativity : %d\

n",_system_configuration.L2_cache_asc); maxiter = 10; maxfreq = 0.0; for (iter=0; iter<maxiter; iter++) { time1 = rtc(); isum = 0; for (i=0; i<100000; i++) isum += 1; time2 = rtc(); freq = 0.9/(time2-time1); if (freq > maxfreq) maxfreq = freq; } printf("apparent freq = %.1f MHz\n", maxfreq ); }

Page 39: new- solaris commands - sekar.doc

SGI hinv (in /sbin)

Windows msinfo32.exe