scsa-part-1-kamal.pdf

216
Slash Networks Kamal 1 SUN SOLARIS 10 OS

Upload: kk

Post on 29-Nov-2015

42 views

Category:

Documents


3 download

DESCRIPTION

scsa part1 kamal krishna

TRANSCRIPT

  • Slash Networks Kamal 1

    SSUUNN SSOOLLAARRIISS 1100 OOSS

  • Slash Networks Kamal 2

    Sun Solaris 10 Operating System

    DISK ADMINISTRATION

    NOTE: In the case of swap memory: If RAM < 2gb = Double the size of physical memory If RAM is between 2gb and 8gb = 75% of physical memory If RAM > 8gb = 50% of physical memory

    Naming conventions: 1. Logical Name 2. Physical Name 3. Instance Name

    Logical Name: ON SUN HARDWARE : SPARC - Sacalar Processor ARCH c#t#d#s# c = controller t = target d = disk s = slice # = number

    These logical names are linked to physical devices. For eg:

    c0t3d0s5 In SPARC, it's possible to create 7 slices per disk drive. 0 to 7, where slice-2 cannot be used nor created.

    ON X-86 HARDWARE: Targets will not be shown. Hence c#d#s# It's possible to create 7 slices. But will have 0 - 9 slice 8 and 9 = holds the boot loaders.

    Physical Device Name: Physical device name is seen in /devices dir. Physical devices will be followed with the Instance name. Using physical name it's possible to understand the type of the disk drive connected. For eg IDE or SCSI.

    Note: 1. The devices performing input/output operations need device driver files. Eg: Hard disk, printer... 2. The devices not performing input/output operations do not need device driver files. Eg: Communication devices Hub, Router, Switch. Since these devices going to transmit only the datas and not any other operations, they do not need the device driver files.

  • Slash Networks Kamal 3

  • Slash Networks Kamal 4

    Sun Solaris 10 Operating System

    Instance Name: dad = direct access device (Only for IDE) sd = scsi disk drive Instance name are generated by the Kernel to each hardware. cmdk = common disk /etc/path_to_inst 1. This file has the information about the physical device name and their corresponding instance name. 2. This file will be with the permission r--r--r-- (444) 3. This file is NOT recommended to edit.

    # prtconf This command provides the following informations: 1. physical memory size 2. Arch of the system 3. Machine model 4. What are the devices connected to the system along with the driver

    # prtconf | grep -v not will display only the attached devices to the system.

    # format This is a utility which provides the following 1. How many hard disk drives are attached and recongnised by the OS. 2. Physical name and logical name of the disk 3. Volume name assigned to each disk

    To skip the utility: Ctrl+c

    # echo | format will also the above mentioned information

    # format command has two tires.

    format> where we can view only the disk drive infomation

    partition> to create, delete, modify the slices.

    format> help will provide the help, list out the commands that can be used in format tire.

    format> verify will list out the partition layout of the current disk drive selected.

  • Slash Networks Kamal 5

    Sun Solaris 10 Operating System

    Output: Primary label contents:

    Volume name = < > ascii name = pcyl = 4926 ncyl = 4924 acyl = 2 nhead = 27 nsect Part

    = Tag

    133 Flag

    Cylinders

    Size

    Blocks

    0 root wm 294 - 3484 5.46GB (3191/0/0) 11458881 1 swap wu 20 - 293 480.44MB (274/0/0) 983934 2 backup wm 0 - 4923 8.43GB (4924/0/0) 17682084 3 unassigned wm 3485 - 4069 1.00GB (585/0/0) 2100735 4 unassigned wm 0 0 (0/0/0) 0 5 unassigned wm 0 0 (0/0/0) 0 6 unassigned wm 0 0 (0/0/0) 0 7 unassigned wm 0 0 (0/0/0) 0

    Here, part = the slice number It varies from 0 to 7.

    Tag = a name given to the slice Only permitted names can be assinged. Permitted Names: root, swap, backup, unassigned, home, usr, var, stand, alternates, boot, reserved NOTE: Tag names can be repeated.

    Flag = defines the status of the slice wu = write mountable wu = write unmountable rm = read mountable ru = read unmountable

    Always swap slice will be wu. By default all other slices are wm.

    Cylinders: Shows the starting point and the end point of the each slice.

    Size: shows how much of size is assigned or created to the slice

    Blocks:

  • Slash Networks Kamal 6

    Shows the size of the disk in blocks.

    format>disk will list out the hard disk drives recognised by the operating system. Will also provide the option to choose the next disk drive But by default it selects the current disk.

    format>p format>partition

    Sun Solaris 10 Operating System

    will move from the first tire to the second.

    partition> help will provide the help, commands that can be used in partition menu.

    partition> print pratition> p will print the layout out the current disk drive. Output is similar to the format> verify.

    partition> q to quit from parittion menu and move to format>

    format> q to quit from format utility.

    format> l format> label partition> l partition> label To save the newly created/modified/deleted slices inforation to the operating system.

    To delete the partition: for eg: slice 5 OUTPUT:

    partition> 5 Part Tag Flag Cylinders Size Blocks

    5 unassigned wm 2456 - 2741 501.48MB (286/0/0) 1027026 Enter partition id tag[unassigned]: Enter partition permission flags[wm]: Enter new starting cyl[2456]: Enter partition size[1027026b, 286c, 2741e, 501.48mb, 0.49gb]: 0 partition> l Ready to label disk, continue? y Here, the partition size has to be given as 0. i.e starting point is 2456 and the ending point is 2456+0.

  • Slash Networks Kamal 7

    So, the slice is deleted. To make the changes to come into effect, label it.

    Note: 1. labeling the disk after creation/moidifcation/deletion of the slices is mandatory. 2. saving the changes done to the partition table is optional.

    To create a partition: 1. Print the partition table and make sure about the available cylinders. Avoid overlapping and wasting of the cylinders whilst creating the slices.

    Sun Solaris 10 OS/Storage-SVM,VxVM/Cluster

  • Slash Networks Kamal 8

    Sun Solaris 10 Operating System

    OUTPUT:

    partition> p Current partition table (unnamed): Total disk cylinders available: 4924 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks

    0 alternates wm 585 - 1000 729.42MB (416/0/0) 1493856 1 unassigned wu 1001 - 2169 2.00GB (1169/0/0) 4197879 2 backup wm 0 - 4923 8.43GB (4924/0/0) 17682084 3 unassigned wm 0 0 (0/0/0) 0 4 unassigned wm 2170 - 2455 501.48MB (286/0/0) 1027026 5 unassigned wm 0 0 (0/0/0) 0 6 unassigned wm 0 0 (0/0/0) 0 7 unassigned wm 0 - 584 1.00GB (585/0/0) 2100735

    partition> 5 Part Tag Flag Cylinders Size Blocks

    5 unassigned wm 0 0 (0/0/0) 0

    Enter partition id tag[unassigned]: Enter partition permission flags[wm]: Enter new starting cyl[0]: 2456 Enter partition size[0b, 0c, 2456e, 0.00mb, 0.00gb]: 2g partition> l Ready to label disk, continue? y Here, 1. we have seen the partition table 2. Determined the starting point of the cylinders 3. Slice is defined in terms of size (gb) Note: Slice sizes can be defined in terms of clinders, gb, mb.

    for eg: Enter partition size[0b, 0c, 2456e, 0.00mb, 0.00gb]: 2g (in terms of gb) Enter partition size[0b, 0c, 2456e, 0.00mb, 0.00gb]: 2048m (in terms of mb) Enter partition size[0b, 0c, 2456e, 0.00mb, 0.00gb]: 3400e (in terms of cylinders)

    partition> modify Note: 1. This option is used only for the disk drives which is not having any mounted slices 2. This option CANNOT be used for the disk drive which is having Operating System.

    FREE HOG: When using the format utility and change the size of the disk slices, a temporary slice is automatically designate that expands & shrinks to accomodate the slice resizing operations. This temporary slice is refered to as the free hog & it represents the unused disk space on the disk drive.

    partition> name will prompt for a table name with 8 characters

  • Slash Networks Kamal 9

  • Slash Networks Kamal 10

    Sun Solaris 10 Operating System Page 22 of 145

    format> save NOTE: 1. Before using this option, it's mandatory to name the partition table at the partition menu. 2. By default the save option will save the updated partition table information to the file ./format.dat 3. The location can be changed and the file name can be anything. 4. After doing updations, we can save the changes to the same file. This file will be updated and not over written.

    format>volname will prompt for the disk name

    NOTE: format> volname will assign name to the disk drive

    partition> name will assign the name to the partition table.

    format> !cmd partition> !cmd eg: format> !clear partition> !ls this is used to run the shell commands without quitting from the format utility.

    format> current Current Disk = c0t12d0: 5student /pci@1f,4000/scsi@3/sd@c,0

    will provide the information about the current disk drive.

    format> type will provide the information about the disks supported.

    Only with X-86 hardware:

    format>fdisk this option is used to delete the partitions of windows using Solaris.

    Output truncated: # prtvtoc /dev/dsk/c0t0d0s2 * /dev/dsk/c0t0d0s2 partition map * * Dimensions: * 512 bytes/sector * 248 sectors/track * 19 tracks/cylinder * 4712 sectors/cylinder * 7508 cylinders

  • Slash Networks Kamal 11

    * *

    7506 accessible cylinders

    * Flags:

  • Slash Networks Kamal 12

    Sun Solaris 10 Operating System

    * 1: unmountable * 10: read-only * * Unallocated space: * First Sector Last * Sector Count Sector * 18433344 16934928 35368271 * * First Sector Last * Partition Tag Flags Sector Count Sector Mount Directory

    0 2 00 0 18433344 18433343 # prtvtoc prints the Volume Table Of Contents Following informations will be provided: 1. disk (volume name) 2. disk information, about the sectors, tracks. cylinders.. 3. the created slices inforation along with the flags

    Re-labling a disk:

    # prtvtoc /dev/dsk/c0t0d0s0 > /var/tmp/test_disk0

    Redirecting the output of # prtvtoc to the file /var/tmp/test_disk0

    # fmthard -s /var/tmp/test_disk0 /dev/rdsk/c0t10d0s2 Copying the VTOC of disk c0t0d0 to new disk c0t10d0s2

    # fmthard this command is used to create/copy the layout of one disk drive to another.

    NOTE: # fmthard command can be used only if both the source disk and the destination disk drive geometry remains same.

    Reconfiguring the disk: It can be achieve by 3 ways

    1. At OK prompt OK boot -r will boot the system and reconfigure, identifies the newly connected disks.

    2. # touch /reconfiure Create a file named "reconfigure" under root.

    # init 6 Restart the system

    Now, when the system restarts, the newly connected disks will be identified.

  • Slash Networks Kamal 13

    NOTE: Once the system is rebooted, the reconfigured file will be removed automatically. 3. # devfsadm -Cv

  • Slash Networks Kamal 14

    Sun Solaris 10 Operating System

    will be applicable when the system supports hot pluggable disk drives. here -C = to clear and create a new list of newly identified disk drives -v = verbose. detailed output

  • Slash Networks Kamal 15

  • Slash Networks Kamal 16

    Sun Solaris 10 Operating System

    FILE SYSTEM

    Mainly classified into 3 types 1. Disk Based file system 2. Pseudo file system 3. Distributed file system

    1. Disk based file system: ufs = unix file system.

    Default file system for Sun Solaris NOTE: The default file system for Linux is ext2, ext3.

    hsfs = high sierra file system used by optical media. both cdrom and dvd

    Note: In the case of linux-iso9660

    pcfs - personal computer file system which supports dos

    udfs - universal disk file system for re-writable optical media

    IN SOLARIS 10 zfs - zetta byte file system. 4 bit = 1 nibble 8 bit = 1 byte 1024 byte = 1 killo byte 1024 kb = 1 mega byte 1024 mb = 1 giga byte 1024 gb = 1 terra byte 1024 tb = 1 penta byte 1024 pb = 1 exa byste 1024 hb = zetta byte

    256 quadrillion zetta bytes.

    Distributed file system: NFS - Network file system Used to access the shared resources.

    Pseudo file system: Pseudo means false. swapfs - swap file system tmpfs = temp file system, used by /tmp directory procfs = process file system, used by /proc directory mntfs = mount file system fdfs = file descriptor file system, used by the devices

    VTOC = Volume Table Of contents Resides at Track 0, Sector 0 Occupies 512 bytes

  • Slash Networks Kamal 17

  • Slash Networks Kamal 18

    Sun Solaris 10 Operating System

    Boot block (bootblk): It's similar to bsl (boot strap loader) Resides between Track 0, sector 1 to Track 0, sector 15 In X-86 it's said to be as GRUB (Grand Unified Boot Loader) Will be active only at the root disk

    Primary super block: Resides between Track 0 , sector 16 to Track 0, sector 31 It occupies 16 sectrors Providies the information about the data blocks, inodes and more.

    Secondary backup block: It always starts and occupies Track 0, sector 32. Backup super blocks will be created at the time of file system creation At the time of file creation, number of backup super blocks will be created

    Cylinder group blocks:

    provides the information about the cylinder per groups free data block, size available, number of inodes and more.

    # newfs This command is used to create a new file system. When this command is invoked to create a new file system, it refers to the file /etc/default/fs

    OUTPUT: # cat /etc/default/fs LOCAL=ufs This file will have the above mentioned entry and hence only ufs file system will be created by default.

    # newfs command at the time of creation will provide the following information: 1. where the slice was mounted earlier, 2. geometry of the slice 3. secondary backup blocks

    OUTPUT: # newfs /dev/rdsk/c0t12d0s0 newfs: /dev/rdsk/c0t12d0s0 last mounted as /mnt/sone newfs: construct a new file system /dev/rdsk/c0t12d0s0: (y/n)? y Warning: 5166 sector(s) in last cylinder unallocated /dev/rdsk/c0t12d0s0: 1027026 sectors in 168 cylinders of 48 tracks, 128 sectors

    501.5MB in 13 cyl groups (13 c/g, 39.00MB/g, 18624 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 80032, 160032, 240032, 320032, 400032, 480032, 560032, 640032, 720032, 800032, 880032, 960032

    # newfs -N /dev/dsk/c0t12d0s0 Will not create the file system, instead display the information about the geomerty of the disk slice and the super backup blocks, if file system is created.

  • Slash Networks Kamal 19

    # newfs -T /dev/rdsk/c0t12d0s0 will create a file system that can support terrabyte. # newfs -m 1 /dev/rdsk/c0t12d0s0 will create the file system, with the minfree value as 1%

    Minfree: A certain % of space is reserved for every slices.

    To know : OUTPUT: # fstyp -v /dev/dsk/c0t12d0s0 | grep -i min minfree 10% maxbpg 2048 optim time To change the minfree value: # tunefs -m 1 /dev/dsk/c0t12d0s0 minimum percentage of free space changes from 10% to 1%

    # fsck file system check It can be done in two ways 1. Non-interactive - only at the time of booting 2. Interactive - at any time

    NOTE: Before running # fsck, it's recommended to unmount the slice

    OUTPUT:

    # fsck -y -o b=160032 /dev/dsk/c0t12d0s0 Alternate super block location: 160032. ** /dev/rdsk/c0t12d0s0 ** Last Mounted on ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3a - Check Connectivity ** Phase 3b - Verify Shadows/ACLs ** Phase 4 - Check Reference Counts ** Phase 5 - Check Cylinder Groups UPDATE STANDARD SUPERBLOCK? yes 2 files, 9 used, 483015 free (15 frags, 60375 blocks, 0.0% fragmentation) ***** FILE SYSTEM WAS MODIFIED ***** Where -o = to specify the option b = to specify the block number -y = to confirm "yes"

    NOTE:

  • Slash Networks Kamal 20

    fsck command will check file system consistency, inode consistency, cylinder groups consistency.

  • Slash Networks Kamal 21

    Sun Solaris 10 Operating System

    # df -h will provide 1. what are the devices mounted 2. Whenre it is mounted 3. what is the total size of the slice 4. how much of space is used 5. how much of available space 6. space utilized in %

    Where -h = to view the information in human readable format.

    # du -h / # du -h /mnt/sone will provide how much of space is occupied by each file and directory

    where -h = human readable format

    # quot -h /dev/dsk/c0t12d0s0 /dev/rdsk/c0t12d0s0:

    9 root will show the ownership.

  • Slash Networks Kamal 22

  • Slash Networks Kamal 23

    Sun Solaris 10 Operating System

    PERFORMING MOUNTING AND UNMOUNTING OPERATION

    Mounting is the process of getting ready to access the newly created slices. Mounting can be done only if the slice is having the file system. To mount a device mount point is essential. By default only one device can be mounted at a single mount mount.

    # mount This command can be used only by the root user. This provides the information about what are the devices mounted along with its property. This will show both the permanent and temp mounted devices information along with the newtwork mounted informations.

    Output truncated:

    # mount / on /dev/dsk/c2t0d0s0 read/write/setuid/devices/intr/largefiles/logging/xattr/onerror=panic/dev=1d8000 8 on Sat Jul 18 20:05:48 2009 /devices on /devices read/write/setuid/devices/dev=4b80000 on Sat Jul 18 20:05:36 2009 /system/contract on ctfs read/write/setuid/devices/dev=4bc0001 on Sat Jul 18 20:05:36 2009 /proc on proc read/write/setuid/devices/dev=4c00000 on Sat Jul 18 20:05:36 2009 /etc/mnttab on mnttab read/write/setuid/devices/dev=4c40001 on Sat Jul 18 20:05:36 2009 /etc/svc/volatile on swap read/write/setuid/devices/xattr/dev=4c80001 on Sat Jul 18 20:05:36 2009 /system/object on objfs read/write/setuid/devices/dev=4cc0001 on Sat Jul 18 20:05:36 2009/usr on /dev/dsk/c2t0d0s3 read/write/setuid/devices/intr/largefiles/logging/xattr/onerror=panic/dev=1d8000 b on Sat Jul 18 20:05:49 2009 /platform/sun4u-us3/lib/libc_psr.so.1 on /platform/sun4u- us3/lib/libc_psr/libc_psr_hwcap1.so.1 read/write/setuid/devices/dev=1d80008 on Sat Jul 18 20:05:44 2009 /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1 on /platform/sun4u- us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1 read/write/setuid/devices/dev=1d80008 on Sat Jul 18 20:05:45 2009 /dev/fd on fd read/write/setuid/devices/dev=4e80001 on Sat Jul 18 20:05:49 2009 # df -h will also provide the information about the device currenlty mounted. This command can be used by the non-root users.

    To know the file system type of the slice

    # fstyp

    OUTPUT: eg: # fstyp /dev/dsk/c2t1d0s0

    ufs This shows the type of the file system created on the slice

  • Slash Networks Kamal 24

  • Slash Networks Kamal 25

    Sun Solaris 10 Operating System /etc/mnttab 1. is non-editable file even by the root user 2. this file can be updated by executing the command "#mount" 3. has the information about the currenlty mounted slices 4. provides the information about the device mounted, mount point of the device, how it's mounted (state - ro/rw, nosuid, intr/nointr, largefiles/noloargefiles,xattr, on error=panic/unmount/lock), type of the file system. 5. While mounting the slice we can provide the following options: ro = read only rw = read & write (Default)

    nosuid = will not support the suid file scripts. By default it's supported

    intr = accepts the keyboard intrupts (Default) nointr = will not support

    largefiles = will support the file size more than 2gb (Default) nolargefile = will not support the files with more file size.

    xattr = extreme attributes, to provide compatability with unix flavors.

    on error = three actions can be performed panic = displays the message (Default) lock = will lock the slice from performing any actions unmount = will unmount the slice forcefully.

    Ouptput truncated:

    # cat /etc/mnttab /dev/dsk/c2t0d0s0 / ufs rw,intr,largefiles,logging,xattr,onerror=panic,dev=1d80008 1247927748 /devices /devices devfs dev=4b80000 1247927736 ctfs /system/contract ctfs dev=4bc0001 1247927736 proc /proc proc dev=4c00000 1247927736 mnttab /etc/mnttab mntfs dev=4c40001 1247927736 swap /etc/svc/volatile tmpfs xattr,dev=4c80001 1247927736 objfs /system/object objfs dev=4cc0001 1247927736 /dev/dsk/c2t0d0s3 /usr ufs rw,intr,largefiles,logging,xattr,onerror=panic,dev=1d8000b 1247927749 /platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1 /platform/sun4u- us3/lib/libc_psr.so.1 lofs dev=1d80008 1247927744 To mount the device : # mount Eg: # mount /dev/dsk/c2t0d0s6 /six6

    Example to mount slice with manually with different options:

    # mount -o ro,nolargefiles,nosuid /dev/dsk/c2t1d0s1 /mnt/slice1

    To check: # tail -1 /etc/mnttab /dev/dsk/c2t1d0s1 /mnt/slice1 ufs ro,nosuid,intr,nolargefiles,logging,xattr,onerror=panic,dev=1d80001

  • Slash Networks Kamal 26

    1247930672

  • Slash Networks Kamal 27

    Sun Solaris 10 Operating System where -o = to specify the options

    NOTE: If the properties of the mounted slice has to be changed, then the slice has to be unmounted and want to be mounted once again.

    By default, the # mount command mounts the slice having the ufs file system. This is b'coz:

    # cat /etc/default/fs LOCAl=ufs /etc/vfstab 1. This file is editable file, by the root user. 2. Will have the entries of the devices that has to mounted permanently, even after reboots. 3. At the time of booting only this file will be checked. 4. The entries to this file and /etc/mnttab differs.

    OUTPUT:

    # cat /etc/vfstab #device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # fd - /dev/fd fd - no - /proc - /proc proc - no - /dev/dsk/c2t0d0s1 - - swap - no - /dev/dsk/c2t0d0s0 /dev/rdsk/c2t0d0s0 / ufs 1 no - /dev/dsk/c2t0d0s3 /dev/rdsk/c2t0d0s3 /usr ufs 1 no - /dev/dsk/c2t0d0s4 /dev/rdsk/c2t0d0s4 /var ufs 1 no - /dev/dsk/c2t0d0s7 /dev/rdsk/c2t0d0s7 /export/home ufs 2 yes -/devices - /devices devfs - no - ctfs - /system/contract ctfs - no - objfs - /system/object objfs - no - swap - /tmp tmpfs - yes - 5. Will have number of fields a. device to mount = logical name of the device that has to be mounted b. device to fsck = logical name of the raw device is specified to check the file system

    consistency to check the integrity c. mount point = to where the slice has to be mounted d. Fs type = to specify the file system of the slice to be mounted e. fsck pass = to assign the priority f. mount at boot = either "yes" or "no"

    only if the option is "yes" the slice will be mounted after reboot g. mount options = to specify the options of the slice while mounting, for eg: ro, nosuid...

    NOTE:

  • Slash Networks Kamal 28

    /, /usr, /var will have the option mount at boot = no

  • Slash Networks Kamal 29

    Sun Solaris 10 Operating System but, before reading this file entry, those slices will be mounted by running a script. Hence these above 3 were execetption.

    # mountall # umountall will mount all /unmoutall the slices which have the option mount at boot = yes

    Note: 1. After making updations to the file /etc/vfstab we can make the slice available by

    a. # mountall b. # mount

    Eg: # mount /fiv To umount the device: # umount

    or # umount

    Eg: # umount /mnt/slice0

    # umount /dev/dsk/c2t0d0s0 NOTE: Before unmounting make sure, we are away from the mount point.

    To know which user is using the mount point:

    # fuser -cu Eg: # fuser -cu /fiv will display which user is using the specified mount point.

    # fuser -ck Eg: # fuser -ck /fiv will kill all the process related with the specified mount point.

    Then it's possible to umount the slice normally.

    # umount -f # umount -f

    Eg: # umount -f /fiv

    # umount -f /dev/dsk/c2t0d0s5 will forcefull umount the device.

    where -f = forcefully

    To mount the cdrom: Can be performed by 2 methods. 1. mounting the device manually 2. mounting the device using volume management.

  • Slash Networks Kamal 30

  • Slash Networks Kamal 31

    Sun Solaris 10 Operating System

    To mount the device using volume management: # /etc/init.d/volmgt start - To start the service

    # /etc/init.d/volmgt stop - To stop the service

    NOTE: Once if the device (cdrom) is mounted using volume magement, its possible to eject the media, before unmounting.

    The above command will check the configuration file /etc/vold.conf /etc/vold.conf - Volume Management Configuration file which holds the actions to tbe performed.

    vold - is the daemon which will be running at the background while the volume management process is started.

    /etc/rmmount.conf - is the configuration file for the removable media.

    NOTE: 1. Volume management (VOLD) features automatic detection of the CD-ROM. However, it does not detect the presence of diskette that has been inserted in the drive untill volcheck command is run, This command instructs the vold daemon to check the diskettte drive for any inserted media. Volme management can mount ufs, pcfs, hsfs & udfs file system.

    To determine the file system: # mount # cat /etc/default/fs # cat /etc/vfstab # cat /etc/dfs/dfstypes # fstyp /dev/dsk/c2t1d0s7

    To mount the cdrom manually: First determine the logical name of the device: # iostat -En - will provide the information about the removable media where it is connected. For eg: to which controller, target.

    # iostat -en - will provide the above information, along with the hardware and software errors.

    # mount -F -o Eg: # mount -F hsfs -o ro /dev/dsk/c2t6d0s0 /mnt/cdrom

    This mount the cdrom manually. Only after umounting the device, it's possible to eject the media.

    To mount the network resource: # mount -F

  • Slash Networks Kamal 32

  • Slash Networks Kamal 33

    Sun Solaris 10 Operating System

    INSTALLING THE SUN SOLARIS SOFTWARE

    Can install the Sun Solaris Operating System by 1. cd or dvd 2. Jumpstart 3. Flash 4. NFS 5. WLAN

    NOTE: 1. To invoke graphics, mouse has to attached to the system 2. Requires 512 Mb of physical memory (Sun Solaris-10)

    Sun Solaris Cluster Software Group: Cluster = is a collection a. Reduced Networking Support Software Group - SUNWCrnet b. Core System Support Software Group - SUNWCreq c. End User Solaris Software Group - SUNWCuser d. Developer Solairs Software Group - SUNWCprog e. Entire Solaris Software Group - SUNWCall f. Entire Solaris Software Group with OEM - SUNWCXall

    SUNWC = Stanford University Network Worldwide Cluster

    # cat /var/sadm/README this file provides the information about the old software release, install log files and new software release.

    OUTPUT: # cat /var/sadm/softinfo/INST_RELEASE OS=Solaris VERSION=10 REV=0 # cat /var/sadm/install_data/install_log provides number of informations it also provides the information about the Sun Solaris Software Cluster Group installed.

    OUTPUT:

    # cat /var/sadm/system/admin/CLUSTER CLUSTER=SUNWCall will only provide the information about the Sun Solaris Software Cluster Group installed.

  • Slash Networks Kamal 34

  • Slash Networks Kamal 35

    Sun Solaris 10 Operating System

    PACKAGE ADMINISTRATION

    # pkgadd = to install/add the packages # pkgrm = to remove the packages # pkginfo = to gather the information about the installed packages # pkgchk = to check the installed packages to the system # pkgtrans = to create a package cluster

    NOTE: The format of the packge in Sun Solaris is DATASTREAM.

    # pkginfo will provide all the installed, both completely installed and partially installed packes. Displays the information about the packages in 3 coloumns.

    Output trucnated: # pkginfo | more system CADP160 Adaptec Ultra160 SCSI Host Adapter Driver system HPFC Agilent Fibre Channel HBA Driver system NCRos86r NCR Platform Support, OS Functionality (Root) system SK98sol SysKonnect SK-NET Gigabit Ethernet Adapter SK-98xx system SKfp SysKonnect PCI-FDDI Host Adapter system SUNW1251f Russian 1251 fonts system SUNW1394 Sun IEEE1394 Framework system SUNW1394h Sun IEEE1394 Framework Header Files ALE SUNW5xmft Traditional Chinese (BIG5) X Windows Platform minimum required Fonts Package system SUNWGlib GLIB - Library of useful routines for C programming system SUNWGtkr GTK - The GIMP Toolkit (Root) system SUNWGtku GTK - The GIMP Toolkit (Usr) GNOME2 SUNWPython The Python interpreter, libraries and utilities

    1st coloumn = provide the information about the category to which the package belongs too. There are 4 categories available: System, application, CTL (Complex Text Layout), ALE (Alternate Language Environment)

    2nd coloumn = provide the information about the name of the package

    3rd coloumn = provide the short description of the package

    # pkginfo -p provides ONLY the PARTIALLY installed packages

  • Slash Networks Kamal 36

  • Slash Networks Kamal 37

    Sun Solaris 10 Operating System

    # pkginfo -l

    for eg: OUTPUT:

    # pkginfo -l SUNWbash

    PKGINST: SUNWbash NAME: GNU Bourne-Again shell (bash)

    CATEGORY: system ARCH: i386

    VERSION: 11.10.0,REV=2005.01.08.01.09 BASEDIR: / VENDOR: Sun Microsystems, Inc.

    DESC: GNU Bourne-Again shell (bash) version 3.0 PSTAMP: sfw10-x20050108013321

    INSTDATE: Jul 22 2009 14:37 HOTLINE: Please contact your local service provider STATUS: completely installed FILES: 3 installed pathnames

    2 shared pathnames 2 directories 1 executables

    1197 blocks used (approx) will provide the following informations: a. name of the package b. arch of the system to which the package is installed c. category of the package d. base dir to which the package is installed e. how of disk space it's approximately occupied f. when the specified package is installed

    # pkginfo | wc -l will list out how many packages is installed to the system

    # cat /var/sadm/install/contents Provide the information about the packages installed to the system

    # cd /var/sadm/pkg Provide what are the packages installed to the system

    To install a package: Let's consider the OS cd/dvd is mounted under /mnt/cdrom

    # pkgadd -d # pkgadd -d .

    # pkgadd -d /mnt/cdrom/Solaris_10/Product SUNWbash To install a specified package

    # cd /mnt/cdrom/Solaris_10/Product # pkgadd -d . SUNWbash To install the specified package from the current location

    # pkgadd -d /mnt/cdrom/Solaris_10/Product -s SUNWbash will copy the pacakge to the default spool directory.

  • Slash Networks Kamal 38

    Location of the default spool directory = /var/spool/pkg

  • Slash Networks Kamal 39

    Sun Solaris 10 Operating System

    # pkgadd -d /mnt/cdrom/Solaris_10/Product -s /pkg_bkp SUNWbash will copy the specified packaged to the customised location (/pkg_bkp)

    # pkgrm For eg: # pkgrm SUNWbash to remove the specified package

    Package cluster: Package cluster is a collection of packages.

    # pkgtrans -s for eg: # pkgtrans -s /mnt/cdrom/Solaris_10/Product /test.pkg SUNWbash SUNWman will combine the packages and form a software cluster named test.pkg under /

    NOTE: Name of the cluster can be anything.

    To install a package using a software cluster: # cd / # pkgadd test.pkg It'll prompt for the number of package to be installed.

    #pkgchk # pkgchk SUNWbash if the package is installed, nothing will be shown as a output. But if the package is NOT installed, a error report will be generated

    OUTPUT:

    # pkgchk -v SUNWbash /usr /usr/bin /usr/bin/bash will provide the information about the specified package installed path names, executable file and directory.

    # pkgchk -l SUNWbash will display the detailed list about the file names associated with the specified package

    Output truncated: # pkgchk -l SUNWman | more Pathname: /usr/man Type: symbolic link Source of link: ./share/man Referenced by the following packages:

    SUNWdoc SUNWman Current status: installed Pathname: /usr/share

  • Slash Networks Kamal 40

    Type: directory Expected mode: 0755 Expected owner: root

  • Slash Networks Kamal 41

    Sun Solaris 10 Operating System

    Expected group: sys Referenced by the following packages:

    SUNWocfd SUNWcsu SUNWjdmk-base SUNWesu SUNWTiff SUNWjpg SUNWgnome-base-libs-shareSUNWgnome-config-shareSUNWgnome-

    vfs-shareSUNWgnome-libs-share SUNWgnome-help-viewer-shareSUNWcacaort SUNWbrg SUNWj5rt

    SUNWswmt SUNWocf

    SUNWscpu SUNWdtdst SUNWgnome-panel-shareSUNWswupcl SUNWxwsvr SUNWjato SUNWpdas SUNWscgui SUNWgnome-

    terminal-share # pkgchk -p will provide the information about when the file is modified.

    OUTPUT:

    # pkgchk -p /etc/shadow ERROR: /etc/shadow

    modtime expected actual file size expected actual file cksum expected actual

    OUTPUT:

    # pkgchk -l -p /etc/shadow Pathname: /etc/shadow Type: editted file Expected mode: 0400 Expected owner: root Expected group: sys Referenced by the following packages:

    SUNWcsr Current status: installed will provide a. name of the package the specified file is associated with b. permissionship of the file c. ownership and group of the file d. status of the package

    Points to remember:

    # pkginfo -p

    -l where

    -p = provide the partially installed packages -l = provide the detailed information about the packages installed

    # pkgadd -d

  • Slash Networks Kamal 42

    to specify the source directory of the package

  • Slash Networks Kamal 43

    Sun Solaris 10 Operating System

    # pkgtrans -s

    to specify the source directory of the package # pkgchk -v

    to provide the information about the files the specified file is assicated with. # pkgchk -p -p = to specify the path will provide the information about the modified time of the file

    # pkgchk -l -p -l = to privide the detailed information about the file specified -p = to specify the path of the file

  • Slash Networks Kamal 44

    Sun Solaris 10 Operating System

    Patch Administration

    In earlier versions of Solaris OE the format of the patch is .tar

    But the newer releases from Solaris 8 the format of the patch is .zip

    NOTE: Before installing a patch, it's recommended to check whether patch going to be installed is a right patch to fix the problem.

    It's recommended to have a backup of the installed OS. Since the patch is going to directly interact with the kernel (os), the above option is recommended.

    The patches informations will be stored to the location /var/sadm/patch

    # showrev -p # pathchadd -p will display the information about the currenlty installed patches.

    Patches can be downloaded from the site sunsolve.sun.com It can be downloaded through http or by ftp as a anonymous user.

    Patches normally come with numbers

    105050-01.zip

    A B A = is called as the base code B = is the revision number of the patch.

    To install a patch: 1. Unzip the downloaded patch. 2. # patchadd

    # patchadd 105050-01 NOTE: Before installing a patch, soon after unzipping the patch, A README file will be extracted. It's recommended to read that file. That file will provide the information about, which problem will be fixed by installing the patch, pre-requestie to install the patch.

    # patchadd -d # patchadd -d 105050-01 will NOT save the patch to the disk. Once the system is rebooted, the information will be vanished.

  • Slash Networks Kamal 45

    # patchrm # patchrm 105050-01 To remove the installed patch.

    NOTE: # smpatch command can also be used to install the patch.

  • Slash Networks Kamal 46

    Sun Solaris 10 Operating System

    OBP Open Boot PROM

    OBP - Open Boot PROM BootPROM init 0

    all the above are same

    OBP is a firmware. It can be compared with X-86 bios.

    NOTE:

    - The possible values of the boot-device parameter include

    only the following disk, net and cdrom

    - Stop key have the impace/effect on OBP only

    - Can only control the POST only by using the Sun keyboard

    - Sun can replace the NVRAM with the same host id and ehternet address

    - Stop+A kay sequence can cause Solaris OS file system corruption which can be

    difficult to repair. # kbd -t displays the keyboard type

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

    Ok nvramrc NVRAMRC contents are displayed

    OK banner

    displays the system information, inclusing the physical memory, processor, obp version and the system model.

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

    ok boot net - install Jumpstart boot. Boot off the network jumpstart server and install/upgrade the operating system. [NOTE: There is a space both before and after the -. The serves as a place holder argument for the command.]

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

  • Slash Networks Kamal 47

  • Slash Networks Kamal 48

    Sun Solaris 10 Operating System

    Ok boot -r Reconfigure boot. Boot and search for all attached devices, then build device entries for anything which does not already exist. Useful when new devices are added to the system.

    Ok boot -s Single user. Boots the system to run level 1.

    Ok boot -v Verbose boot. Show good debugging information.

    Ok boot -V Verbose boot. Show a little debugging information.

    Ok .enet-addr Displays the enternet address

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

    Ok .speed Display processor and bus speeds

    Ok sync Call the operating system to write information to hard disk drive

    Ok firmware-version Displays major/minor CPU firmware

    Ok reset Reset entire system [similar to performing a power cycle]

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

    Ok set-defaults Reset all the PROM settings to the factory settings

    Ok eject Ejects the drive

    Ok eject cdrom Ok test device Test the specified device

    Ok test net Test the primary network controller

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

  • Slash Networks Kamal 49

    Ok test scsi Test the primary SCSI controller

  • Slash Networks Kamal 50

    Sun Solaris 10 Operating System

    Ok watch-net Monitors network broadcast packets for default interace . for a good packet X for a bad packet

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

    Obdiag Invokes an optional interactive menu tool which lists all self-test methods available on a system; provides commands to run self test. (More for servers and very machine specific. Reference the specific hardware manual for the machine to get additional information on running obdiag.

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

    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 advances to the next line. Control-o = Inserts a new line at the cursor position and stays on the 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 of the line joins 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 the cursor, storing erased characters in the save buffer. Control-w = Erases from beginning of word to just before the cursor, 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, storing the erased characters in a save buffer. Control-u = Erases the entire line, storing the erased characters in a save buffer. Control-y = Inserts the contents of the save buffer before the cursor. Control-q = Quotes the next character (allows you to insert control 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 OpenBoot command interpreter. The temporary buffer is preserved, but is not written back to the script. (Use nvstore to write it back.)

  • Slash Networks Kamal 51

  • Slash Networks Kamal 52

    Sun Solaris 10 Operating System Ok show-devs Display list of installed and probed devices

    Ok show-pci-devs Display all PCI devices

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

    Ok show-tapes Display a list of know tape device drives conneced to the system

    Command hold down the keys/keys during the power-on sequence:

    Stop-A Abort Stop-D Enter detailed diagnostic mode Stop-N Reset NVRAM content to default values

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

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

    OK setenv security-password password Sets the PROM security password to what is specified in the password filed. This password must be between zero and eight characters [any characters after eight are ignored] and the passwords takes effect immediately no reset is required. Once set, if we enter an incorrect password there is a delay of around 10 seconds, before we are able to try again and the security-#badlogins counter is incremented. The password is never shown 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 be 1.none a.No password is required b.Default

    2.command a.All commands expect for boot and go require password

    3.full a.All commands expect for go require the password

  • Slash Networks Kamal 53

  • Slash Networks Kamal 54

    Sun Solaris 10 Operating System 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 to disable it] If we forgot the security password, we may not be able to use our system and must call the vendor for a replacement 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 track of the nuber of failed security password attempts.

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

    Ok banner Display the power-on banner

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

    Ok setenv oem-banner? True Activate the custom banner

    Ok setenv oem-banner? False Restore the original system power-on banner

    OK devalias

    - to view the alias name assigned to the physical device at the Boot PROM monitor mode OK nvalias

    - to assign the alias name to the physical device

    for eg:

    OK nvalias cdrom /pci@8,700000/scsi@6/sd@6,0:f To assign the alias name to the cdrom.

  • Slash Networks Kamal 55

    To remove the alias name: OK nvunalias

  • Slash Networks Kamal 56

    Sun Solaris 10 Operating System

    eg: OK nvunalias cdrom OK sifting

    eg: OK sifting bo it'll act simialr to grep command and search for the keyword 'bo" at OK prompt

    To search/probe for the devices:

    OK probe-scsi

    OK probe-scsi-all

    OK probe-ide

    OK go

    will resume back to the OS, shell, if we have used stop-A key sequence. # eeprom

    - can be used by root user only. - can be used while the system is in the running state - is used to change the environmental variables of OK prompt while

    the system is in the running state. - this will have a impact once the system is restarted - will dispaly only the currently assinged values

    NOTE: where as, OK printenv

    - will display the currently assinged values and the default parameter that can be assinged.

    If auto-boot? false

    at the OK prompt, then, whenever the system is rebooted, OK boot command has to be executed.

    whereas auto-boot? ture

    then the system boots from the default device automatically NOTE: - stop keys will function irrespective of the user account. i.e stop keys are independent. If the machine is at OK prompt, the machine is NOT running, so user account will have no impact.

    - It's not recommended to use stop+A to move to Ok prompt, since it'll abort the process running.

  • Slash Networks Kamal 57

    - To move to OK prompt, execute # init 0

  • Slash Networks Kamal 58

    Sun Solaris 10 Operating System To disable the stop+A sequence:

    1. Edit the file /etc/default/kbd

    Output (Only relevant lines are displayed):

    # Uncomment the following line to disable keyboard or serial device # abort sequences: KEYBOARD_ABORT=disable 2. # kbd -i

    - to initiate the changes done To enable: 1. Edit the file /etc/default/kbd

    Output (Only relevant lines are displayed):

    # Uncomment the following line to disable keyboard or serial device # abort sequences: #KEYBOARD_ABORT=disable 2. # kbd -i

    to initate This is permanent.

    To enable or disable only for the current session: # kbd -a enable # kbd -a disable

  • Slash Networks Kamal 59

  • Slash Networks Kamal 60

    Sun Solaris 10 Operating System

    Bootup & Shutdown Procedures

    Solaris - Run levels

    init - to initate the runlevels

    S or s = System maintenance mode 1 = Single user mode (No network support will be available, only text mode is available) 2 = Multi user mode without NFS support (Only text mode is available) 3 = Default run level. Multi user mode with NFS support in GUI mode 4 = Un used 5 = To shutdown the system 6 = To restart the system 0 = OK prompt mode/OBP mode/BootPROM mode/Forth monitor mode

    Additional information: Linux - Run levels

    S or s = System maintenance mode 0 = To shut down the system 1 = Single user mode 2 = Multi user without NFS support in Text mode 3 = Multi user with NFS support in Text mode 4 = Un used 5 = Default run level. Multi user with NFS support in GUI 6 = To restart the system

    Short comparison:

    Disk administration:

    Solaris Linux # format # fdisk -l Displays the disk availabilty Displays the disks & partitions availability /dev/(r)dsk/c#t#d#s# /dev/hda,/dev/hdb,/dev/sda,/dev/sdb

    # mount /dev/dsk/c#t#d#s# /mnt/slice # mount /dev/hda# /mnt/new # mount -F hsfs /dev/dsk/c#t#d#s# /mnt/cdrom # mount -t iso9660 /dev/cdrom /mnt/cdrom

    File system:

    ufs ext3 # newfs /dev/rdsk/c#t#d#s# # mkfs -t ext3 /dev/hda#

    Mounts & Unmounts:

    /etc/mnttab /etc/mtab /etc/vfstab /etc/fstab

  • Slash Networks Kamal 61

  • Slash Networks Kamal 62

    Sun Solaris 10 Operating System

    Package administation:

    # pkgadd # rpm -ivh # pkginfo # rpm -qa # pkgrm # rpm -e

    Process monitoring:

    # prstat # top

    # free uptime,last,who,w = works with both

    Backup & restore:

    # ufsdump # dump # ufsrestore # restore

    Linux Directory structure:

    / = root /root = root's home directory /home = non-root user's home directory /etc = system configuration directory /dev = logical disk drive informations /mnt = optional directory to mount the devices /opt = optional directory to install 3rd party softwares /usr = unix system resource /var = system logs /media = default mount point for optical media (RHEL5 - Red Hat Enterprise Linux 5) /selinux = security enhanced linux ( Seen in RHEL 5) /lib = library modules /bin = non root user executable binaries /sbin = root user executable binaries /proc = provides system hardware information & generate the pid's /lost+found = used at the time of fsck /boot = have the boot loader information

    Solaris bootup & shutdown procedures:

    To shutdown the system:

    # init 5 # shutdown -g 90 -i 5 Where -g = to specify the grace period -i = to inform the system to move the specified runlevel

    # poweroff

    To restart the system: # init 6 # shutdown -g 30 -i 6

  • Slash Networks Kamal 63

    # reboot

  • Slash Networks Kamal 64

    Sun Solaris 10 Operating System

    Bootup phases:

    1. Boot PROM phase: a. PROM runs POST (Power On Self Test). It checks whether all the devices recives the proper power supply. If not received messages will displayed at the console b. Identifies the first boot device or boot device c. Reads the bootblk from the secondary storage d. Loads the bootbld from the secondary storage to physical memory

    2. Boot Program phase: a. Bootblk loads secondary boot program (ufsboot) b. Kernel identifies the hardware spec - 32 bit or 64 bit, X86/sparc and so on

    Has two part in it Unix - Independent of hardware Genunix - Dependent of hardware

    3. Kernel Initialization phase: a. Reads the entry from the file /etc/system

    Note: This file is recommended NOT to edit b. Kernel initates itself

    4. Init phase: a. Kernel starts the /etc/init

    It has the the services that has to be started at the time of boot /etc/init.d/ list out the number of services that start at the time of boot /etc/inittab Reads this file to identify, in which run level the system has to be started

    After reading the entry of the file accordingly,

    b. It starts rc Scripts rc = run control scripts

    Output truncated: # ls /etc/init.d

    1 boot.server imq mipagent samba PRESERVE README acct

    cachefs.daemon deallocate devlinks

    init.dmi init.sma init.snmpdx

    mkdtab ncakmod ncalogd

    sendmail slpd swupboots

    OUTPUT: # cat /etc/inittab

    # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # The /etc/inittab file controls the configuration of init(1M); for more # information refer to init(1M) and inittab(4). It is no longer # necessary to edit inittab(4) directly; administrators should use the # Solaris Service Management Facility (SMF) to define services instead.

  • Slash Networks Kamal 65

    # Refer to smf(5) and the System Administration Guide for more # information on SMF. #

  • Slash Networks Kamal 66

    Sun Solaris 10 Operating System

    # For modifying parameters passed to ttymon, use svccfg(1m) to modify # the SMF repository. For example: # # # svccfg # svc:> select system/console-login # svc:/system/console-login> setprop ttymon/terminal_type = "xterm" # svc:/system/console-login> exit # #ident "@(#)inittab 1.41 04/12/14 SMI" ap::sysinit:/sbin/autopush -f /etc/iu.ap sp::sysinit:/sbin/soconfig -f /etc/sock2path smf::sysinit:/lib/svc/bin/svc.startd >/dev/msglog 2/dev/msglog /dev/msglog 2/dev/msglog

    Every run level has their own rc scripts dir. /etc/rc#.d/ has the number of services that has to be started/killed when the particular run level invokes

    For eg: OUTPUT:

    # ls /etc/rc2.d/ K03samba K05appserv K06mipagent K15imq K16apache

    K27boot.server README S10lu S20sysetup S40llc2

    S42ncakmod S47pppd S70uucp S72autoinstall S73cachefs.daemon

    S81dodatadm.udaplt S89PRESERVE S94ncalogd S98deallocate

    The scripts starts with "S" will be started The scripts starts with "K" will killed

    The services will be started in sequence.

    This happens in the earlier versions till Solaris 9 But in the case of Solairs-10 SMF - Service Management Faciltiy take care of starting/killing the sevices parallely at the time of boot, which reduces the boot time.

    # who -r will provide the following information a. current run level b. date & time of the last run level change c. number of times at this runlevel since the last rebppt d. previous run level

    OUTPUT:

    # who -r . run-level 3 Aug 12 12:22 3 0 S

  • Slash Networks Kamal 67

    Note: # init q

  • Slash Networks Kamal 68

    Sun Solaris 10 Operating System

    # /etc/telinit q will re-read the /etc/inittab file

    To shutdown/restart:

    /etc/telinit 5 = to shutdown the system /etc/telinit 6 = to restart the system

    To change the run level:

    # init 2 #/etc/telinit 2

    /etc/telinit = is executeable file

    Output:

    # file /etc/telinit /etc/telinit: ELF 32-bit LSB executable 80386 Version 1, dynamically linked, stripped

  • Slash Networks Kamal 69

  • Slash Networks Kamal 70

    Sun Solaris 10 Operating System

    BOOT LOADER - GRUB GRUB - GRand Unified Bootloader

    Grub is stored to the /boot directory. Seen only on the X86 arch machines. Provides the option to interact with the system to choose an operating system to work in case of more than one operating system is installed.

    Terminology: 1. Boot Loader:

    eg: Grub - solaris, linux (very popular boot loader) Lilo - Linux Loader Boot.ini - windows

    Always the boot loader will be residing at the starting location of the disk which is having the operating system.

    Note: GRUB can be compared with bootblk in Sparc arch.

    The boot loader is the first software program that runs after you turn on a system. This program begins the boot process.

    2. Boot archive: A boot archive is a collection of critical files that is used to boot the solaris os. Two boot archives are maintained by the system

    a. Primary boot archive - Used to boot the Solaris OS on the system b. Solaris Fail Safe - Used for recovery when the primary boot archive is damaged.

    On X86 based systems, the miniroot is copied to the system to be used as failsafe boot archive.

    3. Grub edit menu: Located under /boot/grub Name of the file = menu.lst Can be edited by the root user, and edtions will have the impact only on the next reboot. This menu.lst file (boot menu file) lists the operating systems taht are installed on a system.

    Note: 1. If we install an operating system other than the Solaris OS, we must modify/edit the /boot/menu.lst file manually to include the new installed OS instance. Adding this entry will provide the option on next reboot.

    2. The default OS is usually the first entry that is displayed in the grub menu.

    Eg: Entry from the file /boot/grub/menu.lst

  • Slash Networks Kamal 71

  • Slash Networks Kamal 72

    Sun Solaris 10 Operating System Output displayed in only relevant to the topic:

    bash-3.00# bootadm list-menu The location for the active GRUB menu is: /boot/grub/menu.lst default 0 timeout 10 0 Solaris 10 11/06 s10x_u3wos_10 X86 1 Solaris failsafe From the above output, The default option is 0 -> Solaris 10 11/06 s10x_u3wos_10 X86 The default sec, that the grub menu displayed to the user is 10 sec.

    To make the grub menu displayed untill, the option is choosen, edit the /boot/grub/menu.lst file

    OUTPUT:

    # vi /boot/grub/menu.lst # default menu entry to boot default -1 This makes the grub to be displayed out of time.

    Output from the file /boot/grub/menu.lst - Only relevant information is displayed

    #---------- ADDED BY BOOTADM - DO NOT EDIT ---------- title Solaris 10 11/06 s10x_u3wos_10 X86 root (hd0,0,a) kernel /platform/i86pc/multiboot module /platform/i86pc/boot_archive #---------------------END BOOTADM-------------------- #---------- ADDED BY BOOTADM - DO NOT EDIT ---------- title Solaris failsafe root (hd0,0,a) kernel /boot/multiboot kernel/unix -s module /boot/x86.miniroot-safe Here, Once the default option is selected, i.e 0, then, the menu.lst will read the following, root (hd0,0,a)

    1 2 3 where 1 = First hard disk drive. (In the case of second disk drive hd1) 2 = First partition (bootable partition) 3 = First slice

  • Slash Networks Kamal 73

    Precedence of before and after grub:

  • Slash Networks Kamal 74

    Sun Solaris 10 Operating System

    ON -> BIOS -> GRUB (Stage1 & stage2) -> OS kernel (Multi-boot,boot-archive-unix) -> sched (PID:0) -> init (PID:1) -> SMF (PID:7)-> Invokes the services.

    This is how the Grub boots.

    stage1 = installed on the first sector of the solaris fdisk partition stage2 = installed in a reserved area in the solaris fdisk partition. Is the core image of the GRUB. menu.lst = is typically located to /boot/grub directory. GRUB stage2 file reads the menu.lst file.

    How to boot the system to single usermode from grub:

    1. Once the grub screen is displayed, use arrow keys to select, then press 'e' to edit accordingly.

    For instance 0 Solaris 10 11/06 s10x_u3wos_10 X86 1 Solaris failsafe if we choose 0, then pressed 'e' then, root (hd0,0,a) kernel /platform/i86pc/multiboot module /platform/i86pc/boot_archive

    now choose the second line and edit as,

    To boot the system in single user mode from the grub menu:

    kernel /platform/i86pc/multiboot -s

    now press, 'esc' followed by 'b' to boot the system in single user mode.

    Similarly, to boot the system in reconfiguration mode, edit as kernel /platform/i86pc/multiboot -r can be compared with sparc: OK boot -r

    To boot the system with milestone options:

    kernel /platform/i86pc/multiboot -m milestone=single-user

    can be compared with sparc: OK boot -m milestone=single-user

    To boot the system in verbose mode:

  • Slash Networks Kamal 75

    kernel /platform/i86pc/multiboot -m verbose

  • Slash Networks Kamal 76

    Sun Solaris 10 Operating System To boot the system in interactive mode:

    kernel /platform/i86pc/multiboot -a can be compared with sparc: OK boot -a

    Properties of Failsafe boot archive: 1. Is self sufficient 2. Can boot on its own 3. Is created by default during installation on the OS 4. Requires no maintenance

    Contents of the primary boot-archive/failsafe boot archive: 1. All of the kernel modules, driver.conf files, plus a few configuration files located to /etc directory.

    The kernel reads the file in the boot archive before the root / file system is mounted. After the root / file system is mounted, the kernel discards the boot archive form the memory.

    Output:

    bash-3.00# bootadm list-archive etc/rtc_config etc/system etc/name_to_major etc/driver_aliases etc/name_to_sysnum etc/dacf.conf etc/driver_classes etc/path_to_inst etc/mach etc/devices/devid_cache etc/devices/mdi_scsi_vhci_cache etc/devices/mdi_ib_cache kernel platform/i86pc/biosint platform/i86pc/kernel boot/solaris.xpm boot/solaris/bootenv.rc boot/solaris/devicedb/master boot/acpi/tables list the archive files related to boot.

  • Slash Networks Kamal 77

    Sun Solaris 10 Operating System

    Output:

    # cat /boot/solaris/bootenv.rc # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "@(#)bootenv.rc 1.32 05/09/01 SMI" # # bootenv.rc -- boot "environment variables" # setprop kbd-type US-English setprop ata-dma-enabled 1 setprop atapi-cd-dma-enabled 0 setprop ttyb-rts-dtr-off false setprop ttyb-ignore-cd true setprop ttya-rts-dtr-off false setprop ttya-ignore-cd true setprop ttyb-mode 9600,8,n,1,- setprop ttya-mode 9600,8,n,1,- setprop lba-access-ok 1 setprop prealloc-chunk-size 0x2000 setprop bootpath /pci@0,0/pci-ide@5/ide@0/cmdk@0,0:a setprop console 'text' Will provide the boot path of the physical device, from which the opearting system is loaded.

  • Slash Networks Kamal 78

  • Slash Networks Kamal 79

    Sun Solaris 10 Operating System

    SMF Service Management Facility SMF - Service Management Facility an important feature of Sun Solaris 10 0S.

    Runs with the daemon: svc.startd with the process id-7

    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 dependencies 4.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/log 7.Defines a Fault Management Resource Identifier [FMRI].

    FMRI provide categories of services a.network b.milestone

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

    SMF checks the services on the following category: 1. application 2. network 3. devices 4. system 5. platform 6. site 7. milestone

    Status of the SMF:

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

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

    Legacy_run - > the services are not controlled by SMF Legacy_run: The legacy service is not managed by SMF, but can be observed. This state is only used by legacy services that are started with RC scripts

    Maintenance -> this state needs rootss interrogation. In this case the services has to be make available manually

  • Slash Networks Kamal 80

    Maintenance: The service instances has encountered an error that must be resolved by the administrator

  • Slash Networks Kamal 81

    Sun Solaris 10 Operating System Offline -> Services are enabled but not running Offline: The service instance is enabled; the service is not yet running or available to run.

    Online -> Services are enabled and its running Online: The service instance is enabled and has successfully started.

    Uninitialized: This state is the initial state for all services before their 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. # svccfg - Service configuration

    Permits interaction with service configuration database svc.startd - Is the default service manage/restarter

    inetadm - Is the default, delegated service restarter for INETD daemon

    Monitoring the services:

    # svcs -a

    -a option will display all services, including disabled services. Output truncated: # svcs -a STATE STIME FMRI legacy_run 14:42:55 lrc:/etc/rcS_d/S50sk98sol legacy_run 14:42:59 lrc:/etc/rc2_d/S10lu legacy_run 14:42:59 lrc:/etc/rc2_d/S20sysetup legacy_run 14:42:59 lrc:/etc/rc2_d/S40llc2 . . . disabled 14:42:57 svc:/network/rexec:default disabled 14:42:57 svc:/network/shell:default disabled 14:42:57 svc:/network/shell:kshell disabled 14:42:57 svc:/network/talk:default online 14:42:49 svc:/system/svc/restarter:default online 14:42:50 svc:/system/installupdates:default online 14:42:50 svc:/network/pfil:default online 14:42:50 svc:/milestone/name-services:default online 14:42:50 svc:/network/loopback:default online 14:42:50 svc:/system/filesystem/root:default

  • Slash Networks Kamal 82

    Sun Solaris 10 Operating System # svcs List out that are the services running (online), status of the service, FMRI

    Output truncated: # svcs STATE STIME FMRI legacy_run 14:42:55 lrc:/etc/rcS_d/S50sk98sol legacy_run 14:42:59 lrc:/etc/rc2_d/S10lu legacy_run 14:42:59 lrc:/etc/rc2_d/S20sysetup legacy_run 14:42:59 lrc:/etc/rc2_d/S40llc2 legacy_run 14:42:59 lrc:/etc/rc2_d/S42ncakmod legacy_run 14:42:59 lrc:/etc/rc2_d/S47pppd legacy_run 14:42:59 lrc:/etc/rc2_d/S70uucp legacy_run 14:42:59 lrc:/etc/rc2_d/S72autoinstall . . . online 14:42:49 svc:/system/svc/restarter:default online 14:42:50 svc:/system/installupdates:default online 14:42:50 svc:/network/pfil:default # svcs -l

    -l option will give detailed information about a service, includes the FMRI, status of the service,

    bane if the service, when it was started. Eg: svcs -l network

    # svcs -l Eg: # svcs -l telnet

    Output: # svcs -l telnet bash-3.00# svcs -l telnet fmri svc:/network/telnet:default name Telnet server enabled true state online next_state none state_time Mon Aug 24 14:42:57 2009 restarter svc:/network/inetd:default # svcs -d

    -d option lists the services or service instances upon which the given service instance depents.

    Eg: svcs -d milestone/network:default

  • Slash Networks Kamal 83

    svcs -d milestone/multi_user svcs -d network/inetd

  • Slash Networks Kamal 84

    Sun Solaris 10 Operating System Output truncated: bash-3.00# svcs -d milestone/multi-user STATE STIME FMRI disabled 14:42:50 svc:/network/ntp:default disabled 14:42:50 svc:/system/auditd:default disabled 14:42:50 svc:/system/mdmonitor:default disabled 14:42:50 svc:/system/rcap:default online 14:42:50 svc:/milestone/name-services:default online 14:42:52 svc:/system/name-service-cache:default online 14:42:52 svc:/system/rmtmpfiles:default online 14:42:53 svc:/system/power:default # svcs -D

    -D option will display the other services depends on a given service. eg: svcs -D milestone/multi-user

    Output: bash-3.00# svcs -D milestone/multi-user STATE STIME FMRI disabled 14:42:50 svc:/network/dhcp-server:default disabled 14:42:50 svc:/application/management/common-agent-container- 1:default online 14:43:05 svc:/milestone/multi-user-server:default online 14:43:28 svc:/system/webconsole:console # svcs -p

    -p option is to view the processes associated with a service instance. eg: svcs -p svc:/network/inetd:default.

    Output: bash-3.00# svcs -p network/inetd:default STATE STIME FMRI online 14:42:56 svc:/network/inetd:default

    14:42:56 288 inetd # svcs -x

    If a service fails for some reason and can not be restarted, you can list the service using the x option.

    Output: bash-3.00# svcs -x telnet svc:/network/telnet:default (Telnet server) State: online since Mon Aug 24 14:42:57 2009

    See: in.telnetd(1M) See: telnetd(1M)

    Impact: None.

  • Slash Networks Kamal 85

  • Slash Networks Kamal 86

    Sun Solaris 10 Operating System

    Service Administration: [using svcadm]

    # svcadm - manipulate service instances

    # svcadm enable Starts the service Eg: # svcadm enable telnet

    # svcadm disable Disables the service eg: # svcadm diable telnet

    # svcadm enable -t Starts the service temp, for this session. When restarted the service will no longer available Eg: # svcadm enable -t telnet

    Output: bash-3.00# svcadm disable -t telnet bash-3.00# svcs -l telnet fmri svc:/network/telnet:default name Telnet server enabled false (temporary) state disabled next_state none state_time Mon Aug 24 16:44:23 2009 restarter svc:/network/inetd:default # svcadm enable -s Will start all the instance that is associated with specified FMRI # eg: # svcadm enable -s telnet

    # 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 => run level S of previous versions of Solaris milestone/multi-user => run level 2 of previous version of Solaris milestone/multi-user-server => run level 3 of previous versions of Solaris.

    Note: 1. The svc.stard daemon can obtain information about the services from the repositry. This was

  • Slash Networks Kamal 87

    previously the responsibilty of init process. 2. svc.stard daemon takes on the role of starting the appropritae process for the achieved run level.

  • Slash Networks Kamal 88

    Sun Solaris 10 Operating System

    3. A corrupt repositry prevents the system from booting. 4. Configuration information about the services and system is stored to /etc/svc/repository.db

    To restore when the SMF repository is corrupted: # cd /lib/svc/bin # ./restore_repositry

    To work with svccfg configuration of smf:

    Output truncated: bash-3.00# svccfg svc:> select network svc:/milestone/network> select telnet svc:/network/telnet> listprop general framework general/entity_stability astring Unstable general/restarter fmri svc:/network/inetd:default inetd framework inetd/endpoint_type astring stream inetd/isrpc boolean false inetd/name astring telnet inetd/proto astring tcp6 inetd/stability astring Evolving inetd/wait boolean false

    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.conf 3.inetadm permits control of key/value or ns of services ame/value pair

    /etc/svc - directory have the informations about the smf services and its repository database.

    /etc/svc/repository.db will have the data base about the services. It is used to check the integrity of the services.

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

  • Slash Networks Kamal 89

    SMF repository

  • Slash Networks Kamal 90

    Sun Solaris 10 Operating System # 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 service Eg: # inetadm -d telnet

    # inetadm -e To enable the specified service Eg: # inetadm e telnet

    # inetadm -p Displays the global setttings

    # inetadm -l telnet

    Output: bash-3.00# inetadm -l telnet SCOPE NAME=VALUE

    name="telnet" endpoint_type="stream" proto="tcp6" isrpc=FALSE wait=FALSE exec="/usr/sbin/in.telnetd" user="root"

    default bind_addr="" default bind_fail_max=-1 default bind_fail_interval=-1 default max_con_rate=-1 default max_copies=-1 default con_rate_offline=-1 default failrate_cnt=40 default failrate_interval=60 default inherit_env=TRUE default tcp_trace=FALSE default tcp_wrappers=TRUE

    Note: The scope values cannot be changed.

    To change the default value:

    # inetadm -M tcp_trace=TRUE Output: bash-3.00# inetadm -M tcp_trace=TRUE bash-3.00# inetadm -l telnet SCOPE NAME=VALUE

    name="telnet"

  • Slash Networks Kamal 91

    endpoint_type="stream"

  • Slash Networks Kamal 92

    Sun Solaris 10 Operating System Page 65 of 145

    proto="tcp6" isrpc=FALSE wait=FALSE exec="/usr/sbin/in.telnetd" user="root"

    default bind_addr="" default bind_fail_max=-1 default bind_fail_interval=-1 default max_con_rate=-1 default max_copies=-1 default con_rate_offline=-1 default failrate_cnt=40 default failrate_interval=60 default inherit_env=TRUE default tcp_trace=TRUE default tcp_wrappers=TRUE # netservices open 1. Will open or enable all the network related services 2. Needs the system to be restarted.

    Output: bash-3.00# netservices open restarting syslogd restarting sendmail restarting wbem bash-3.00# cd /var/svc/profile/ bash-3.00# ls -l generic.xml lrwxrwxrwx 1 root root 18 Aug 24 16:59 generic.xml -> ./generic_open.xml To check: # svcs -a | grep ftp

    Output: bash-3.00# svcs -a | grep ftp online 16:47:14 svc:/network/ftp:default # netservices limited 1. Will disable all ther services except ssh. 2. Need the system to be restarted

    Output: bash-3.00# netservices limited restarting syslogd restarting sendmail restarting wbem dtlogin needs to be restarted. Restart now? [Y] n dtlogin not restarted. Restart it to put it in local-mode. bash-3.00# cd /var/svc/profile/ bash-3.00# ls -l generic.xml

  • Slash Networks Kamal 93

    lrwxrwxrwx 1 root root 25 Aug 24 17:02 generic.xml -> ./generic_limited_net.xml

  • Slash Networks Kamal 94

    Sun Solaris 10 Operating System To check: # svcs -a | grep ftp disabled 17:02:01 svc:/network/ftp:default But, # svcs -a | grep ssh online 14:42:58 svc:/network/ssh:default

  • Slash Networks Kamal 95

  • Slash Networks Kamal 96

    Sun Solaris 10 Operating System

    File permissions

    r= read w=write x=execute

    u = owner of the file g = group o = others a = all + = to add the permissionship - = to remove the permissionship = = to assign the permissionship

    # chmod To change the file and directory permissionship

    # chown To change the ownership of the files and directories

    # chgrp To change the group of the files and directories

    # chmod 777 dir1

    ABC A = defines the permissionship for the user/owner B = defines the permissionship for the group C = defines the permissionship for others

    or # chmod a+rwx dir1 This command will assign or add the following permissionship rwx = owner of the directory rwx = group permission to which the dir/file belong to rwx = other permission

    # chmod 644 file1 # chmod u+rw,g+r,o+r fil2 This command assign the permission as follows: rw- = owner of the file/dir r-- = group permission to which the dir/file belong to r-- = other permission

    Note: 1. # chown and

    # chgrp commands can be used only by the root user.

    # chown Kamal dir1 Here ownership of the dir/file named "dir1" is changed to kamal. Here the ownership changed only to the parent directory.

  • Slash Networks Kamal 97

    # chown -R Kamal dir

  • Slash Networks Kamal 98

    Sun Solaris 10 Operating System

    The owneship will be changed to the parent directory and for the sub-directories and files inside the dir "dir1" -R = recurrsive

    # chgrp admin dir1 Here the group has been changed to "admin" for the directory "dir1" The group is changed only to the parent directory

    # chgrp -R admin dir1 will change the group to the parent directory and all its sub-directories and files.

    # chown hari:admin dir2 will change the ownership and group for the directory "dir2". Only the parent directory "dir2" ownership and group is changed.

    #