Linux menu

Saturday, September 20, 2014

Solaris Basic Interview Questions Part 1


Intent of this post is to help the person who are going to attend the basic level of Solaris interview. Few of Basic Solaris Admin’s related Question and Answers are given below, I hope this will help you to refresh your basic knowledge before attending the interview. Most of the time we very much strong in all components, however basic level of knowledge is one of our key point while attending interview.

Please go through the below link to find the User Management Interview Questions
Solaris Basic Interview Questions and Answers:

1. Brief about init phases ?
There are 8 run level.
Init0: Shutting down the system and bring back the system to OBP Prompt (OK)
Init1: Single user mode for administrative
Init2: Multi user mode without resource sharing
Init3: Multi user mode with resource sharing
Init4: Not in use
Init5: Shutdown and power off the system
Init6: Reboot the system to default run level
Inits: Single user mode but user login are disabled


2. What is the difference between init 1 and init s ?
If you switch from multiuser mode to init s and switch it back to multiuser mode.then remote useres automatically reconnects to the system. where as in the case of init 1. they have to reconnect manually means they have to relogin 

3. Explain the boot process? 
Boot process dived into 4 phases. 
POST 
Power on self test (POST), It will detect hardware, machine host ID,serial No, architecture type, memory and Ethernet address and it will load the primary program called bootblk. 
OBPROM 
Open boot programmable 
Diagnosing all the system hardware and memory. 
Initializing the boot parameter. 
Creating device trees and load the boot block from (0-15 sector), it is called as secondary boot -- programmable ufsboot. 
KERNEL INITIALIZATION 
ufsboot load the kernel (generic unix) 
kernel will load all the necessary devices modules to mount the root partition to continue the booting process 
INIT PHASES
It will started by executing of /etc/init program and start other process reading the /etc/inittab files, as the directory in the /etc/inittab files. 

4. Describe about FSCK ?
FSCK Utility is for checking and repairing the files system inconsistencies, It has 5 phases
Phase 1: Check Blocks and Sizes - checks inodes for inconsistencies
Phase 2: Check Path-Names - checks directory <-> inode consistencies
Phase 3: Check Connectivity - checks that all directories are connected to the file system
Phase 4: Check Reference Counts - compares link count information from Phases 2 & 3, correcting discrepancies
Phase 5: Check Cylinder Groups - checks free blocks and the used inode maps for consistency
Phase 6: Salvage Cylinder Groups - update the tables to reflect any changes made in earlier passe
s

5. What is the difference between dsk and rdsk ?
dsk: Block level devices, FS Which are formatted and mounted that device is called block device.
rdsk: Raw level device or character level device


6. Explain about Port of Telnet, ssh, ftp, http, nfs, ntp?
ftp port is  21
ssh port is 22
Telnet port is 23 
ntp port is 123

smtp port is 25
printer port is 515

7. How to view VTOC (Volume Table Of Contents) ? and How to copy ?
Print the VTOC
# prtvtoc /dev/rdsk/c0t0d0s2

Copy the VTOC to other disk
# prtvtoc /dev/rdsk/c0t0d0s2|fmthard -s - /dev/rdsk/c1t0d0s2

8. Type of Filesystems
Disk Based FS : ufs  (Unix FS), hsfs (High Sierra FS), pcfs (PC FS for DOS FAT32), udfs : Universal Disk Format FS  
Network FS      : nfs (Network FS) 
Memory based FS (Pseudo FS) :  tmpfs, swapfs, procfs, mntfs

9. How to find the reserved space of disk ?
# fstyp –v /dev/rdsk/c1d0s0 | grep minfree
minfree 6%   


10. How to reduce the reserved space of the disk ?
This will reduce the reserved space to 2%
# tunefs –m 2 /dev/rdsk/c1d0s0 


11. Brief filesystem structure ?
VTOC present in the first sector in the raw disk area.
VTOC - 512 sector
Boot Block - 1-15 sector
Super Block - 16-31
First Cylinder Group - 32 


