Sun Doc Updated as on 24 May 2009

Embed Size (px)

Citation preview

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    1/174

    SUN SOLARIS 10 OSSUN SOLARIS 10 OS

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    2/174

    Sun Solaris 10 Operating System Page 2 of 174

    Acknowledgements

    I can no other answer make, but, thanks, and thanks to my well wisher,evergreen admiring personality Mr. T. Gurubalan, Sun Microsystems Inc,who influenced, crafted, guided, cooked me to taste Sun.

    Words cannot convey my gratitude, you can have no idea how much itmeans to me. Its stunning. Special Thanks to My IMS Batch-2, who fueledme to explore more heights technically.

    Raja, Aravindh, Sathish, Senthil, Hari Krishnan, Murali, Raman, Rakesh,Prabakar, Md.Mukram, Manikandan, Ibrahim.

    Aravindh - induced me to script this valuable document.

    Raja kindle, always inspiring me to go little far on extra miles in allaspects.

    Sources are always precious and unavailable, additional thanks to HariKrishnan on his consistent work of collecting the resource, with great fuss.

    Last but not the least, I would thank all persons behind lights from thebottom of my heart, but for you all my heart has no bottom. Thanks!

    Thanks! Thanks!

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    2

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    3/174

    Sun Solaris 10 Operating System Page 3 of 174Fingered by: Manickam Kamalakkannan

    # 103, Housing UnitRajagopalapuram

    Periyar NagarPudukkottai 62203

    Tamil Nadu

    Mail: [email protected]@gamil.comMobile: + 91-99946 11237

    Topics Include

    1. Basic Unix commands2. Editors vi in detail3. SCSA Part -1

    Exam Code: 300-200

    1. Directory Hierarchy2. File System3. Naming Convention4. Disk Administration5. Performing Mounts & Umounts6. OS Installation7. Package Administration8. Patch Administration9. Boot up & Shutdown procedures10. Performing System Security11. User & Group Administration12. Performing System Monitoring & Scheduling13. Printer Administration14. Performing Backup & Restore

    4. SCSA Part - 2Exam Code: 300-202

    1. Interface configuration2. Clinet-Server model3. SMC - Solaris Management Console4. Swap configuration5. NFS - Network File System6. AutoFs7. Raid - SDS/SVM8. Naming Service9. NIS - Network Information Service10. ACL - Access Control List11. Crash and Core Dumps12. Jumpstart Installation13. System Messaging

    NOT Under IMS but Included in SUNCertification:

    14. RBAC - Role Based Access Control

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    3

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    4/174

    Sun Solaris 10 Operating System Page 4 of 17415. Zone Administration16. Flash Installation

    5. SVM6. VXVM [Partially]

    7. RSC Remote System Console8. Sun Cluster 3.1

    BASIC COMMANDS

    # pwd -> present working directory

    # mkdir -> to create a new directorysyn: # mkdir eg: # mkdir newfolderthis command will create a new directory named 'newfolder'

    syn: # mkdir eg: # mkdir /new/akash

    This command will create a new directory named akash`inside the dir 'new'.

    syn: # mkdir -p eg: # mkdir -p /tenth/eng_medium/half/a_sectionthis command will create a new directory named a_section'inside the new dir /tenth/eng_medium/half'this command will create the parent dir if it is not created earlier.

    cd -> to change from one directory to anothersyn # cdthis command will move to the parent dir

    syn: # cd eg: # cd /tenth/eng_medium/half/a_sectionthis command will move to the location/tenth/eng_medium/half/a_section.Hence if the command # pwd is executedthe output will be/tenth/eng_medium/half/a_section

    syn: # cd .. -> to move to the previous dir

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    4

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    5/174

    Sun Solaris 10 Operating System Page 5 of 174

    ls -> to list the contents of the current directorysyn: # lslists the contents of the directory

    syn: ls -l => long list

    d rwx r-x r-x 3 root root 512 Sep 21 22:31 tenth1 2 3 4 5 6 7 8 9 10WHERE1 -> provides the info about the displayed name is a file or a dirif its 'd' -> its a directoryif its '-' -> its a regular file

    2 => premission on the file/dir for the owner

    3 => permission on the file/dir for the owner's group

    4 => permission on the file/dir for the others

    5 => specifies the link count

    6 => specifies the owner of the file/dir

    7 => specifies the group to which the file/dir belongs

    8 => size of the file/dir

    9 => date and time of creation of the file/dir

    10 => name of the file/dir

    SYN: # ls -lhprovides the size of the file and dir in human readable format

    syn: # ls -pprovides the information about dir or filedir is represented with "/" symbol

    syn: # ls -Rdisplays all the sub-dir and files inside the directory specified

    # ls -R | moredisplays all the sub-dir and files in pagewiseeg: # ls -R /tenth | more]

    will display only the sub-dir and files inside the folder/tenth

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    5

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    6/174

    Sun Solaris 10 Operating System Page 6 of 174syn: # ls -a

    will display all the files and directories including the hidden filesand directories.

    syn: # ls -iwill display the information of inodes

    syn: # ls -twill display the information about the recently accessed file/diron time stamp

    cat => to create, update, view the contents of the file.

    syn: # cat > eg : # cat > maths

    will create a new file named maths`

    syn: # cat > eg: # cat > /tenth/eng-medium/half/a_section/science

    will create a file named `science` in the specified location

    syn: # cat >> will update the contents to the file

    eg: # cat >> maths

    syn: # cat eg: # cat maths

    will display the contents of the file

    syn: # cat -n eg: # cat -n maths

    will display the contents of the file along with the line number

    ctrl+d => to save the contents to the file

    # clear -> to clear the screenctrl+l => to clear the screen

    touch -> to create number of empty filessyn: # touch eg: # touch welcome to the world of unix domain

    will create number of empty files named`welcome, to, the,. world, of unix, domain'respectively

    # datewill display the date and time

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    6

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    7/174

    Sun Solaris 10 Operating System Page 7 of 174

    # cat /etc/release => displays the version of the operating systeminstalled

    Syn: # banner "any word"

    will display the words inside " " as a banner.

    cp => to copy the contents of the one file to anothersyn: # cp

    # cp

    eg: # cp new oldwill copy the contents of the file `new' to `old` filein the current location.

    # cp new /tenth/eng-medium/oldwill copy the file `new` to the specified location.

    NOTE: There is no need for the existance of the destination file earlier.

    syn: # cp -r eg: # cp -r /tenth /ninth

    will copy all the files and dir inside the dir `tenth`to a new dir `ninth`.r => recurssively

    mv => to move/rename the filessyn: # mv

    # mv

    eg: # mv test newfilewill move & rename the file `test` to `newfile` in the current

    location

    Note: Work only with BASH Shell

    # history => displays the commands used in the termina

    # history -c => to clear the commands stored in the history

    alias => to assign alias to the command TEMP.

    syn: # alias =eg: # alias c=clear

    here `c` is assigned to clear command.hence `c` performs the function of clear commandNote: it'll work with BASH shell.

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    7

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    8/174

    Sun Solaris 10 Operating System Page 8 of 174both `c` and `clear` command will work.

    head => to view the top `n` number of lines from a filesyn: # head -n

    where `n` can be any number

    eg: # head -5 newfilewill display the first 5 lines from the file `newfile`.

    tail => to view the last few number of lines from a filesyn: # tail -n eg: # tail -5 newfile

    will display the last 5 lines from the file specified

    less => to view the contents of the file in page-wisesyn: # less eg: # less /etc/passwd

    will display the content of the file in page-wise

    more => similar to less with more optionssyn: # more # more /etc/passwdwill display the contents of the file in page-wise

    rm => to remove the filesyn: # rm eg: # rm test

    will remove the file named test

    syn: # rm -r eg: # rm -r /newfolder

    will remove the dir named `newfolder` along with its contents

    syn: # rm -i eg: # rm -i test

    will delte the file interactively. It'll prompt for a question.

    rmdir => to remove the dirsyn: # rmdir eg: # rmdir /newfolder

    will delete the dir 'newfolder' when its empty.

    hostname => to view to hostname of the systemsyn: # hostname

    will display the host name

    domainname => to view the domain namesyn: # domainname

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    8

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    9/174

    Sun Solaris 10 Operating System Page 9 of 174will display the domain name

    bc => binary calculatorsyn: # bc

    ctrl+z => to send the process to background

    bg => to view the process running at the backgroundsyn: # bg

    fg => to bring back the command from background to fore groundsyn: # fg n

    where n -> is the number of the processeg: # fg 1

    which => provides the information about the location of the command

    syn: # which eg: # which ls

    arch => to identify the arch of the systemsyn: # arch

    wc => word countsyn: # wc eg: # wc test

    will display the number of lines, charactes and words in the filespecified# wc -l testwill display only the number of lines#wc -w testwill display only the number of words# wc -c testwill display only the number of characters

    listusers => will display the number of users existing in the systemsyn: # listusers

    # listusers -g eg: # listusers -g others

    will display the users who belongs to the group named others

    man => provides the help manual for each commandsyn: # man eg: # man ls

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    9

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    10/174

    Sun Solaris 10 Operating System Page 10 of 174will display the help manual for the specified command

    syn: # man -d eg: # man -d ls

    will display the method of searching the manual pages alongwith its path

    syn: # man l eg: # man l catwill lists all manual pages found matching name within the search

    path.

    grep => used to search the keywords in the filesyn: # grep eg: # grep good test

    will display the whole line that contains "good" from the specifiedfile "test"

    syn: # grep -i eg: # grep -i good test

    same as above, but ingnoring the case (upper or lower)

    syn: # grep -v eg: # grep -v good testwill leave the specified keyword "good" and display the rest.in nutshell, just reverse of grep.

    syn: # grep -h eg: # grep -h good test1 test2 test3 test4

    will search the keyword "good" from the multiple files anddisplays the same.

    wall => to broadcast the message to all the users who are currentlylogged in

    syn: # wall < message>

    ctrl+d -> to save and send the messageeg: # wall

    hai! good morningctrl+d

    write => to send the message to the particular user who is currentlylogged insyn: # write "

    ctrl+d

    eg: # write "shiva"welcome to our org!ctrl+dwill display the message only the specified user.

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    10

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    11/174

    Sun Solaris 10 Operating System Page 11 of 174

    TOD/etc/motd => message of the day

    This file contents will be broadcasted to all the users whenever they loginto the system.

    /etc/issue => by default this file will not exist. Root is permitted to create afile in this name. Can edit anything to this file. When the user is promptedfor login the message typed in the above fie [/etc/issue] will be displayed.

    The difference between /etc/motd and /etc/issue is, the contents of the/etc/motd file will be displayed after the user is logged in. Where is in/etc/issue, the contents of the file are displayed before the user is loggedin.

    # compress => to compress the filesyn: # compress

    eg: # compress testwill compress the specified file 'test'

    # uncompress => to uncompress the filesyn: # uncompress eg: # uncompress test.Z

    will uncompress the file specified

    Note:It's not possible to read the contents of the compressed fileUsing the command "cat"

    # zcat => used to view the contents of the compressed fileWithout uncompressing it.

    syn: # zcat eg: # zcat test.Z

    will display the contents of the compressed file

    # gzip => to compress the filesyn: # gzip eg: # gzip test

    will compress the file test with the extension .gz

    # gzcat => to view the contents of the compressed file with extension .gzsyn: # gzcat eg: # gzcat test.gz

    # gunzip => to uncompress the compressed file with extension .gzsyn: # gunzip eg: # gunzip test.gz

    will uncompress the specified file

    # cal => to display the calender

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    11

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    12/174

    Sun Solaris 10 Operating System Page 12 of 174syn: # cal

    will display the current month of the current year

    syn: # cal eg: # cal 2008

    will display the whole 2008

    syn: # cal eg: # cal 9 2008

    will display only the specified month from the specified year

    # uname -awill provide number of informationswhich includes

    1. os installed2. os version3. hostname4. arch

    # uname -Xwill display the following information.eg output is displayed.

    System = SunOSNode = sys1Release = 5.10KernelID = Generic_118855-33Machine = i86pcBusType = Serial = Users = OEM# = 0Origin# = 1NumCPU = 2

    # findthis command is used to search the file

    # find / -name passwdwill search for the search word `passwd` in the location / (root)

    # find /etc -name passwdwill search for the key word passwd only the /etc location.

    # whereis passwdwill display the location of the file/command

    # prtconf | grep -i mem

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    12

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    13/174

    Sun Solaris 10 Operating System Page 13 of 174will display the total memory (physical) allocated to the system

    # psrinfoprovide the infomation about the staus & the number of processorsattached to the systemeg output:

    0 on-line since 11/28/2008 08:21:251 on-line since 11/28/2008 08:21:35

    WITH BASH SHELL:

    ctrl+l => to clear the screenctrl+e => to move the cursor to the end of the commandctrl+a => to move the cursor to the begining of the command

    ctrl+b => to move the cursor to the begining of the word in the commandcrtl+c => to terminate the processcrtl+z => to send the process to the backgroundctrl+p => to bring back the previous commandctrl+d => to save the content to the filectrl+r => to search for the commands from the history

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    13

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    14/174

    Sun Solaris 10 Operating System Page 14 of 174

    EDITORS

    1. vi2. pico3. vim4. emac

    VI EDITOR COMMAND

    # vi to create a new file

    # vi to open a file

    esc+i => to insert the characters to the fileesc+A => to bring the cursor the end of the line and add the contents tothe

    fileesc+x => to delete a single characateresc+dd => to delete a complete lineesc+dw => to delete a wordesc+o => to create an empty line just below the cursoresc+O => to create an empty line just above the cursoresc+G => to bring the cursor the end of the fileesc:n => to move the cursor to the n-th linefor eg: esc:10 => will move the cursor to the 10-th lineesc:set nu => to set line numberesc:set nonu => to remove the line numberesc/ => to search the keywordesc:n,mdwhere n and m are the number of linesfor eg: esc:5,10dwill delete the lines from 5 to 10.esc+u => undo operation

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    14

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    15/174

    Sun Solaris 10 Operating System Page 15 of 174

    esc:w => to write/save the content to the file and move the cursor to theoriginal position

    esc:q => to quit the file without savingesc:wq => to write/save and quit from the fileesc:wq! => to write/save & quit from the file forcefully

    esc+R => to replace the charactersesc+yy => to copy the lineesc+p => to paste the lineesc+J => to join the line

    esc+l => to move the cursor by right side.

    esc+j => to move the cursor downward by single lineesc+k=> to move the cursor upward by one lineesc+h => to move the cursor left side by single character

    esc+$ => to bring the cursor to the end of the line

    esc+I => to bring the cursor to the begining of the line

    # vi -R to open the file with read only

    # vi -x to assign the password for the file.

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    15

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    16/174

    Sun Solaris 10 Operating System Page 16 of 174

    DISK ADMINISTRATION

    Permitted Tag names for the slices:1. boot2. root3. backup4. alternates5. unassigned6. stand7. home8. reserved9. swap10. usr11. var

    Re-labeling a disk:

    1. VTOC on the disk has been destroyed.2. Accidentally changed the partition information on the disk an did not

    save a backup label in the /etc/format.dat

    # prtvtoc /dev/[r]dsk/c0t0d0s0 > /var/tmp/v1t0d0.vtoc

    # fmthard s /var/tmp/c1t0d0.vtoc /dev/rdsk/c1t0d0s2# fmthard s /dev/null /dev/rdsk/c1t0d0s2

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    16

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    17/174

    Sun Solaris 10 Operating System Page 17 of 174To initialize the VTOC of a disk

    NOTE:1. # fmthard command cannot write a disk label on a unlabeled disk.

    Use # format utility for this purpose.2. When using the # format utility to change the size of the disk sliceis automatically designated that expands & shrinks to accommodatethe slice resizing operations. This temporary slice is referred to asthe free hog and it represents the unused disk space on a diskdrive.

    FREEE HOG:When using the format utility and change the size of the disk slices, atemporary slice is automatically designate that expands & shrinks toaccommodate the slice resizing operations. This temperory slice is referedto as the free hog & it represents the unused disk space on a disk drive

    NOTE:

    1. To operating system a file system appears as a collection of files &directories used to store & organise data for access by the system and itsusers.

    2. To operating system, a file is a collection of control structures and datablocks that occupy the space defined by a partition, which allow for datastorage & management.

    # modinfo -c | grep -w dad

    -c displays the number of the instances that is installed

    -w will search the key word between < >.

    -> provides the information, whether the drivers files are installed.-> provides information, to verify the device driver is available as a kernelmodule

    NOTE:1. The ufs file system does not allow fragment of the same file to to bestored in two different data blocks.

    2. When the state flag is "clean, stable, logging" file system scans are notrun

    # newfs -N

    # newfs -m 2 /dev/rdsk/c0t3d0s5

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    17

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    18/174

    Sun Solaris 10 Operating System Page 18 of 174will create a file system with the minfree value 2%. By default 10%

    1. The fist line printed by the newfs command describes the basic diskgeomerty.

    2. 2nd line describes the 'ufs' file system created in this slice.

    3. 3rd & remaining line list the beginning sector locations of the backupsuper blocks.

    FSCK:

    SUPER BLOCK CONSISTENCY:Super block is checked for inconsistencies involving the followingparameter 1. file system size 2. free block count3. free inode count

    CYLINDER GROUP BLOCK CONSISTENCY:Checks, unallocated data blocks claimed by inodes, the unallocated datablock count, and unallocated inode count.

    INODE CONSISTENCY:Checks1. for the allocation state of inodes2. Type3. Link count4. Duplicate blocks5. Bad blocks6. inode size7. Block count for each inode8. Any unreferenced inode with non-zero link count is linked to the filesystem's lost+found

    DATA BLOCK CONSISTENCY:1. fsck cannot check ordinary data blocks but it can check directory datablocks.2. In ordinary data blocks, the fsck command check for inodes that pointsto unallocated blocks tagged as in use, allocated blocks tagged as free.

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    18

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    19/174

    Sun Solaris 10 Operating System Page 19 of 174

    Left blank knowingly

    FILE SYSTEM / DIRECTORY HIERARCHY

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    19

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    20/174

    Sun Solaris 10 Operating System Page 20 of 174Directory Structure

    / - root's home directory/dev - provides the information of logical devices

    /dev/dsk - provides all the possibilites of the sliceswith its file system.

    Purely dependent of hardware/dev/rdsk - provides all the possibilities of theraw disk slicesdependent on hardware

    NOTE:Informations available on /dev/dsk and /dev/rdsk remains same.

    /devices - provides the information about, the location to which thehardware devices are connected to.

    /usr - Unix System Resources/usr/bin - will have the binary executables.

    cannot be read by the root user.the resources under this directory can beused by both root user and non-root user

    /usr/sbin - will have binary executables that canbe exectuted only by the root usermostly system related administration taskcommands will be resided to this directory

    /etc - holds all the configuration related with system and itsservices

    /var - provides all the logs related with the system

    /opt - optional directory, where 3rd party applications canbe installed

    /mnt - is a optional directory, where the devices can bemounted

    /proc - process directoryprocess id for every process will be generated

    /export/home - is the location of non-root user's homedirectroy. Normally at the time of creating auser account that newly created user will havehis home directory under this location.

    for eg: /export/home/shiva/export/home/hari

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    20

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    21/174

    Sun Solaris 10 Operating System Page 21 of 174

    Inodes:1. Every file and directory will be assigned by a unique number by theoperating system.

    2. Inode wil store the information about the files and directories.3. It holds the information like, the permissionship of the owner of the file,permissionship of the file to a group, other permissionship, when it ismodified.4. It'll also have pointers which will point to the data.

    Link file:2 types of linksa. hard linkb. soft link or symbolic link

    Hard link:1. when hard link is created, the link count is increased.2. Inode number remians same for the source file and the destination file3. If the source file is deleted, still datas from the destionation file can beaccessed.4. The souce file permissionship is inherited to the destination files.5. Both the source and destination file will show the same size. But thedestination files will NOT occupy the disk space

    Soft link / symbolic link:1. inode number for the destination and source file will be different2. if the source is deleted, the datas from the destination file is not viewed.3. The permissionship of the source file and the destination file will bedifferent.4. it will have a pointer at the end to indicate the souce file5. it will be indicated with the "l".

    To create a hard link:# ln # ln one /Desktop/ims/hlinkhereone = source file name/Desktop/ims = is the location of the hard linked filehlink = is the hard linked file name

    To create a soft/symbolic link:# ln -s # ln -s one /Desktop/ims/soft_haihereone = source file name/Desktop/ims = is the location of the soft linked filesoft_hai = is the soft linked file name

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    21

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    22/174

    Sun Solaris 10 Operating System Page 22 of 174Naming conventions:

    3 Naming conventions1. Logical name2. Physical name3. Instance name

    Logical Name:c# t# d# s#c = specifies the controllert = specifies the targetd = specifies the disks = specifies the slice

    can be seen at /dev/dsk and /dev/rdsk

    Instance Name:1. Generated by the kernel for each devices connected to the system

    # prtconfwill display the what are the devices attached to the system and all thepossibilites of connecting the devices

    # prtconf | grep -v notwill display only the devices that are attached to the system

    # cat /etc/path_to_inst1. not recommended to edit2. will display the information about physical location where the devicesare connected to and their corresponding instancename

    # formatcommand displays the number of hardisks attached to the system alongwith its physical and instance name

    1. format is a utility2. It has two tiresa. format>b. partition>3. ctrl+c - to exit from the format utility4. can be executed only by the root user

    format> helpwill provide the information about what are the commands that can beused in format> tire.

    format> fdisk

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    22

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    23/174

    Sun Solaris 10 Operating System Page 23 of 174is used to delete, view the windows partition informations throughSolaris OS.

    format> partitionwill move the next tire partition>

    partition> helpwill provide the information about what are the commands that can beused in the partition> tire

    partition> printwill print the disk layout which provides number of information about theslices

    part - specifies the number of slices

    NOTE:x86 arch - will have 9 slicessparc arch - will have 7 slices

    Tag nameIs the name given to the sliceOnly selected names can be assigned to the slicePermitted tag names: root, backup, alternates, reserved, usr,stand, boot, home, swap, var, unassigned

    1. Tag names can be repeated2. Slices can be created in any sequence3. While creating the slices, make sure about the starting cylinders.Avoid wastage of cylindersAvoid overlapping of cylinders

    Flag:States the status of the slices

    Cylinders:Specifies the starting and ending cylinders of a particular slice

    partition> lableto lable or to make OS to recognize the changes done with the partition

    NOTE:partition> lablewill only make the OS to recognize the change done and it will not bestored in any file.

    format> savewill save the changes done to a fileby default: format.datIt can also be stored in any location with any file name

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    23

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    24/174

    Sun Solaris 10 Operating System Page 24 of 174

    partition>nameis used to name the partition tablemax 8 characters is supported

    NOTE:# newfs /dev/rdsk/c0d1s4to create a file system for the slice c0d1s4

    # mkdir /slice4# mount /dev/dsk/c0d1s4 /slice4used to mount the slice slice4 under the location /slice4# cd /slice4# touch one two threeto access, to write some datas to the slice4

    NOTE:

    Mounted slices cannot be deleted.Only after unmounting the slices it can be deleted.

    # cd# umount /dev/dsk/c0d1s4to unmount the mounted slice

    format> verifyto view the partition table, slices information

    # newfswill create a new file system

    # newfs /dev/rdsk/c0d1s6will prompt for confirmationthen it creates a ufs file systemit also displays the number of primary super backup blockswhich can be used by the # fsck command

    # newfs -N /dev/rdsk/c0d1s6will NOT create the file system butwill only display the number of primary super backup blocks (only if theparticular slice is having the file system)

    # newfs -T /dev/rdsk/c0d1s6will create a file system that can hold a file size in tera bytes.

    NOTE:1. When # newfs command is executed, the command reads the entry ofthe file /etc/default/fs and accordingly the file system is created.

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    24

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    25/174

    Sun Solaris 10 Operating System Page 25 of 174

    2. By default the entry of the file /etc/default/fsLOCAL=ufs

    and hence # newfs command will create only ufs file system.

    # fstypwill dispaly number of informations about the particular slice

    # fstyp -v /dev/dsk/c0d1s6 | grep -i minwill display the minimum free space for the praticular slice, slice6

    Note:1. The default minfree value for every slice is 1% of its own size.

    2. The minfree value can either be increased nor be decreased.But the minimum will be 1%

    # tunefs -m 10 /dev/dsk/c0d1s6this command will increase the minfree value to 10% for the slice, slice6

    # tunefs -m 1 /dev/dsk/c0d1s6will decrease the minfree value to 1% for the slice, slice 6

    # prtvtocwill print the volume table of contents

    # prtvtoc /dev/dsk/c0d1s0Here, the output of a particular hard disk drive with different slice remainssame.for eg:

    # prtvtoc /dev/dsk/c0d1s6 -> output will be same as# prtvtoc /dev/dsk/c0d1s4

    This above command will display the informations about the slice layout,where it is mounted, flag state, hard disk drive geometry.

    Note:If we have more than one hard disk drive with the SAME geometry and ifwe require same layout in all the hard disk drive, then VTOC of one disk canbe copied to another using a command # fmthard

    # fsck - File System ChecK

    # df# df -hwill provid the information about1. what are the slices mounted

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    25

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    26/174

    Sun Solaris 10 Operating System Page 26 of 1742. what is the total size of the each slices3. how much of space is used in each slcies4. how much of free space is available in each slcies5. where it is mounted6. how much of % of space is used in each slices

    Note:Solaris 8 supports# df -bk

    Solaris 9 and Solaris 10 supports# dfand its options# df -h

    # duwill display the how much of the disk space is used

    # du -hwill display how much of the disk space is used in human readable format

    NOTE:# man ls > list# du -h > disk_usethe above commands will not display the output, instead,the output is redirected to a file named list and disk_use respectively.Hence we can open the files list and disk_use to the see the output of thecommands.

    VTOC:Resides in Track0, Sector0It occupies 512 bytes of spaceholds the information about the hard disk layout, geometry

    Bootblock:Resides in next 15 sectors next to vtoctrack0Sector 1 to sector 15Will be active in the root hard disk drive

    Primary super block:Will reside next to boot blocktrack0Sector 16 to sector 31

    Primary backup super block:

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    26

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    27/174

    Sun Solaris 10 Operating System Page 27 of 174track0Sector 32Apart from sector32, backup will be available in some other blocks forevery slice. it can be seen by executing the command# newfs -N /dev/rdsk/c0d1s6

    Data block:1. Size of each data block is 8kb2. Data block is further divided into 8 fragments3. Size of the each fragment is 1 kb4. a data block can be used only by a single file.

    Data blocks cannot be shared by any files5. Data block is the area where the user (both root and non-root) is givenright to store the data.

    Inode:Will provide the following information1. Ownership permissions2. Group permissions

    3. Other permissions4. When the file/dir was modified5. Pointers

    2 types of pointersa. Direct pointerb. Indirect pointer

    3 types of indirect pointeri. single indirect pointerii. double indirect pointeriii. triple indirect pointer

    6. a file will have 12 direct pointersa single direct pointer can refer 8kb of datas

    so 12*8 = 96kb of datas can be refered by a direct pointer.

    7. If the file size is more than that,a single indrect pointer will appear and it can point out2048 additional direct pointer2048 * 8 = 16 Mb

    8. If the file is more that 16 Mba double indirect pointer will appear and it can refer2048 additional singel indirect pointer2048 * 16 mb = 32 Gb

    9. If the file size is more than that, triple indirect will appear and it can refer2048 additional double indirect pointer2048 * 32 = 64 Tb

    In short

    8kb = 1 data block1 data block = 1 direct pointer

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    27

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    28/174

    Sun Solaris 10 Operating System Page 28 of 1742048 * 8 kb = 16 mb (single indirect pointer=2048 direct

    pointers)

    2048 * 16 mb = 32 Gb ( double indirect pointer= 2048 singleindirect pointers)

    2048 * 32 Gb = 64 Tb ( triple indirect pointer=2048 doubleindirect pointers)

    File system1. Disk Based File system2. Distributed file system3. Pseudo file system

    Disk based file system:ufs - unix file systemfor slices.

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    28

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    29/174

    Sun Solaris 10 Operating System Page 29 of 174default file system for sun solaris

    hsfs - high sierra file systemused for optical media

    udfs - universal disk file system

    pcfs - personal computer file system

    Distributed file system:NFS - Network file systemused to share the resources

    Pseudo file system

    mntfs - mount file system. Used by /mnt dirtmpfs - temporary file system. Used by /tmp dir

    procfs - process file system. Used by /proc dir

    These directories will be unmounted automatically when the system goesdown.

    /system/object1. uses objfs2. object file system3. This file system is used by the kernel to store details relating to the

    modules currently loaded by the kernel.

    devfs1. used by /devices directory2. Used to manage name space of all devices on the system.

    ctfs1. used by /system/contract directory2. used by SMF to track the processes which compose a service, so

    that a failure in a past of a multi-process service can be identified asa failure of that service.

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    29

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    30/174

    Sun Solaris 10 Operating System Page 30 of 174PERFORMING MOUNTS AND UNMOUNTS

    # mount =>1. will display the informations about the permanently mounted andtemp mounted slices and other removable media.2. can be used only by the root user

    # mount -F -o this command will mount the specified slices or the media.eg: # mount /dev/dsk/c2d0s3 /mnt/slice3NOTE:Since the sliece uses only the UFS file system it's not necessary tospecify the file system while mounting.PLS REF the SLIDES for default options.

    eg: # mount -F hsfs /dev/c0t0d0s0 /mnt/cdromused to mount the cdrom

    eg: # mount -F pcfs /dev/c4t0d0p0 /mnt/pendriveused to mount the pen drive

    /etc/vold.conf=> volume management configuration file which holds theactions to be performed.vold => is the daemon which will be running at the background while thevolume management process is started./etc/rmmount.conf=> is the configuration file for the removable media

    # iostat -Enwill provide us the information about the removable media where it isconnected, for eg: ,to which controller, target and so on.

    # df -h => will provide what are the slices and the medias that aremounted

    # /etc/init.d/volmgt start => will start the volume management process# /etc/init.d/volmgt stop => will stop the volume management process

    # fuser -cu eg: # fuser -cu /mnt/cdrom

    will provide the information about the users using the mount slice ormedia, along with the process

    # fuser -ck eg: # fuser -ck /mnt/cdrom

    will forcefully kill the process that is run by the user.

    # umount eg: # umount /mnt/cdrom

    # umount

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    30

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    31/174

    Sun Solaris 10 Operating System Page 31 of 174eg: # umount /dev/dsk/c0t0d0s0will umount the devices.

    # mountall => will mount all the slices which is having the option "yes"at "mount at boot" in the file /etc/vfstab#umoutall => reverse of mountall

    /etc/mnttab:1. cannot be editable2. will hold all the entries of the slices & media mounted3. reffered by the #mount command

    /etc/vfstab1. Holds the permanent mounted slice information2. editable by the root user

    NOTE:/etc/vfstab

    0 UFS file system are not checked. However, non-UFS file system arechecked

    - - Not checked1 Checked one at a time in the order they appear in the /etc/vfstab file.

    /, /usr, /var SMF mounts the file systems as specified under/lib/svc/method directory beginning with fs.

    To determine the file system:

    1. # mount2. # cat /etc/vfstab3. # cat /etc/default/fs4. # cat /etc/dfs/dfstypes5. # fstyp /dev/rdsk/c0t0d0s7

    Volume Management [VOLD] features automatic detection of CD-ROM.However, it does not detect the presence of diskette that has been insertedin the drive until volcheckcommand is run. This command instructs thevold daemon to check the diskette drive for any inserted media. VolumeManagement can mount ufs, pcfs, hsfs & udfs file system.

    /etc/rmmount.conf -> removable media

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    31

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    32/174

    Sun Solaris 10 Operating System Page 32 of 174

    PACKAGE ADMINISTRATRION

    Package is a collection of executable files and directories.Collection of packages is termed as package cluster.

    # pkgadd => to add the packages# pkgadd -d .

    eg: # pkgadd -d /mnt/cdrom/Solaris_10/Product . SUNWbashwhere-d -> specifies the format of the package as data stream

    or

    move to the location of the dir where the packages resides and startinstalling.# cd /mnt/cdrom/Solaris_10/Product# ls

    # pkgadd -d . SUNWbash

    To copy the packages to the spool dirby default its /var/spool/pkg# pkgadd -d /mnt/cdrom/Solaris_10/Prosuct -s spool SUNWbashthis above command will copy the package to the dir spooland hence we can install the package without the cdrom.

    NOTE:All the installed packges informations are stored to the file/var/sadm/install/contentsAll the installed packages will be in /var/sadm/pkg

    # pkgrm => used to remove the package# pkgrm eg: # pkgrm SUNWbashwill remove the specified package from the systemNOTE:catageroies of the packages* system* ALE - Alternate Language Environment* Application* CTL - Common Text Layout

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    32

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    33/174

    Sun Solaris 10 Operating System Page 33 of 174

    # pkginfo => to gather the information on the packages installed.# pkginfo => displays all the list of the packages installed to the system# pkginfo -l eg: # pkginfo -l SUNWbashwill provide the detailed information about the installed package

    # pkginfo | wc -lwill provide the number of packages installed in the system

    # pkgchk=> to check the installed packages# pkgchk -l -p eg: pkgchk -l -l /usr/sbin/useraddwill provide the information about what is the package that is associatedwith the command.

    # pkgchk -p /etc/shadow

    will provide the info when the file is recently updated from its installation.

    # pkgtrans s /mnt/cdrom/Solaris_10/Product /test SUNWbashSUNWmanHere

    pkgtrans => is a command to translate the packages into a file with datastream

    format-s => specifies the source of the packages where its available.[cdrom ismounted under /mnt/cdrom and the packages is available accordingly].

    test => can be any file name to store or to translate the packages underany location

    SUNWman and SUNWbash are the packages combined as a single filetest.

    # file /testShows the format of the file.

    As usual install the package using the command # pkgadd

    Eg:# pkgadd /test

    Note:No . is used to install the translated package.

    # pkginfo pDisplays the partially installed packages

    We can confirm it by executing the following command, by specifying thepackage name.

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    33

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    34/174

    Sun Solaris 10 Operating System Page 34 of 174For eg.,

    # pkginfo l SUNWman

    INSTALLATION OF SUN SOLARIS 10 OPERATING SYSTEM SOFTWARE

    a. Reduced Networking Support Software Group SUNWCrnetb. Core System Support Software Group SUNWCreqc. End User Solaris Software Group SUNWCuserd. Developer Solaris Software Group SUNWCproge. Entire Solaris Software Group SUNWCallf. Entire Solaris Software Group with OEM - SUNWCXall

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    34

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    35/174

    Sun Solaris 10 Operating System Page 35 of 174

    OK prompt / OBP OpenBoot PROM / Boot PROM Monitor Mode /init 0

    Ok nvramrcNVRAMRC contents are displayed

    Ok oem-logo?If true, displays customized oem logo specified by oem-logo

    ok boot net installJumpstart boot. Boot off the network jumpstart server and install/upgradethe operating system. [NOTE: There is a space both before and after the -.

    The serves as a place holder argument for the command.]

    Ok boot aAsk me. Interactive mode prompts for the names of the boot files.[Helpful if you need to boot off an alternate /etc/system file after kernelunable modifications.]

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    35

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    36/174

    Sun Solaris 10 Operating System Page 36 of 174Ok boot rReconfigure boot. Boot and search for all attached devices, then builddevice entries for anything which does not already exist. Useful when newdevices are added to the system.

    Ok boot s

    Single user. Boots the system to run level 1.

    Ok boot vVerbose boot. Show good debugging information.

    Ok boot VVerbose boot. Show a little debugging information.

    Ok .enet-addrDisplays the enternet address

    Ok .version

    Display version and date of the boot PROM(pritconf V in a shell when booted)

    Ok .speedDisplay processor and bus speeds

    Ok .envOn severs, this command is used to obtain status information about thesystems power supplies, fans, and temperature sensors.

    The environmental monitoring sub-system monitors for high temperatureconditions, as well as fan and power-supply failure conditions. The actionsperformed by the monitor are controlled by the setting of the variable env-monitor. The available options for setting up the environmental monitorare:

    1. enabled - Environmental monitor will monitor the system andtake appropriate actions including shutting down the system in the event ofan error condition.

    2. disabled - environmental monitor is disabled

    3. advise - environmental monitor will perform routinge checksand will only report failures.

    Use setenv env-monitor to change the current mode

    Ok .idpromDisplays ID PROM contents

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    36

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    37/174

    Sun Solaris 10 Operating System Page 37 of 174Ok syncCall the operating system to write information to hard disk drive

    Ok firmware-versionDisplays major/minor CPU firmware

    Ok resetReset entire system [similar to performing a power cycle]

    Ok reset-allReset entire system [similar t performing a power cycle]

    Ok set-defaultsReset all the PROM settings to the factory settings

    Ok ejectEjects the drive

    Ok eject cdrom

    Ok test deviceTest the specified device

    Ok test netTest the primary network controller

    Ok test-allTest all devices available with the self-test capability

    Ok test scsiTest the primary SCSI controller

    Ok watch-netMonitors network broadcast packets for default interace. for a good packetX for a bad packet

    Ok watch-net-allMonitors network broadcast packets for all the interfaces

    ObdiagInvokes an optional interactive menu tool which lists all self-test methodsavailable on a system; provides commands to run self test. (More forservers and very machine specific. Reference the specific hardware manualfor the machine to get additional information on running obdiag.

    Ok nveditEnter the NVRAMRC editor. If data remains in the temporary buffer from aprevious nvedit session, resume editing those previous contents. IF not,read the contents of NVRAMC into the temporary and begin editing it.

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    37

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    38/174

    Sun Solaris 10 Operating System Page 38 of 174

    NVRAMRC [nvedit] Editor Commands:

    Control-b = Moves backward one character.Escape b = Moves backward one word.Control-f = Moves forward one character.

    Escape f = Moves forward one word.Control-a = Moves backward to beginning of line.Control-e = Moves forward to the end of the line.Control-n = Moves to the next line of the script edit buffer.Control-p = Moves to the previous line of the script edit buffer.Return (Enter) = Inserts a new line at the cursor position and advancesto the

    next line.Control-o = Inserts a new line at the cursor position and stays onthe

    current line.Control-k = Erases from the cursor position to the end of the line,storing

    the erased characters in a save buffer. If at the end ofthe linejoins t he next line to the current.

    Delete = Erases the previous character.Backspace = Erases the previous character.Control-h = Erases the previous character.Escape h = Erases from beginning of word to just before thecursor,

    storing erased characters in the save buffer.Control-w = Erases from beginning of word to just before thecursor,

    storing erased characters in a save buffer.Control-d = Erases the next character.Escape d = Erases from the cursor to the end of the word, storingthe

    erased characters in a save buffer.Control-u = Erases the entire line, storing the erased characters in

    asave buffer.

    Control-y = Inserts the contents of the save buffer before thecursor.Control-q = Quotes the next character (allows you to insertcontrol chars)Control-r = Retypes the line.Control-l = Displays the entire contents of the editing buffer.Control-c = Exits the script editor, returning to the OpenBootcommand

    interpreter. The temporary buffer is preserved, but isnot

    written back to the script. (Use nvstore to write itback.)

    Ok show-devsDisplay list of installed and probed devices

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    38

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    39/174

    Sun Solaris 10 Operating System Page 39 of 174

    Ok show-pci-devsDisplay all PCI devices

    Ok show-disksDisplay a list of known disks in format for use in creating device alias.

    Use-nvramrc? By default its falseIf true, execute commands in NVRAMRC during system start-up.

    Command hold down the keys/keys during the power-on sequence:1. Stop Bypasses POST2. Stop-A Abort

    3. Stop-D Enter detailed diagnostic mode4. Stop-N Reset NVRAM content to default values5. Stop-F Enter forth on TTYA instead of probing [use fxeditto continuewith the

    Initialization phase].

    Setting Security Variables:Not recommended to do practice or implement.

    The NVRAM security variables control the set of operations users areallowed to perform from the OpenBoot PROM user interface and can be setwith the following:

    OK setenv security-passwordpassword

    Sets the PROM security password to what is specified in the password filed.This password must be between zero and eight characters [any charactersafter eight are ignored] and the passwords takes effect immediately noreset is required. Once set, if we enter an incorrect password there is adelay of around 10 seconds, before we are able to try again and thesecurity-#badlogins counter is incremented. The password is nevershown as we type it or with the printenv.

    OK printenv security-mode

    Displays the current mode for the PROM security

    OK setenv security-mode mode

    Where mode can be1. none

    a. No password is requiredb. Default

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    39

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    40/174

    Sun Solaris 10 Operating System Page 40 of 174

    2. commanda. All commands expect for boot and go require password

    3. fulla. All commands expect for go require the password

    Caution:We must set our security password before setting the

    security mode. [The password is blank by default, but if already

    set by someone, we wont know what it is and will not be able todisable it] If we forgot the security password, we may not beable to use our system and must call the vendor for areplacement of a PROM.

    Ok printenv security-#badlogins

    Display the number of failed security password attempts

    Ok setenv security-#badlogins number

    Reset the security-#badlogins counter. This counter keeps trackof the nuber of failed security password attempts.

    Changing the power-on banner:The banner information seen from the power-on can be modifiedwith the oem-banner and oem-banner? Configuration settings.By default the banner shows information like processor type,speed, PROM revision, memory, hosted and the Ethernetaddress.

    Ok bannerDisplay the power-on banner

    Ok setenv oem-banner stringSet the power-on banner to the string

    Ok setenv oem-banner? TrueActivate the custom banner

    Ok setenv oem-banner? FalseRestore the original system power-on banner

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    40

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    41/174

    Sun Solaris 10 Operating System Page 41 of 174

    BOOTUP & SHUTDOWN PROCEDURES

    Note:1. The bootblk program is placed on the disk

    drive by the installboot command duringsystem installation.

    2. Boot program phase:a. UFS boot program locates & loads the

    appropriate 2-part kernel.b. [i] genunix Is platform independent

    generic kernel file[ii] unix platform specific kernel file

    3. When ufsboot loads these 2 files into memory,they are combined to form the running kernel.

    4. Solaris 10 for SPARC only runs on 64-bitsystems

    5. The /etc/init file is a symbolic link to /sbin/init

    Note:# bootadm - manage bootability of GRUB-enabled operatingsystem

    # bootadm list-menuThe location for the active GRUB menu is: /boot/grub/menu.lstdefault 0timeout 100 Solaris 10 11/06 s10x_u3wos_10 X861 Solaris failsafe

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    41

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    42/174

    Sun Solaris 10 Operating System Page 42 of 174# bootadm list-archive

    Lists the files and directories to be included in theboot archive. Applies to both SPARC and x86 platforms.

    SMF Solaris Management Facility an important feature of SunSolaris 10 0S.

    # cat /etc/default/init

    Features of SMF includes,1. Provides service management via service configuration database

    [list of services and their various supported methods].2. Proves legacy rc script support [old programs will work].3. Facilitates service dependencies4. Permits automatic restarts of failed and/or stopped service.5. Provides service status information [0nline/offline, dependencies]

    6. Causes each defined service to log individually to : /var/svc/log7. Defines a Fault Management Resource Identifier [FMRI].FMRI provide categories of services

    a. networkb. milestone

    8. Can load mutually exclusive services in parallel.9. SMF support multiple instances of services.

    Status:

    Degraded: The service instance is enabled, but is running at alimited capacity

    Disabled -> Services are not enabled and not runningDisabled: The service instance is not enabled and is not running.

    Legacy_run - > the services are not controlled by SMFLegacy_run: The legacy service is not managed by SMF, but canbe observed.

    This state is only used by legacy services that are started withRC scripts

    Maintenance -> this state needs rootss interrogation. Inthis case the services has to be make available manuallyMaintenance: The service instances has encountered an errorthat must be resolved by the administrator

    Offline -> Services are enabled but not runningOffline: The service instance is enabled; the service is not yetrunning or available to run.

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    42

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    43/174

    Sun Solaris 10 Operating System Page 43 of 174Online -> Services are enabled and its runningOnline: The service instance is enabled and has successfullystarted.

    Uninitialized: This state is the initial state for all services beforetheir configuration has been read.

    3-primary SMF utilities:

    1. # svcs Lists services and provides additional information

    2. # svcadm - Service administration utility,Permits interaction with services, including state

    transitions

    3. # svcfg - Service configurationPermits interaction with service configuration

    database

    svc.startd - Is the default service manage/restarter

    inetadm - Is the default, delegated service restarter for INETDdaemon

    Monitoring the services:

    # svcs a-a option will display all services, including disabled services

    # svcsList out what are the services running, status of the service, FMRI

    # svcs l-l option will give detailed information about a service.Eg: svcs l network

    # svcs l List out the detailed information about the specified FMRI. Status of theservice can also be viewed.Eg: # svcs l telnet

    # svcs d-d option lists the services or service instances upon which the given

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    43

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    44/174

    Sun Solaris 10 Operating System Page 44 of 174service instance depents.

    Eg: svcs d milestone/network:defaultsvcs d milestone/multi_usersvcs d network/inetd

    # svcs D-D option will display the other services depends on a given service.

    eg: svcs D milestone/multi-user

    # svcs p-p option is to view the processes associated with a service

    instance.eg: svcs p svc:/network/inetd:default.

    # svcs xIf a service fails for some reason and can not be restarted, you can

    list the service using the x option.

    Service Administration: [using svcadm]

    # svcadm - manipulate service instances

    # svcadm enable Starts the service

    # svcadm disable Disables the service

    # svcadm enable t Starts the service temp, for this session. When restarted the service will nolonger available

    # svcadm enable s Will start all the instance that is associated with specified FMRI

    # svcadm restart To re-read the changes performed to the configuration file.

    # svcadm v refresh To re-read the changes performed to the configuration file.

    NOTE:

    milestone/single-user represents run level S of previous versions ofSolarismilestone/multi-user represents run level 2 of previous version ofSolaris

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    44

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    45/174

    Sun Solaris 10 Operating System Page 45 of 174milestone/multi-user-server represents run level 3 of previousversions of Solaris.

    Service Administration: [using inetadm]

    # inetadm - observe or configure inetd-controlled services

    1. INETD is a super-server which proxies connection to servers.2. INETD services are traditionally defined in /etc/inetd.conf3. inetadm permits control of key/value or name/value pairs of services

    # inetconv - convert inetd.conf entries into smf service manifests,import them into

    SMF repository

    # inetadm Displays what are the services that are controlled by inetd

    # inetadm l Displays detailed information about the FMRI specified.Eg: # inetadm l telnet

    # inetadm d To disable the specified serviceEg: # inetadm d telnet

    # inetadm e To enable the specified serviceEg: # inetadm e telnet

    # inetadm pDisplays the global setttings

    # sys-unconfig - undo a system's configurationsys-unconfig does the following:

    Saves current /etc/inet/hosts file information in/etc/inet/hosts.saved.

    If the current /etc/vfstab file contains NFS mount entries, savesthe

    /etc/vfstab file to /etc/vfstab.orig.

    Restores the default /etc/inet/hosts file.

    Removes the default hostname in /etc/hostname. interface files forall interfaces

    configured when this command is run. To determine which interfacesare

    configured, run the command 'ifconfig-a'. The /etc/hostname.interfacefiles

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    45

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    46/174

    Sun Solaris 10 Operating System Page 46 of 174corresponding to all of the interfaces listed in the resulting

    output, with theexception of the loopback interface (lo0), will removed.

    Removes the default domainname in /etc/defaultdomain.

    Restores the timezone to PST8PDT in /etc/TIMEZONE.

    Disables the Network Information Service (NIS) and NetworkInformation Service

    Plus (NIS+) if either NIS or NIS+ was configured.

    Removes the file /etc/inet/netmasks.

    Removes the file /etc/defaultrouter. Removes the password set forroot in/etc/shadow.

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    46

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    47/174

    Sun Solaris 10 Operating System Page 47 of 174

    FILE PERMISSIONS

    # chmod => used to change the permisssionships of the dir and the file

    syn: # chmod eg: # chmod u+rwx haiu => userg => groupo => othera => allr => readw => writex => execute+ => to add- => to remove= => to assign

    # chmod 777 haiABC

    A => permissionship for the owner ( 7 = rwx)B => permissionship for the group ( 7 = rwx )C => permissionship for the other ( 7 = rwx )

    NOTE:6 - rw-5 = r-x4 = r--

    # chown => used to change the ownershipsyn: # chown eg: # chown hari jai

    wherehari => new owner

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    47

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    48/174

    Sun Solaris 10 Operating System Page 48 of 174jai => file nameNote:Ownership can be changed only by the ROOT user.

    # chgrp => used to change the group

    syn: # chgrp eg: # chgrp admin textwhereadmin => group nametext => name of the file

    # chown : file_nameEg:# chown castro:night newfile

    This command changes both the ownership & group for the specified file.

    ADVANCE FILE PERMISSIONSHIP

    1. SETUID - 42. SETGID - 23. STICKY BIT - 1

    when the SETUID is assigned to a file, all the users who are accessing thefile will become the owner of the file at that moment.

    A good eg for SETUID is # passwd commandwe can check this by# ls -l /usr/bin/passwd

    # chmod 4644 oneAssign the SETUID to the file one with default permissionsetuid will have the impact only in the user's execution areas -> indicates execution permission is enabledS -> indicates execution permission is NOT enabledNOTE: This is applicable for SETGID also.

    # chmod 2644 oneAssign the SETGID for the file oneIts recommended to assign SETGID for a dir.

    To check:

    login as user -> shiva ( in his home dir)NOTE: shiva belongs to solaris group (primary)$ pwd$ mkdir check

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    48

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    49/174

    Sun Solaris 10 Operating System Page 49 of 174login as root user# cd /export/home# ls -l# chgrp admin check# chmod 2755 check

    or

    # chmod g+s check

    NOTE: admin group already exists

    # ls -l

    Again login as user -> shiva

    $ pwd$ cd check$ touch welcome to the world of unix$ ls -l

    We can see the difference

    STICKY BIT

    1. Its useful when the sticky bit permission is implemented to thedirectory.

    2. If a directory is with the sticky bit, every user has the right to createa file inside that dir [provided with write permission].

    3. Only the root user and the owner of the file is permitted to deletethe created file.

    To implement:

    # mkdir test# chmod 1777 test

    Now login as a user named che and create a file inside the directory test.

    To check:Login as another user named castro and try to delete the file created byche.

    System will not permit to delete the file by the user castro.

    # find / -user root -perm -2000used to identify what are the files that having the SETGID permissions

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    49

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    50/174

    Sun Solaris 10 Operating System Page 50 of 174# find / -user root -perm -4000used to identify what are the files that are having the SETUID permissions

    # find / -user root -perm -1000used to identify what are the files that are having the STICKY BITpermissions

    USER ADMINISTRATION

    Files involved:

    /etc/passwd/etc/shadow/etc/skel/etc/group

    Default password policy specification:/etc/default/passwd

    In nutshell:

    # useradd used to create the user account# usermod to modify the user properties# userdel to delete the user account

    # groupadd to add the group

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    50

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    51/174

    Sun Solaris 10 Operating System Page 51 of 174# groupmod to modify group# groupdel to delete the group

    Security Policy specification:/etc/security/policy.conf

    This is the file where the encrypted password algorithm is defined. Whenuser is created, assigned a password the above file is read and theencrypted password will be created according to the algorithm defined.

    # useradd DDisplays the default parameters assigned to the #useradd cooomand

    # useradd -m -d /export/home/stalin -u 801 -g admin -s /bin/bash -c"admin team" stalin

    # useradd -u 902 -m -d /export/home/castro -s /bin/bash -k/etc/skel_tech -g tech -G admin,accounts,support castro

    -u => to specify the user id-d => to specify the directory path-m => to create the home directory [since home directory will notpresent initially when the user is created]- c => to pass the comment about the user-g => to add/specify the primary group-G => to add the secondary group-s => to specify the shell-k => to specify the alternate skel dir-o => to specify the duplicate id

    Note:syn: # id eg: # id castrowill provide the information about the user id and the primary group hebelongs to.

    syn: # id -a eg: # id -a castrowill provide the information about the user id, primary group and secondarygroups the user belongs

    syn: # idwill provide the information about the user id and primary group thecurrently logged user

    # userdel # userdel shivawill only delete the useracount named shiva

    # userdel -r # userdel -r shivawill delete the useraccount along with the home dir and the datas createdby the specified user.

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    51

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    52/174

    Sun Solaris 10 Operating System Page 52 of 174

    # passwd -d # passwd -d shivawill remove the password the user specified

    NOTE:# logins -pwill provide the information about the user who is not having the passwd

    # passwd -n -x -w # passwd -n 45 -x 100 -w 98 shivawhere-n => minimum password age-x => maximum passwod age-w => waring date

    # passwd -l # passwd -l shiva

    will lock the user specified

    # passwd -u # passwd -u shivawill unlock the user account

    # usermod -l # usermod -l che castrohere in this case, the login-name castro is changed to che.

    ASSINGNING THE PASSWORD TO A GROUPStep:1# groupadd solaristhis command creates a group named solaris`

    Step 2.A :# useradd -m -d /export/home/shiva -g solaris -s /bin/bash shiva# passwd shivathese above commands creates the user account shiva belongs to thegroup solaris & assign the password to them.

    Step 2.B:# useradd -m -d /export/home/lingesh -s /bin/bash lingesh# passwd lingeshthese commands creates & assings the password to the user accountlingesh

    Step 3:

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    52

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    53/174

    Sun Solaris 10 Operating System Page 53 of 174As a root user or as any user create a file.Here lets create a file with the root user account# mkdir /new# cd /new# cat > one# ls -l

    this will display the default permission ship and the group the owner (hereroot) belongs to.# chmod 664 one

    This command will change the permission ship to file 'one'# chgrp Solaris onethis command will change the group to 'Solaris' for the file 'one'

    Step 4:To assign the password to a groupa. Copy the second field (encrypted password) of any user account fromthe file /etc/shadowb. Paste the same to the second field of the file /etc/group

    Step 5: To checka. Login as the user (shiva - who belongs to solaris group)and make the changes to the file. It'll change.b. Login as the other user (lingesh - who DOESNT belong to solarsi group)and try to make the changes to the file.We'll be prompted with "permission denied"

    To avoid this login to the solaris group

    c. # newgrp solaristhis command will prompt for the password of the group Solarisand allows to take the group permission ship.

    NOTE: When the user is login to the group the shell changes.

    How to duplicate the user id to another newly creating user ?Step 1:For eg:# useradd -m -d /export/home/redhat -s /bin/bash -g admin -u 3000 redhat# passwd redhatthis command will create the user account with the following

    login name: redhathome dir/base dir : /export/home/redhatuser id : 3000primary group : adminshell: bash

    # useradd -m -d /export/home/suse -s /bin/ksh -g solaris -u 3000 -o suse

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    53

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    54/174

    Sun Solaris 10 Operating System Page 54 of 174# passwd susethis command will create the user account with the following

    login name: susehome dir/base dir : /export/home/suseuser id : 3000 NOTE: Duplicated using the option -o

    primary group: solarisshell: korn

    NOTE: DONOT duplicate the root id to any user, if happens it leads tosecurity breech.

    MISC

    1. # /usr/ucb/vipw -> opens the /etc/passwd file in the text layout.works only in the init level 3

    User friendly to edit the file

    2. # pwck=> checks the entry of the file /etc/passwd and if any errorsit'll be displayed

    3. # grpck=> checks the entry of the file /etc/group and if any errors it'llbe displayed

    4. # echo $? => provides the info status on the command executedif its 0 -> command is executed successfulyif other than 0 -> its shows error occurance

    Trouble shooting:At single user mode, whilst CD_ROM is mounted

    # TERM = sun# export TERM# vi /etc/shadow

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    54

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    55/174

    Sun Solaris 10 Operating System Page 55 of 174

    FTP IMPLEMENTATION

    Wu ftpd => Washington University ftpd daemon

    1. FTPD binds to TCP port 21 and is running by default.2. SMF controls FTP service configuration.3. # svcs a l ftp

    Displays the status of the ftp service.4. # pkginfo l | grep ftp*

    Displays the detailed information about ftp service.5. # pkginfo x | grep ftp*

    Displays package information6. SUNWftp - includes useful user packages, which includes

    a. ftpcount, ftpwho [displays the connected users & processinformation]

    b. ftpconfig utility is used to setup anonymous/guest ftpc. SUNWftpr includes

    1. /etc/ftpdftpaccess primary configuration file for wu-ftpdftphost allow/deny access to users from hostsftpservers allows root to define virtual hostsftpusers users listed are NOT permitted to access the

    server via ftpftpconversions facilitates tar, compress, gzip support

    wu ftp daemon supports 2 types of ftp connections

    1. PORT Active ftpa. Client -> TCP:21 [Server-Control-Connection]b. Client executes ls -> results in server initiating a connection back to theclient usually on

    TCP:20 [ftp-data]

    2. PASU Passive ftpa. Client -> TCP:21 [Server-Control-Connection]b. Client executes ls -> results in server opening a high port andinstructing the client to

    source (initiate) a connection to a server.c. Client sources data connection to high port on server.

    # ftpcountShows current number of users in each ftp server class

    -v Displays the user counts for ftp server classes defined in virtual host[ftpaccess]

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    55

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    56/174

    Sun Solaris 10 Operating System Page 56 of 174-V Display program copyright and version information thenterminate

    # ftpwhoShows current process information for each ftp server user

    1. Itll display which user is logged in along with the process id

    2. Status of the user will be displayed3. Will also display the password given by the anonymous user

    Note:Login time via ftp is defined in the file /etc/ftpd/ftpaccess

    Time out in seconds.

    Anonymous ftp configuration:

    # ftpconfigSetup anonymous ftp

    Note:1. If the /var/ftp dir doesnt exist, this above command will create andupdate the dir for anonymouns ftp.

    2. Guest connections can be blocked/jailed using chroot

    3. This can also be achieved by using GUI web browser to check theanonymous login using ftp.

    # ftpconfig /var/ftp# cd /var/ftp# ls l

    At location bar of the web browser:

    ftp://192.168.0.100

    1. Will by default show the anonymous user

    Ftpd class support:

    Facilitates the grouping of users for the purpose of assigning directives

    3- default classes:1. Real users:

    a. Can login using shell [ssh/telnet]b. Can browse the entire directory

    2. Guest users:a. Are temporary users

    3. Anonymous user:a. General public for download capability

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    56

    ftp://192.168.0.100/ftp://192.168.0.100/
  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    57/174

    Sun Solaris 10 Operating System Page 57 of 174

    All the 3 default classes is defined to the file /etc/ftpd/ftpaccess

    Guest user support:

    1. # useradd d /export/home/guests s /bin/true guestsNote:In this case the user is permitted to login through ftp. He/she cannotlogin/access any shell.

    2. # passwd guests3. # mkdir /export/home/guests4. # chown guests /export/home/guests5. # ftpconfig d /export/home/guests6. Update the configuration file /etc/ftpd/ftpaccess

    Edit anywhere in the file. It also have the entry commented out.# guest user

    guest user guests

    7. Restart the ftp service# svcadm restart ftp

    Note:Guest users are similar to real users, except guest users are

    jailed/chrooted.

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    57

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    58/174

    Sun Solaris 10 Operating System Page 58 of 174

    PERFORMANCE MONITORING

    # users => display a compact list of users logged in

    # who am i

    # whoami

    # who

    # w

    # rusers => who is logged in on remote machines

    # rusers l Displays who is currently logged to this machine along with the remoteaccess.

    # whodoDisplays who is doing what

    # groupsPrint group membership of user

    # groups Print group membership of the specified user

    # uptime => provides the information about the uptime of the system

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    58

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    59/174

    Sun Solaris 10 Operating System Page 59 of 174

    # last => provide the info about the currently logged in users,When the system came to upstate, when rebooted and so on.

    # vmstat => provides info on virtual memory

    # pagesize => provides info on the paging size of the memory

    # prstat => provides the information about1. The process id2. User using that process3. cpu utilization for that process4. Command running5. RAM utilization

    this command will work in terminal even in text layout.

    # /usr/dt/bin/sdtprocess & => similar to 'prstat' command butmenu driven.It works only with graphics, in the init level 3.

    The important process & its process ids

    sched [scheduling] - process id is 0init [initialization] - process id is 1svc.stard [SMF] - process id is 7

    Network Monitoring: Additional information:# netstatShow the network status

    1. Lists connections of All protocol & address families to and frommachine.Address families include:

    a. INET ipv4b. INET6 - ipv6c. UNIX - UNIX Domain Sockets [ Solaris/BSD/Linux/HP-UX/IBM-

    AIX/etc]

    Protocols include:TCP, IP, ICMP [which controls ping, echo], IGMP, RAWIP, UDP [DHCP,TFTP]

    2. Lists routing table3. Lists DHCP status for various interfaces4. Lists net-to-media table. Network to MAC [Network card] table

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    59

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    60/174

    Sun Solaris 10 Operating System Page 60 of 174

    # netstat usage:

    # netstat

    TCP: IPv4

    Local Address Remote Address Swind Send-Q Rwind Recv-QState-------------------- -------------------- ----- ------ ----- ------ -------accel1.telnet intel.32961 49640 0 49640 0ESTABLISHED

    1 2 3 4

    Where1 => hostname of the sender2 => port/protocol3 => hostname of the receiver / remote4 => port/protocol of remote

    Note:1. # cat /etc/services

    Displays the well known port number and their correspondingservices

    2. Hostname is displayed while using the # netstat command can bepossible only of the /etc/hosts file is having the entry of the ip-address and corresponding hostname [resolve].

    This file will be indirectly checked.When issuing the # netstat command it will read the file/etc/nsswith.conf and this file redirect to read the file /etc/hosts[provided the entry is made].

    4. Sockets are found only for TCP connections [connection oriented].

    5. Sockets are NOT found for UDP connections since they areconnection less.

    6. No need to remember all the ports, just grep from /etc/services.Eg: # grep syslog /etc/services

    # netstat aa. Shows the state of all packetsb. All routing table entries / all interfaces, both physical & logicalc. Returns ALL protocols for ALL address families [TCP/UDP/UNIX].

    UDP: IPv4Local Address Remote Address State

    -------------------- -------------------- -------*.route Idle*.sunrpc Idle

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    60

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    61/174

    Sun Solaris 10 Operating System Page 61 of 174*.* Unbound*.32771 Idle

    [Output truncated]

    # netstat na. Shows network addresses as numbers. Normally # netstat

    displays addresses assymbols.b. It disables name resolution of hosts and ports and hence

    displays the ip-address.

    TCP: IPv4Local Address Remote Address Swind Send-Q Rwind Recv-Q State

    -------------------- -------------------- ----- ------ ----- ------ -------192.168.0.100.23 192.168.0.19.32961 49640 0 49640 0ESTABLISHED192.168.0.100.32921 192.168.0.5.6000 500576 0 49640 0ESTABLISHED127.0.0.1.32923 127.0.0.1.32879 49152 0 49152 0

    ESTABLISHED

    [Output truncated]

    # netstat ia. Returns the state of the physical interfaces. Pay attention to

    errors/collisions/queue whilst troubleshooting.b. When combined with -a options displays report on logical

    interfaces.

    Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs CollisQueuelo0 8232 loopback localhost 131536 0 131536 0 0 0hme0 1500 accel1 accel1 186731 0 189733 0 0 0

    NOTE:mtu - Maximum Transmission Unit

    In general the loopback address mtu will be high.

    # netstat ma. Show the STREAMS memory[How much TCP packets is working on the system]

    streams allocation:cumulative allocation

    current maximum total failuresstreams 300 336 2463 0queues 742 756 5539 0mblk 488 1778 192771 0dblk 489 2009 1062735 0linkblk 7 169 8 0syncq 17 50 77 0qband 2 127 2 0

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    61

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    62/174

    Sun Solaris 10 Operating System Page 62 of 174

    917 Kbytes allocated for streams data

    # netstat pReturns net-to-media information[MAC/layer-2 information] i.e., to arp table.

    Net to Media Table: IPv4Device IP Address Mask Flags Phys Addr------ -------------------- --------------- ----- ---------------hme0 192.168.0.5 255.255.255.255 00:16:41:ef:d5:ffhme0 accel1 255.255.255.255 SP 08:00:20:c4:a2:fbhme0 224.0.0.0 240.0.0.0 SM 01:00:5e:00:00:00

    # netstat P Returns active sockets for specified protocol

    Eg: # netstat P tcp

    Note:1. Protocols should be specified with small letters2. The following protocols are only allowed ip|ipv6|icmp|icmpv6|

    tcp|udp|rawip|raw|igmp

    TCP: IPv4Local Address Remote Address Swind Send-Q Rwind Recv-Q State

    -------------------- -------------------- ----- ------ ----- ------ -------accel1.telnet intel.32961 49640 0 49640 0 ESTABLISHEDaccel1.32921 192.168.0.5.6000 500576 0 49640 0ESTABLISHEDlocalhost.32923 localhost.32879 49152 0 49152 0ESTABLISHED

    [Output truncated]

    # netstat ra. Returns routing tableb. Normally, only interface, host, network & default routes are

    displayedc. Combined with -a option, all routes will be displayed, including

    cache.

    Routing Table: IPv4Destination Gateway Flags Ref Use Interface

    -------------------- -------------------- ----- ----- ------ ---------192.168.0.0 accel1 U 1 19 hme0224.0.0.0 accel1 U 1 0 hme0localhost localhost UH 47 133672 lo0

    # netstat DReturns DNCP configuration [includes releases/renewal etc]

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    62

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    63/174

    Sun Solaris 10 Operating System Page 63 of 174# netstat an f [inet|inet|6|unix]

    -f => allows to specify the family address

    Eg: # netstat an f inetDisplays only ipv4 information

    UDP: IPv4Local Address Remote Address State

    -------------------- -------------------- -------*.520 Idle*.111 Idle

    *.* Unbound*.32771 Idle*.* Unbound

    [Output truncated]

    Misc

    #ln s /dev/pts/9 soft# telnet 192.168.0.10 | tee soft

    To have the output of your machine in to the another person

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    63

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    64/174

    Sun Solaris 10 Operating System Page 64 of 174

    PROCESS SHCEDULING

    # at => executes the command only onceevery user has the right to execute the at command

    syn: # at

    eg: # at 1030

    # atqwill provide the info abt the scheduled task along with their id.

    # at -lwill provide the info abt the job id and the user who scheduled the process

    /etc/cron.d/at.denythis file will have the login name of the users who are denied to use the atcommand.

    /etc/cron.d/at.allowthis file will not be present by default.this file has to be created mannualythis file holds the login name of the users who are having the permission toaccess the at command.

    In general system will check for the /etc/cron.d/at.allow file first and thenmoves to the file /etc/cron.d/at.deny

    /var/cron/logthis file logs the at command shceduling

    /var/spool/cron/atjobsis a directory which holds the at schedule

    # cron => will execute the process recurssivelyit has number of fileds1. minute filed - 0 to 592. hour filed - 0 to 233. day of month - 1 to 314. month filed - 1 to 12

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    64

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    65/174

    Sun Solaris 10 Operating System Page 65 of 1745. day of the week - 0 to 6

    NOTE:0 = sunday1 = mondayrespectively

    6. command field => what command has to be executed

    * => on every month/day

    PRINTER CONFIGURATION

    # printmgr &=> This above command opens a menu=> Printer configuration can be menu driven

    NOTE:1. Before configuring the printer make sure about the compatablity withthe sun microsystems.2. Check the make and the type3. The port to which the printer is connected physically.

    Once the menu is opened,1. Enable the "confirm actions" from the main menu2. Select the newly attached printer

    a. give the printer name ( can be any name )b. description can also be anythingc. choose the correct port

    (here we have choosen /dev/pts/7 for our eg. In thiscaseif we want to specify the port choose " other')

    d. select the type of the printere. select -> the banner options if required or never print bannerf. user access list -> by default every user is given the right

    to sent the request to the printer. If we want to restrict,add the specific users from the user list.g. apply the changes

    # lp eg: # lp check_printerwill the print the file named "check_printer" to the default printer

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    65

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    66/174

    Sun Solaris 10 Operating System Page 66 of 174

    # lpstat -ddisplays which is activated as the default printer if we have configuredmore than one printer

    # lpstat -p

    displays status of all the printers that are configured to the system

    # lpadmin -d eg: # lpadmin -d hpwill activate "hp" as the default printer if we had configured more than oneprinter.

    # reject eg: # reject hpthis command will reject the requests to the printer named "hp"ie.. hp printer will not accept the requests from any user including the root.

    Note:

    In the above case, printer is physically connected, activated but therequest will not be fulfilled or not accepted.

    # accept eg: # accept hpthis command will start sending the request to the printer named "hp"In other words printer starts printing the desired output.

    # disable eg: # disable hpthis command will disable the printer. In other words printer is notactivated.cc# enable eg: # enable hpwill ativate/enable the printer specified.

    /var/lp/logs/requests -> provides the information on the print logs whichinclues1. which user given the print request2. date & time of the request3. size of the file4. user id, group id5. file name6. location of the file

    # lpqprovide the information about the request in the queue.

    Sun Solaris 10 OS/Storage-SVM,VxVM Manickam

    Kamalakkannan

    66

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    67/174

    Sun Solaris 10 Operating System Page 67 of 174

    BACKUP & RESTORE

    1. ufsdump command is used to take backupoptions:u -> to update the file /etc/dumpdatesS -> to check the size required to take a backupf -> specify the devicen -> to nofify

    2. ufsrestore -> used to restore the contentsr -> recursivelyv -> verbose/detailed informationf -> devicei -> interactively

    NOTE:1. Its recommended to take backup after unmounting the file system

    syn: # ufsdump uf

  • 8/14/2019 Sun Doc Updated as on 24 May 2009

    68/174

    Sun Solaris 10 Operating System Page 68 of 174be done>

    eg: # ufsdump 0uf /dev/rdsk/c1d0s6 /dev/dsk/c1d0s50 -> level of the backup0-> complete backup

    /dev/rdsk/c1d0s6 -> the destination or the media where the backup is done/dev/dsk/c1d0s5 -> source or the media which the data residesWhereu Updates the file /etc/dumpdatesf Specifies the device

    NOTE:Move the directory or the location where we wanna restore the datas.

    syn: # ufsrestore rf eg: # ufsrestore rf /dev/rdsk/c1d0s6

    Taking a backup of a root slice

    NOTE:1. Enter into the system maintenance mode2. Then check the destination size of the tape/disk3. Proceed with the backup.

    # ufsdump 0uf /dev/rdsk/c1d0s6 /dev/dsk/c1d0s0here, slice6 is taken as backup device which has nearly 4gb of space

    Restoring the root backup

    1. Boot from the cd2. DONOT mount the root slice (ie s0)3. Create the file system for the root slice4. Mount the root slice in /a dir5. Move to the /a dir6. restore the backedup information7. a. install the bootblk in the case of SPARC

    b. install the grub in the case of X86/X648. restart the system.

    # cd /# newfs /dev/rdsk/c1d0s0# mount /dev/dsk/c1d0s0 /a# cd /a# ufsrestore rvf /dev/rdsk/c1d