Tuesday, January 29, 2013

RAID (Redundant Array of Inexpensive (or Independent) Disks)

RAID type available in Solaris are:

RAID 0 (Stirpe and Concatentaion)
RAID 1 (Mirroring)
RAID 2 (Bit level Striping with Hamming code Parity)
RAID 3 (Byte Level Striping with dedicated Parity)
RAID 4 (Block Level Striping with dedicated Parity)
RAID 5 ( Block level Striping with distributed Parity)


Although we have also use of RAID 0,RAID 1 and RAID 5 whereas we will talk about RAID 0+1 and RAID 1+0.


There are three RAID level which Solaris Volume Manager support

  • RAID Level 0    

The RAID 0 is stripe and concatenation which does not provide redundancy although its cost is low ,higher data transfer rate and thus maximum I/O throughput.

In RAID 0 data are spread across relatively small, equal-sized fragments that are allocated alternately and evenly across multiple physical disks.
  • RAID Level 1

RAID Level 1 often called as Mirror. It uses same amount of capacity of disk space as the mirror (copy) of data.

It is most reliable and efficient. Double the cost. If the one disk fails then also we have quarantine of the data as copy/mirror data would be available.


  • RAID Level 5
RAID Level 5 also called as Block Level striping with distributed parity. Data is disturbed across the disk using stripe and a parity information to achieve data redundancy. 

Minimum 3 disk require to create RAID 5 where as parity is distributed so in case of single disk failure data can be still available as calculated by the parity information in conjuction. Hot spare can be use to achieve availability in case of more then single disk failure.



 General Comparison of RAID Level with requirements:

Redundant DataRead PerformanceWrite PerformanceLarge Space Available
RAID 0
Concatenation
NoNoNoYes
RAID 0
Stripe
NoYesYesYes
RAID 1
Mirror
YesDeNoNo
RAID 5YesYesNoYes

Tuesday, December 4, 2012

Solaris Interview Questions

The most widely used question are based on real scenario which questioner already has been faced so ready to thrill with your presence of mind while answering it.

Here we started by PART 1 :BASIC Questionary

Q: Describe "drwxrwxr-x " in ls -l output?
A: d denotes directory after that divide these 9 into set where as first rwx denotes permission for user and then again rwx denotes permission for group and r-x denotes permission for others.

r, w and x denotes as:
r    read
w   write
x    execute

Q: How to check if your system is 32 bit or 64 bit?
A: isainfo  -kv  or isalist  command show the what model kernel is running.
In isalist if it shows sparcv9 then it's 32-bit and if shows ULTRASPARC then it's 64-bit.

Q: How disable telnet service in Solaris 9 and Solaris 10?
A: In Solaris 9:

In /etc/inetd.conf

Make # entry in below line
telnet  stream tcp nowait root /usr/sbin/tcpd/in.telnetd
Save file then start service as below
#cd /etc/rc.d/init.d
#./inet reload
OR Kill -HUP PID

In Solaris 10:


In /etc/default/login file set login related setting as commented # over line "CONSOLE=/dev/console" as to disable root login by telnet(rlogin)

#svcadm disable telnet
OR
#inetadm -d telnet


Q: How to enable ssh service in Solaris 9 and Solaris 10 for root user only?
A: In Solaris 9:
#/etc/init.d/sshd stop

In Solaris 10:
#svcadm enable ssh and edit file /etc/ssh/sshd_config and change entry as "yes" for "Permitrootlogin"

#inetadm -e ssh

Q: How to check which all ports open in current system in Solaris 10?
A: #netstat -an | grep LIST

Q: How to check number of process running in Solaris 10?
A: ps -ef


Q: How to find which process have which Parent?
A: ptree command (Print the process trees containing the specified pids or users, with child processes indented from their respective parent processes. An argument of all digits is taken to be a process-id, otherwise it is assumed to be a user login name.Default is all processes.)

Q: What is setuid, setgid and Sticky bit?
A:
The Setuid (set-user identification) permission is set on an executable file, a process that runs this file is granted access based on the owner of the file (usually root), rather than the user who created the process. This permission enables a user to access files and directories that are normally available only to the owner.

The setgid (set-group identification) permission is similar to setuid, except that the effective group ID for the process is changed to the group owner of the file and a user is granted access based on permissions granted to that group.

The sticky bit can be set for file or directory ,as set on a directory is a permission bit that protects files within that directory. If the directory has the sticky bit set, only the owner of the file, the owner of the directory, or root can delete the file. The sticky bit prevents a user from deleting other users' files from public directories


For More information please visit :http://docs.oracle.com/cd/E19683-01/816-4883/secfile-69/index.html


More to coming soon....

Tuesday, November 27, 2012

Unix Editor/ vi enlisted commands

Commands used in vi Editor - An Unix Editor

The vi editor is a common editor for unix systems and for the enlisted document in your system find the below command:

man vi

at the unix prompt. 
Starting an Editing Session

vi filename

where filename is the name of the file to be edited. 
Undo Command
undo the last command. 

Screen Commands
CTL/l 
Reprints current screen. 
CTL/L 
Exposes one more line at top of screen. 
CTL/E 
Exposes one more line at bottom of screen. 
CTL/F 
Pages forward one screen. 
CTL/B 
Pages back one screen. 
CTL/D 
Pages down half screen. 
CTL/U 
Pages up half screen. 
Cursor Positioning Commands
Moves cursor down one line, same column. 
Moves cursor up one line, same column. 
Moves cursor back one character. 
Moves cursor forward one character. 
RET
Moves cursor to beginning of next line. 
Moves cursor to beginning of current line. 
Moves cursor to end of current line. 
SPACE 
Moves cursor forward one character. 
n
Moves cursor to beginning of line n. Default is last line of file. 
Moves the cursor to the first character of the line. 
:n 
Moves cursor to beginning of line n
Moves the cursor backward to the beginning of the previous word. 
Moves the cursor backward to the end of the previous word. 
Moves the cursor forward to the next word.
/pattern 
Moves cursor forward to next occurrence of pattern
?pattern 
Moves cursor backward to next occurrence of pattern
Repeats last / or ? pattern search.

Text Insertion Commands
Appends text after cursor. Terminated by escape key. 
Appends text at the end of the line. Terminated the escape key. 
Inserts text before cursor. Terminated by the escape key. 
Inserts text at the beginning of the line. Terminated by the escape key. 
Opens new line below the current line for text insertion. Terminated by the escape key. 
Opens new line above the current line for text insertion. Terminated by the escape key. 
DEL
Overwrites last character during text insertion. 
ESC 
Stops text insertion. The escape key on the DECstations is the F11 key.

Text Deletion Commands
Deletes current character. 
dd 
Deletes current line. 
dw 
Deletes the current word. 
d) 
Deletes the rest of the current sentence. 
D, d$ 
Deletes from cursor to end of line. 
Puts back text from the previous delete.

Changing Commands
cw 
Changes characters of current word until stopped with escape key. 
c$ 
Changes text up to the end of the line. 
C, cc 
Changes remaining text on current line until stopped by pressing the escape key.
Changes case of current character. 
xp 
Transposes current and following characters. 
Joins current line with next line. 
Deletes the current character and goes into the insertion mode. 
rx
Replaces current character with x
Replaces the following characters until terminated with the escape key.




Cut and Paste Commands
yy 
Puts the current line in a buffer. Does not delete the line from its current position. 
Places the line in the buffer after the current position of the cursor.
Appending Files into Current File
:R filename 
Inserts the file filename where the cursor was before the ``:'' was typed. 
Exiting vi
ZZ 
Exits vi and saves changes. 
:wq 
Writes changes to current file and quits edit session. 
:q! 
Quits edit session (no changes made). 

What is Unix?


We have more than thousand of definitions available online but this is one is easy to know and understand.

Unix is multi tasking, multi-user operating system developed by AT&T (Bell Lab) in late 1969. Unix System consist a core kernel which does input output operations and allocate resources to carry out  user defined and system defined tasks.

Unix Filesystem is hierarchal which allows both absolute and relative path naming of file ,thus flexible.

Unix can be simply defines as multiuser,multiprocess and multithreaded.Example: A shell can be access ed by number of users at a time and in the same shell we can run different applications to respective different number of users.

Unix has Parent-Child system for the process.Process can be denoted by process ID (PID). Killing the parent process means all child process in turn dead ,as we can have this child process system so we can define which process to be kill and to save other running process.