12. How to View the location of alternative backup SuperBlocks?
# newfs –N /dev/rdsk/c0t0d0s2 
Example:
bash-3.2 unixrock# newfs -N /dev/rdsk/c1t2d0s2
Warning: 2130 sector(s) in last cylinder unallocated
/dev/rdsk/c1t2d0s2:     4194222 sectors in 683 cylinders of 48 tracks, 128 sectors
        2048.0MB in 43 cyl groups (16 c/g, 48.00MB/g, 11648 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
 3248288, 3346720, 3445152, 3543584, 3642016, 3740448, 3838880, 3937312,
 4035744, 4134176
bash-3.2 unixrock#

13. How to retrieve the corrupted partition ?
# fsck -F ufs –o b=32 /dev/rdsk/c0t0d0s2 

14. Brief /etc/vfstab ? 
Virtual File System Tab /etc/vfstab  file lists all the FS to be automatically mounted at system boot time
device to mount   device to fsck   mount point   FS type   fsck pass   mount at boot   mount options

15. Brief /etc/mnttab ?
/etc/mnttab file is a mntfs file that provides read-only info about mounted FS on the local server.

16. How to check installed packages?
# pkginfo |more
pkginfo –l <pkgname>
Example:
[root@unixrock] ~# pkginfo -l SUNWman
   PKGINST:  SUNWman
      NAME:  On-Line Manual Pages
  CATEGORY:  system
      ARCH:  sparc
   VERSION:  43.0,REV=75.0
   BASEDIR:  /usr
    VENDOR:  Sun Microsystems, Inc.
      DESC:  System Reference Manual Pages
    PSTAMP:  2004.12.21.15.30
  INSTDATE:  Feb 18 2009 10:08
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:    12617 installed pathnames
                  22 shared pathnames
                 195 directories
               69132 blocks used (approx)

[root@unixrock] ~#

17. How to remove the installed package ?
# pkgrm <pkgname>
Example:
# pkgrm SUNWzip

18. How to view the installed patches ? which file its contains the details?
# showrev -p or # patchadd -p 
/var/sadm/patch  : Contains informations about all patches that are currently installed.

19. How to add the Patch ? How to remove the Patch?
# patchadd 105050-01
# patchrm 105050-01

NOTE: 
When you remove a patch, the patchrm command restores all files that were modified or replaced by that patch, unless the patch was installed with the patchadd –d option (Which instructs the patchadd command not to save copies of files being updated or replaced). The patch is required by the another patch.
The patch has been obsoleted by a later patch.


20. How to check the OBP (Open Boot PROM) version ?
# /usr/platform/’uname –m’/sbin/prtdiag –v 

21. What is the different between probe-scsi and probe-scsi-all ?
ok probe-ide        Shows ide details and device connected
ok probe-scsi       Shows scsi details and device connected
ok probe-scsi-all  Identifies devices on all SCSI buses (Internal and External
ok probe-fcal-all  Identifies devices on all fibre channel loops


22. How to KILL the process?
Default signal is 15
1 SIGHUP Hangup (Stop & start with the same pid)
2 SIGNT Interrupt
9 SIGKILL Kill (Kill forcibly)
15 SIGTERM Terminate (Kill properly)

# pkill -1 (or) –HUP sendmail
# kill –SIGTERM (or) -15 <pid>
# kill –SIGKILL (or) -9 <pid>
# kill –SIGHUP (or) -1 (or) –HUP <pid>


23. About Crontab
0-59     0-23     1-31     1-12       1-7     <command>
Min      Hour      Date     Month   Days

# crontab –l : View content of user crontab file
# crontab –e : Editing the file
# crontab –r username : Remove the crontab

/etc/cron.d/cron.deny :     Users who listed in this file will deny access to use crontab command
/etc/cron.d/cron.allow :     Users who listed in this file will allow access to use crontab command
/var/spool/cron/crontabs : Directory where users crontab schedule files are getting stored.

24. How to view the system's release informations?
/etc/release file is contains those details.
[root@unixrock ~]# cat /etc/release
                   Oracle Solaris 10 9/10 s10s_u9wos_14a SPARC
     Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
                            Assembled 11 August 2010
[root@unixrock ~]#

25. How to add swap space in running system?
Adding Swap Space
# vi /etc/vfstab
/dev/dsk/c1t0d0s1 - - swap - no -

To add swap space from disk slice.
# swap –a /dev/dsk/c1t0d0s1 

Adding Swap File
Swap file allocation
# mkfile 20m /export/data/swapfile
# swap –a /export/data/swapfile
To list the details of the modified system swap space
# swap –l
List a summary of the modified system swap space
# swap –s 
Add the entry in /etc/vfstab
# vi /etc/vfstab
/export/data/swapfile - - swap - no -

Removing Swap Space and also remove entry from vfstab
# swap –d /dev/dsk/c1t0d0s3 
Removing Swap File and also remove entry from vfstab
# swap –d /export/data/swapfile
# rm /export/data/swapfile

26. Brief about Crash Dump ?
Crash Dump : When an OS has a fatal error, it generates a crash dump file (crash dump).
It places kernel core info in the /var/crash/nodename/vmcore.X file 
It places name list info & table info in the /var/crash/nodename/unix.X file
dumpadm Command to view the current dump configurations which extract from /etc/dumpadm.conf 

27. Brief about Core Dump ?
Core Dump : A core file is a point-in-time copy (snapshot) of the RAM allocated to a process. The copy is written to a more permanent medium, such as a HDD. A core file is useful in analyzing why a particular program crashed. When a core file occurs, the OS generated two possible copies of the core files, one copy known as the global core file and the other copy known as per process core file
coreadm command to view the current dump configurations from /etc/coreadm.conf

28. What is Zombie process? 
"Zombie" processes is also known as "Defunct" Processes. Due to the errors/bugs some of the processes didnt kill even after cleared all it's related processes. It's consider as a dead processes which are still consuming memory. We have to kill those defunct/zombie process in order to free Memory and make system Normal.

29. What is orphan Process?
An Orphan process which runs even after parent process is terminated and these processes doesn’t know what to do and when to terminate.

30. What is the different between "Zombie" and "Orphan" Processes?
Zombie : Its a dead processes which is no execution.
Orphan : Its a live processes which is still in execution state even without parent process.

31. Important file of NFS server?
/etc/dfs/dfstab             Lists the local resources to share at boot time
/etc/dfs/sharetab          Lists the local resources currently being shared.
/etc/dfs/fstypes            Lists the default FS types for remote FS
/etc/rmtab                   Lists FS remotely mounted by NFS clients
/etc/nfs/nfslog.conf      Lists info of the location of config logs used for NFS server logging
/etc/default/nfslogd      Lists config info describing the behavior of the nfslogd daemon


32. Brief about NFS Server and NFS Client Daemons?
NFS Server Daemons :
mountd      Handles FS mount requests from remote systems, and provides access control
nfsd           Handles client FS requests
statd          Works with the lockd daemon to provide crash recovery functions for the lock manager
lockd         Supports record locking operations on NFS files
nfslogd       Provides operational logging


NFS Client Daemons :
statd        Works with the lockd daemon to provide crash recovery functions
lockd       Supports record-locking operations on NFS files


33. Brief about RBAC (Role Based Access Control)

34. What is OBP ? How to check the OBP version ?
OBP : Open Boot PROM (Programmable Read-Only Memory), While booting the server, OBP firmware will load immediatly which is stored in the boot PROM of the system. this primary role is that it boot the server either Mass Storage device or from a Networks.
# prtconf -V|grep -i obp
OBP 4.33.5.d 2012/07/18 06:55
# prtdiag -v|grep -i obp
OBP 4.33.5.d 2012/07/18 06:55
35.  How to check the processor information ?
psrinfo         : Determining Processor status whether its Online.
psrinfo -p     : Display the number of physical processors in a system.
psrinfo -v     : Verbose mode. Displays additional information about the processors.
psrinfo -pv   : Display additional information about each physical processors.
isainfo -b      : Prints the number of bits in the address space of the native instruction set.


36. How to check the Network speed/mode ?
Solaris 10
# dladm show-dev
# dladm show-aggr

Solaris 9
# ndd -get /dev/interface link_speed
# ndd -get /dev/interface link_mode
37.  How to check the Disk I/O ?
# iostat -xnC
We have to concentrate the value against "asvc_t" (average service time of  active  transactions). 

38.  How to check the Free Swap and Free Memory?
root@unixrock ~ # sar -r 1 5
SunOS unixrock 5.10 Generic_147147-26 sun4u    12/30/2013
12:29:50 freemem freeswap
12:29:52 939201 8586941
12:29:55 939364 8587208
12:29:57 939385 8587263
12:29:59 939479 8587423
12:30:01 939173 8586692

Average  939326 85871201
root@unixrock ~ #
Below is the way to calculate
                                FreeMEM*pagesize/1024/1024/1024
Free memory in GB =939201*8192/1024/1024/1024=7.16GB

FreeSwap*512/1024/1024/1024
Free swap in GB=8586941*512/1024/1024/1024=4.09GB
39.  How to Check the HBA Card Status?
# luxadm -e port
# luxadm -e dump_map <phyiscal Path>
# fcinfo hba-port
# fcinfo remote-port -sl -p <HBA_port_WWN>

40.  Different between Hard and Soft Mount ?
Hard Mount : Hard mount is Default, NFS client keep trying to mount the NFS shares if its not available, this may cause application hung. However it will mount the NFS share automatically once its is available.

Soft Mount: NFS client will try to mount the NFS share for the particular period and then it won't try. 



41.  Difference between TAR and UFSDUMP ?
UFSDUMP can be used either mounted or umounted Filesystem.
UFSDUMP will take complete file system backup which is including Block device and Spl Characters files

TAR can be used only when the FS is mounted status.
TAR Used for single and multiple file backup
TAR will not backup Block device and Special Charecters files.


42.  Difference between Cron and At jobs?
Cron     : Repetitive schedule can be done
At Jobs : Only One time schedule 

43.  Brief about NTP (Network Time Protocol) ?
Details about NTP

44.  How to troubleshoot, if sendmail is not working ?
Sendmail troubleshoot 

45. Brief about RBAC (Role Based Access Control) ?
Details about RBAC

46. Brief about ACL (Access Control List ) ?
Details about ACL

47. Deamons of NIS  Client and NIS server?

NIS Server Deamons:
ypserv                Responds to client information requests
ypbind               Client to server binding
rpc.yppasswd    Password change update in master server
ypxfrd                Push the map to slave servers (sync)
rpc.ypupdated   Update NIS maps using the config stored in /var/yp/updates

NIS Slave Deamons:
ypserv                Responds to client information requests
ypbind               Client to server binding

NIS Client Deamons:
ypbind               Client to server binding

48. How do you recover root password on a server?
Step 1 : Insert Solaris CD in cd drive and from ok prompt run command: boot cdrom -s
Step 2 : This will take you single user mode
Step 3 : Run Fsck in root FS.
# fsck -y /dev/rdsk/c0t0d0s0
Step 3 : Mount the Root Fs on /mnt and edit the /etc/shadow file
# mount /dev/dsk/c0t0d0s0 /mnt 
# TERM=vt100;export TERM 
# EDITOR=vi;export EDITOR
Step 4 : Remove the encrypted Root Passwd and reboot
# vi /mnt/etc/shadow 
# cd / 
# umount /mnt 
# init 6 

Step 5 :You will be prompted for password for root.

49. How to check the Nework statistic ?
# netstat -i 
root@unixrock ~$ netstat -i 1 5
    input   aggr1     output       input  (Total)    output
packets errs  packets errs  colls  packets errs  packets errs  colls
29932   0     195599  0     0      54706   0     44334   0     0
15      0     109     0     0      28      0     122     0     0
20      0     106     0     0      36      0     122     0     0
4       0     0       0     0      33      0     29      0     0
11      0     0       0     0      11      0     0       0     0
root@unixrock ~$

50. What is Inode? 
Inode : Inode which contains all the information about the file in File system that are created when a file system is created. Each file having an inode which provides the important information on files such as User and group Ownership, access mode (Read, Write, Execute permissions) and Type.

ls -li command will show the inode numbers.

No comments: