Latest Solaris Commands Interview Questions
Q – 1 What is the metasets in Solaris?
Ans- Collection of metadevices which have their own metadb
Q – 2 What is the difference between /var/adm/ and /var/sadm directory contains in solaris?
Ans- /var/adm directory contains Administration information
i)system crashes
ii) accounting information for eace user
iii)Logins
/var/sadm directory contains all the package related
information
Q – 3 How many zones can we create in Solaris?
Ans- we can create 8192 non global zones within global zone but in realtime environment only at max of 10 to 15 is possible
Q – 4 How to change network interface property in Solaris?
Ans- We can use dladm command to change network interface property in Solaris
In this example below maximum bandwidth of link is set to 2Mbps
$ dladm set-linkprop -p maxbw=2m e1000g0
Similarly if you want to set the link to full duplex $ dladm set-linkprop -p duplex=full e1000g0
Q – 5 How to grow disk size in SDS? what is SDS?
Ans- Advantages of Disksuite
Solstice disk suite provides three major functionalities :
1. Over come the disk size limitation by providing for joining of multiple disk slices to form a bigger volume.
2. Fault Tolerance by allowing mirroring of data from one disk to another and keeping parity information in RAID5.
3. Performance enhancement by allowing spreading the data space over multiple disks .
Q – 6 How to add swap space in Sun Server?
Ans- There are two ways to add swap in Sun Server(i.e. Sun Solaris) as below;
1. Make a partion at availbale free disk of required swap size and then make an entry in /etc/vfstab file. After that
run the command #swapadd /dev/dsk/cXtXdXsX or give the reconfiguration reboot to the Server.
2. Instead of making partion you can create make a file of required swap size with the help of #mkfile command and after that make an entry in /etc/vfstab and follow rest of steps mention in point one.
Q – 7 What is the difference between container and zones?
Ans- Zones:
A zone is a virtual operating system abstraction that provides a secured environment where applications run.The applications are protected from each other to provide software fault isolation.
Container: zone + resource management The ability to control resource usage for processes,task
and zones.Resources can be CPU level,RAM,virtual memory,Kernel level tables etc.
Q – 8 What are the common errors you find in Solaris Volume manager?
Ans- There two common errors or problems you will encounter in SVM and these are
1.Maintainence mode( Due to lack of syncronization or some other error)
2.Disk faulty is the second one!
Q – 9 How to make file system of 65 GB if u get new disk of 80 GB?
Ans- run #devfsadm cmd after fix 80gb HDD
format.
plz wait disk is reading ..
the attached disk menstioned below controller with HDD name
selectt disk
c#t#d#
select p ( partition)
select p ( print)
you select tag 4 enter
you select tag name enter
you seletct wm enter
you select starting cylinder enter
you give now cylinder size : 65gb( you must mention mb or
gb) enter
u give l for lable ( lable means save a things)
it asking (y/n ) y
newfs /dev/rdsk/c#t#d#s4 enter
it taking few mins then crete dir for mount
mkdir /john ( anything )
mount /dev/dsk/c#t#d#s4 /john
and check
df -hk
put entry in /etc/vfstab
Q – 10 How to check parameters in ok boot prompt?
Ans- OKprintenv
Q – 11 Which command display diagnostics in ok boot prompt?
Ans- – OpenBoot will be in diagnostic mode and the diagnostic- mode? command will return true when the configuration
variable diag-switch is set TRUE.
– Diagnostic Test Commands
1) watch-net % To check network connections
2) test net % To test network conection
3) probe-scsi % To find the devices attached to SCSI BUS.
Q – 12 Explain the raids in Solaris?
Ans- raid is also called redudant array of endependent disk it is a combination of multiple disk and drive .which can store a data in diffrent form and level.and it is confirm the level of data avilability and data performance. types of raid
raid 1,2,3,5,6,0+1,1+0
Q – 13 What is a Split brain scenario?
Ans- The situation when two or more clusters cannot communicate with each other and each node thinks that it owns the resources is said to be split brain scenario.
Q – 14 How to freeze a service group?
Ans- #haconf -makerw
#hagrp -freeze -persistent
#haconf -dump -makero
Q – 15 How to switch a service group?
Ans- #hagrp -switch -to
Q – 16 How to start VCS service? What are the configuration files in VCS?
Ans- To start an agent: #haagent – start agentname -sys
To start cluster : #hastart
Configuration file: /etc/VRTSvcs/conf/config/main.cf
Q – 17 Compare and contrast VCS and Sun Cluster?
Ans- Sun Cluster
1) Kernel-based – Fatser in failure detection
2) It runs only on Solaris systems ( Platform dependent)
Veritas Cluster
1)Software based
2)Works on multiple OS ( Platform independent)
Q – 18 Which cluster is better VCS or Sun cluster?
Ans- Depends on the taste of the guy and budget they have to implement the cluster.
Q – 19 What are the various clusters you have worked on?
Ans- Never worked on all but can give below answer if you have worked on any of them:
1) Sun Cluster
2) Veritas cluster
3) HACMP – High Availability Cluster Multiprocesing
Q – 20 What is the difference between SVM and VxVM? What would you recommend to your clients? why?
Ans- SVM
1)Comes by default with Solaris 9/10
2)We cannot shrink volume in SVM
VxVM
1) Third party software where we need to install it
2) We can shrink volume in VxVM
Q – 21 What is the boot process of VxVM?
Ans- During the solaris boot process once it reads the /etc/system file and is supposed to boot from veritas
volumes below are the two lines that need to be placed in /etc/system file such that it boot using veritas root
device.
1. rootdev:/pseudo/vxio@0:0
2. set vxio:vol_rootdev_is_volume=1
Q – 22 What is the difference between detached and disassociate state of plexes?
Ans- Source: Symantec Docs Detach State Detaching a plex leaves the plex associated with its volume, but prevents normal volume I/O from being directed to the plex. This operation can be applied to plexes that are enabled or disabled. The rules for performing the
detach depend upon the usage types of the volumes involved.
The operation does not apply to dissociated plexes.
Disassociate State
Dissociate each of the named plexes. Dissociating a plex breaks the link between the plex and its volume. A
dissociated plex is inaccessible until it is reassociated, which can be done either with vxplex att or with vxmake. Any checks and synchronizations that apply to the det operation also apply to the dis operation.
Plex dissociation is the normal means of unmirroring a volume, or reducing the mirror count for a volume. To
support this use, -o rm can be used to dissociate and remove the plex (and its associated subdisks) in the same
operation. This makes the space used by those subdisks usable for new allocations (such as with vxassist or with
vxmake).
Plex dissociation can also be used for file system backups of volumes that are normally mirrored. Plex devices are not directly mountable, so the backup method described for the det operation will not work if the backup program requires a mounted file system. To support such backup programs, a plex can be dissociated and can then be allocated to a new volume, such as with the command:
vxmake -U gen vol volume plex=plex The created volume can then be started and mounted for use
by the backup program.
Q – 23 How to replace a failed disk in Veritas?
Ans- Can be removed using vxdiskadm and select option 5 (
To replace a failed disk)
23. Plex is in a disabled state. How will you recover? what
are the steps to follow?
Ans: 1) Place the plex in CLEAN state #vxmend -g dg fix clean fix
2) To recover other plexes in a volume from CLEAN plex #vxmend -g dg fix stale plex
3) Enable CLEAN plex # vxvol -g dg start volume
Q – 24 What is the difference between failing and failed disks?
Ans- Failing disk
1) It shows read/write errors in /var/adm/messages.
2) As the time passes we can see increased number of hard
and transport error when checkd by iostat -En.
3)We can see the disk available when format is used
Failed disk
1)It shows “ disk not responding to selection” message
2)It only shows the increased transport errors
3)Format command displays “ disk not available” message
Q – 25 How to grow a volume?
Ans- First check how much space you can increase using
#vxassist -g maxgrow
After checking how much you can increase we can use the
below commands to increase volume
#vxassist -g growby
or
#vxassist -g growto
Q – 26 How to quickly mirror a volume, if the volume is empty?
Ans- With DRL : #vxassist -g make
layout=mirror, log
Without DRL : #vxassist -g make
layout=mirror, nolog
Q – 27 What is a layered volume? How to create it using vxmake?
Ans- Using vxmake we need to build each object until we
create a volume and its very easy to use vxassist instead
vxmake.
1) Create subdisk ( # vxmake -g dg dgname sd sdname )
2) Create plex (#vxmake -g dgname plex sd=sdname )
3) Create volume (#vxmake -g dgname -U fsgen vol plex=plexname )
Q – 28 What are the various layouts that are available in VxVM?
Ans- 1) Mirroring (RAID-1)
2) Striping (RAID-0)
3) Concatenation and Spanning
4) Striping plus Mirroring (Mirrored-stripe or RAID 0+1)
5) Mirroring plus Striping (Striped mirror, RAID 1+0, OR RAID-10)
6) RAID-5 (Striping with parity).
Q – 29 Do you know vxdisk -o alldgs list o/p shows some disk groups in braces… What does that signify?
Ans- Those are shared disk groups.
Q – 30 What is the difference between Vxdmp and EMC powerpath?
Ans- vxdmp: The way the load balancing done is using round
robin approach
EMC Power path: It does it by knowing which path is
least loaded.
Powerpath will fail back a path once it becomes available. The older version of DMP that we were using on Solaris you
had to manually bring back the other path. This could have just been the limitations of Solaris as well. We ran Power
path on AIX and DMP on SUN.
Q – 31 How to identify multiple paths for a disk?
Ans- #vxdisk list
Q – 32 How to convert a volume from gen to fsgen? why should you do that?
Ans- 1) #vxprint -g dgname -rhmvps filename > filename.vxoutput
2) open the file simplevol.vxout using your fav editor and change the use_type field alone from gen to fsgen.
3. Save the file. make sure you edit the use_type field alone…
4. Umount the filesystem; umount /simplevol
5. stop the volume ; vxvol -g dgname stop simplevol
6. remove the volume ; vxedit -g dgname -rf rm simplevol
7. using vxmake rebuild the volume from the saved file ;
vxmake -g dgname -d simplevol.vxout
8. check the vxprint out; vxprint -g dgname -hrt ; check
for the usage type; it would be fsgen
9. start the volume; vxvol -g dgname start simplevol
10. do a fsck for the volume; fsck –
y /dev/vx/rdsk/dgname/simplevol
11. mount the filesystem ; mount /simplevol gen assumes a volume does not contain filesystem and fsgen
assumes a volume contains a file system. Vxassist uses fsgen as default type and vxmake uses gen as default type.
Q – 33 What is the difference between private and public regions in Veritas Volume manager?
Ans- Private Region:
It has meta data regarding the disk. A copy of the configuration database is copied to each private region with the disk group. It keeps 5 copies of the configuration database. It is configured as slice 3. Once the private region is created it cannot be changed.
Public region:
This is the area where all users’ data is stored. Usually it is configured as slice 4.
Q – 34 How to create a shared disk group in VxVM?
Ans- Creating shared dg form the existing dg’s
1) List all the dg available: #vxdg list
2) Find out the node that is master or slace using:
#vxdctl -c mode
3) Deport the disk groups to be shared: #vxdg deport
4) Import dgs to be shared: #vxdg -s import < dg name> % Do this on master node
5) To check the shared disk groups: #vxdg list
Q – 35 Suppose You have a boot disk under svm, the machine fails to boot and remains in ok prompt? what could be the possible reason?
Ans- 1) May be issue with /etc/system file
2) Root file system corrupted
3) Wrong entries in /etc/vfstab file
Q – 36 Explain What are the common errors you find in Solaris Volume manager?
Ans- 1) Disks failures (Boot device failures)
2) Insufficient state database replicas issues
3) Wrong entries in /etc/vfstab file
Q – 37 What is the significance of 51% state database replicas in SVM?
Ans- A state database is the collections of multiple, replicated database copies and each copy is considered as a
state database replica.
If the solaris box loses a state database replica, SVM should figure out which state database replicas still
contain valid data and boot using the valid ones and this is achieved by using “majority consensus algorithm” and
according to this algorithm we need half+1 number of state database replicas before it finds for a valid data.
And for the above reason we need to recreate at least three state database replicas when we setup a disk configuration.
If all the three database replicas are corrupted meaning we lose all data stored on svm volumes.
Hence its good to create as many replicas on separate drives across controllers.
Q – 38 What you would do if you want to replace a slice using metareplace option?
Ans- We use metareplace usually when we have have faulty submirrors and once replaced it resyncs with the failed
components.
1) Find the meta state databases on the slice
#metadb -i
2) If any meta state databases exist remove them
#metadb -d c0t0d0sX where x is slice number
3) Once the meta state databases are removed we can use
cfgadm to unconfigure the device
#cfgadm -c unconfigure diskname
Once unconfigured replace the disk and configure it as
below
4)#cfgadm -c configure diskname
5) Now copy the Volume Table Of Contents (VTOC) to the new
disk
#prtvtoc /dev/rdsk/devicename | fmthard -s –
/dev/rdsk/devicename
6) Once the VTOC is in place now use metareplace command to
replace the faulty meta devices
#metareplace -e d11 devicename ( Where d11 is the
meta device )
Q – 39 How do you replace a failed boot disk under Meta in Solaris? Step by step explanation?
Ans- 1) Checks the disks available: #metastat -p
2) Detach the one with errors: #metadetach d1 d2
If you get error here : #metadetach -f d1 d2
3) Now check the status again: # metastat -p
Q – 40 Suppose /etc/system file file got deleted how you will regenerate from ok prompt in Solaris?
Ans- if /etc/system file deleted take the back-up of file.if at
all no back-up copy /dev/null file to /etc/system in ok
prompt and it copies default files to /etc/system.
Q – 41 How to view the kernel (shmmax) parameter value in Solaris 10?
Ans- To view the current values of the resource control, enter the following commands:
#id -p //to verify the project ID
uid = 0 (Root) gid = 0 (Root) projid = 1 (user.root)
#prctl -n project.max-shm-memory -i project user.root
#prctl -n project.max=sem-ids -i project user.root
Q – 42 How system identify run level at boot time?
Ans- After initialization of kernal it self next init phase starts. Here kernal reads init level from /etc/inittab file.
in solaris 9 but in solaris 10 svc.startd deamon starts mailstone serviceses
Q – 43 What is the difference between init runlevel and milestone?
Ans- Upto solaris 9 runlevel are used they are
Runlevel 0 1 2 3 4 5 6
In solaris 10 milestone is introduced. Milestone is
improved level of runlevel
In run level we use init 1 to bring system into single
user, in milestone # svcadm milestone single-user command
used to bring the system to single user Simillarly
init 2 as multi-user(more than one user),init 3 as multi-
user-sever provide multiuser mode along with nfs
runlevel 4 is currently unused
runlevel 5 ie init 5 shutdown and power off
runlevel 6 ie init 6 shut down and restart
Q – 44 Explain command to display default boot device?
Ans- In ok prompt,we can use printenv command…
ok printenv boot-device
In shell prompt,
#eeprom | grep boot-device
or
#prtconf -vp
Q – 45 Whenever you are creating a new user file /etc/passwd file inode number will be changed why?
Ans- Whenever we add user the file “/etc/passwd”, “/etc/shadow”
and “/etc/group” is regenerated.
and when we assign/change the password the file
“/etc/shadow” will regenerated.
Q – 46 What the path of scconf in cluster?
Ans- /usr/cluster/bin/scconf is the path in suncluster
Q – 47 How to identify VXVM version?
Ans- If running on solaris use following command to get vxvm version-
pkginfo -l packagename
Q – 48 Suppose main.cf files corrupted how will you rectify?
Ans- We can recreate a corrupt main.cf configuration file using the below two files.
1)main.cf.previous
2)main.cmd
Q – 49 How to add a server group?
Ans- #haconf -makerw
#hagrp -add groupname
#hagrp -modify groupname systemList -add node1 node2
#haconf -dump -makero
Q – 50 How to delete a service group?
Ans- 1. Check the Service Group dependancy with other service
group
#hares -dep
2.to make the cluster configuration to read write mode.
haconfig -dump ro
3.Switch the online Service groups to the other system.
#hagrp -switch -to
4.Make the Service group stable on other Host or freez them
on other node:
#hares -freeze -sys
5.Make the service group offline on host1
#hagrp -disable -sys
Q – 51 Explain SUN CLUSTER offline cluster resources on smslu131?
Ans- verify resources are online on tgui1-svc
# scstat
Take all resources offline
# scswitch -F -g smsweb-rg
verify resources are offline on both tgui1 & tgui2
# scstat
verify resources are offline on tgui1-svc & tgui2-svc
# scstat
switch resources online on smslu131
#scswitch -Z -g smsweb-rg
verify resources are online on tgui1-svc
#scstat
verify resources are online on tgui1-svc
# scstat
switch resources from smslu131 to smslu132
# scswitch -z -g smsweb-rg -h tgui2-svc
verify resources are online on tgui2-svc
# scstat
switch resources from smslu131 to smslu132
# scswitch -z -g smsweb-rg -h tgui1-svc
verify resources are online on tgui1-svc
# scstat
Q – 52 Explain What are the service group dependence?
Ans- 4types
Online local
Online remote
Online global
Offline global
Q – 53 How to stop the VCS?
Ans- Stop the cluster on the local server but leave the application/s running, do not failover the application/s
#hastop -local
Stop cluster on local server but evacuate (failover) the application/s to another node within the cluster
#hastop -local -evacuate
Stop the cluster on all nodes but leave the application/s running
#hastop -all -force
Q – 54 How to check the connectivity between 2 nodes?
Ans- Get the mac address from both the nodes
#getmac /dev/qfe:0
Sv from server side
Cv from client side
#./dlpiping -sv /dev/qfe:0 macaddresss
#./dlpiping -cv /dev/qfe:0 macaddresss
Q – 55 How to unfreeze the svcgroup, (enable onl. & offl.)?
Ans- #haconf -makerw
#hagrp -unfreez SG -persistent
#haconf -dump -makero