Вы находитесь на странице: 1из 109

HARDWARE

HDD(Hard disk drive)

It store the data permanently . It is also called as non volatile memory or ROM

RAM/MEMORY

 It is an electronic device which holds the data or instruction during the execution time .
 It is also called as volatile memory

Eg :- When you open an application which is permanently stored in the harddisk ,goes to the
memory and memory send the application data to the processor for execution where the
work of memory is only hold the data or instruction during the execution.

PROCESSOR :-

 It is a electronic device which take the instruction from memory ,execute it and gives
output again to the memory
 The processor is plugged into the mother board , where the place holder named as
socket

CORE :-

 The logical unit of processor is called core


 Dual core means in between the processor there are two core are present
 One instruction executed by two core or two unit of processor , thats why it is faster
than single core . in single core the instruction executed by single core / unit
HDD :- (hard disk drive)

 Form factor of harddisk 2.5’’ and 3.5’’


 Form factor is nothing but size of disk
 Form factor is of two types
o Large form factor (LFF)
o Small form factor (SFF)
 Vendor of HDD
o Segate , hitachi , samsung , WD ,Fujitsu , Toshiba
 Capacity
o 100gb to 8 tb

TYPES :-

 Ide – Integrated drive electronics


 ATA – Attached technology Advancedment
 SATA – Serial Attached Technology advancement
 SAS – Serial attached SCSI
 SCSI – Small computer system interface
 FC – Fiber Channel
 SSD – Solid state drive

HDD CONSTRUCTION :-

 Cyllinder is present inside the hard disk


 The platter which is placed inside the hard disk is called cylinder
 Cyllinder is devided into multiple tracks
 Each track is devided into multiple sector
 Each sector capacity is 512 byte called one block
 First sector is called MBR

TYPES :-

 Mechanical harddrive (HDD)


 Solid state drive (SSD)

Q :- How to read write operation ?

Ans :-

 There are different type of RPM (rotation per minute ) present in harddisk or hard disk
rotate in certain RPM
 Depending upon the RPM hard disk do read write operation
 Head reads the data depending upon the RPM, more the RPM better read write operation
 The general RPM of HDD is 7200 rpm and max RPM is 15,000
 The time to read a data by the head in the cylinder is called latency time
 Data write to the disk by SCSI protocol
 Here electrical signal converted into mechanical signal and depending on rpm we do I/O
operation
 There are 2 types of read write operation generally happen
o Block level
o File level

Q :- Why the mention disk space is not present in hard disk ?

 Example :- 500 GB hard disk having not 500 GB space


 Hard disk vender calculated 1GB = 1000 MB , But the OS vendor they Calculate
1g=1024 mb.
 Also there is some internal software in harddisk
Like firmware are placed in rserve area

Due to this we get less place as compared to the space mentioned in the disk

X86 Architecture :-

 It is an intel based architecture


 It is a family of backword comaptbility instruction set archtecture based on intel 8086 CPU
 It is used in intel based processor also AMD based
 It has 16,32 and 64 bit architecture
 To see architecture #arch
Harddisk interface features :-

Type Encoding Transfer rate max capcity

SATA/IDE Rll 150-300 3TB

PATA/IDE Rll 3-123 1 TB

SCSI Rll 5-320 1 TB

SAS Rll 375- 750 3TB

Processor :-

 Now a days intel based processor used worldwide


Types of processor

NAME MODEL NAME FAMILY CORE CHIP DISTANCE

Nehlam Ep-5500 xeon 6 44NM

Ep-5600 8

West mere Ep – 7500 xeon 10 32NM

Ex – 7600 12

Sandy Bridge 2600 IVY 12 24NM

Bridge 16

Has well 3500 Grantlee 16 16NM

3600 22

Board well is comming next , it has come with 18 core 14 NM

 Cache :- it is a small memory holds the instruction for execution purpose . it is present in
processor
 Processor process a data in layer wise
 L1 , L2 , L3 these are cache memory
 But immidiate action instruction dirctly goes to L3

Memory or Rom:-

 It is available as 2gb,4gb,8gb,16gb,32gb,64gb
in slots 12,24,48,96 – slots are present in mother board
 DMI (Direct memory interface ) is used in memory and processor
 Data goes from ram to processor with SPI (Serial perpheral Interface )
 Processor will interact with another processor with QPI(Quick path interconnect )
 To add multiple processor we need QPI
 SIMM/DIMM are two interface of memory
 Dimm slot connected to processor through SPI
o SIMM – single inline memory module
o DIMM – dual inline memory module
 4 channel = 1 chipset
4 DIMM solt = 1 channel

MAPPING TECHNIQUES :-

 More than 4 DIMM in mother board can’t access by a single processor .


 So by mapping technique this problem can be ressolved
 C 220 is the chipset used in this process
 Raiser slot used to add more PCI
 Maximum 2 PCI can be connected to raiser slot

TYPES OF MEMORY :-

DDR1 DDR2 DDR3 DDR4

Low frequency Low frequency High frequency High frequency

Less pin more pin 204 & 240 pin 260 & 288 PIN

Low speed High speed low speed high speed

 LRDIMM (Low register)


 RDIMM (Register)
 Data boot from harddisk then goes to memory after that it goes to cache memory
one by one and processed by the processor

Servers :-
Q:- Why we need server?

 To run the application and in server there are multiple components are present and
it is more faster than desktop
 The main part is we can use multiple processor in server and multiuser can access
server
 Types :-
o Tower server
o Rack server
o Blade server

PCI :-

 It stands for perpherial component interconnet


 There are 3 types of pci slots
o PCI
o PCI – X (pci – x stands for extended )
o PCI – E (pci – e stands for express)

PCI PCI-e

It consume more power to process the data It consume less power to process the data

It uses parallel interface It uses serial interface

Data transfer rate is very slow Data transfer rate is faster then PCI

Data transfer rate in mbps here data transfer in Gbps

X2 = 5 gbps (x = 2.5 gb)

X4 = 10 gbps

COMPONENT OF SYSTEM :-

 Processor
 Memory
 Harddisk
 Adapter

ADAPTER :-

1. NETWORK
a. Intel
i. I 350 , 82576 - 1G
ii. X520 , x540 - 10G
b. Broadcom
i. 5709 - 1G
ii. 57711 , 57712 - 10G
2. HBA (HOST BUS ADAPTER )
a. QLogic
i. QLE 2462 - 4G
ii. QLE 2562 – 8G
iii. QLE 2662 – 16G
b. Emulex
i. LPE 11002 – 4G
ii. LPE 12002 – 8G
3. CNA (Converged Network adapter )
a. Qlogic
i. 8152 – 10G
b. Emulex
i. OCE 10102 – 10G
c. CISCO
i. P81E – 10 G
4. RAID (Redundant Array of Independent Disk )
a. LSI
i. 8708 , 3708
ii. 1064e , 1064 e – Mezzine based
iii. 9260 – 4i ,9261 – 8e – PCI based

Difference Between SAS and SATA

SAS SATA
 SAS stands for serial attached SCSI  SATA stands for Seriel Attached
 Data transfer parallely Technology Advanced
 It has dual port  Data transfer serielly
 It has speed like 3,6, 12 GBPS & latest is  It has single port
16 Gbps  It has speed like 1.5 , 3,6 GBPS & latest is
 SAS offer backward compactibility with 16 Gbps
sata , That means SATA drive to be  SATA can be conneted to SAS backplane
connected with SAS but the reverse but the reverse is not possible
connecting SAS drive to SATA backplane  It has half duplex concept, data can be
is not possible either read or write in both end
 It is full duplex concept , means the data  SATA can be connected upto 1 m distace
can be read and write at both end  SAS supports multipath I/O but SATA
 SAS can be connected upto 8 metere doesn’t
distance .
SCSI

 It stands for Small Computer System Interface


 In SCSI the rate of data transfer is fast
 In SCSI data transfer rate in network is 320 mbps
 In SCSI protocol we can connect maximum 16 device and can go upto 4m cable distance
 It is protocol which is used for input output operation
 Also an interface to connect electronic device like printer to PC

Difference Between HDD and SSD

HDD SSD
 It stands for hard disk drive  It stands for solid state drive
 Here data store in platter as block level  Here data strore in register or flash
and file level memory.it works of D-ram concept or
 HDD speed upto 50 – 120 mbps flipflop concept
 HDD is slower than SSD  SSD speed upto 200 – 550 mbps
 Heat is more  SSD is 30% faster than HDD
 Vibration present  Heat is low
 Noise present  No vibration present
 Capacity is 2TB for notebook and 4TB for  No noise
desktop  512 gb for notebook and 1TB max for
 It is cheap desktop
 It drown more power  It is expensive
 It draws less power

SDRAM

 It stands for syncronous Dynamic RAM


 It is dynamic RAM which syncronise with system bus

Difference Between SIMM and DIMM

SIMM DIMM
 SIMM stands for single inline memory  DIMM stands for dual inline memory
module module
 It is an older RAM memory module  It is latest RAM memory module
standard standard
 SIMM has 72 pins to cownnect with RAM  Normal or typicall DIMM has 168 pins
 It supports 32 bit data other DIMM have 72 ,100 , 144 ,172
 Size of SIMM is 4.25 ‘’ in length 1’’in ,184,204 ,240 PINS
width  It supports both 32 and 64 bit data
 Data transfer in one way , so there is one  Size of DIMM is 1.67 ‘’ to 5.25’’ length
side gold platter and 1’’ to 1.75 breth
 RAM inserted in SIMM at an angle  Data transfer in two way so there is gold
platter in two side
 RAM inserted in DIMM in parallely

HOT PLUGGABLE:-

 While the application is running at that time we can insert or remove the HDD ,network card
,RAM ..etc, without any damagged, if the componet supports hot pluggable technology .

THROUGH PUT :-

 It is nothing but the amount of data passing through a system attime .

HOT SWAPPABLE :-

 It is technology in which while the application is running at that time ,you can swap the
component one place to other
 It is possible if the component supports hot swappable technology

Q:- Why we need cat6 rather cat5 ?

Ans :-

 Cat 6 transfer data in 1gbps for a limitted area, where cat 5 fails to transfer the data at same
speed . We need cat6 cable
 cat5 & cat6 defferentiate on basis of data transfer distance , other hand both are same
network cable

NETWORKING :-

OSI Ref Model

1. Physical layer :-
 Data flows line bit over cable (0,1) as electrical signal
 Encoding happens in this layer
 Devices use are RJ45 , network cable , Repeater ,Hub
 Data transfer in physical media , ISDN protocol (integrate service digital network )
2. Data link layer :-
 Data bit converted to frames and a logical link established between nodes
 This layer keep track of frame acknowledgement , frame error checking and frame
traffic control
 Device used are network cable and switch
 In this layer devices communicate through MAC address
 It used as L2 layer .CSMA/CD and LLC are used
3. Network layer:-
 Data frames converted to data packets.
 This layer decides in which path data will go to reach at the destination
 Devices uses are router
 Routing protocol are used which decides the path of data to be transfer
 Here devices communicate through ip address
4. Transfer layer:-
 Transfer the data to the destination by routed protocol TCP & UDP
 This layer ensure that the data delivered error free , with order & there is no loss
5. Session layer:-
 It manages the session that how long the session will be open for the process
running in definition station
 All authentication permission given in this layer
 It maintain the data transfer the rate between source & destination
6. Presentation layer:-
 This layer present or format the data into relevant fronts to understand by below
layers. It act like a translator in n/w
 The formats used are ACSI, Encoding, Decoding
 This layer perform data compression , encryption, translation
7. Application layer:-
 In this layer the normal application which need to communicate are installed mostly
all the s/w installed by this layer
 Like ping , telnet are used
 HTTP , FTTP are used in this layer

Definition OSI reference model

 It stands for open system interconnect


 It gives guide line to communicate between the devices in a n/w
 It consists of 7 layer
 It is used to maintain the standards of networking component

Networking

 It is interconnecting between the devices


 The devices may be computers or lapis

LOM & MLOM

 The port which are directly connected to the mother board is called LOM
 LOM stands for Lan On Mother board
 MLOM stands for Modular LOM( Mezzine LOM)
 LOM can’t be replaced but MLOM can be replaced
Eg. Mezzine slot
Topology

 It is nothing but how the networks designs or arrangement of system in n/w


 Different types of topology
 Star
 Ring
 Bus
 Mesh
 Tree

Star

 Centralised component through which we can connect many systems

Ring

 Cyclic connection of many computers

Bus

 Straight-line connectivity of systems

Tree

 Hierarchically connectivity of many systems

REPEATER :-

 It is a device which make the signal strong to go longer distance


 It maintain the strength of signal to flow to the destination of the system

HUB :-

 It is a multiport device which provide connection to the system to interact.


 It broadcast the message to the devices connected through it.
 Broadcast means one to many.
 It is used in physical layer

MAC ADDRESS:-

 It stands for media access controller.


 This address is given to the network adapter card in the system.
 All the network port having MAC address
 It is a 48 bit address.
 It consists of 6 fields. First 3 fields signifies the vendor id (intel or Broadcom) and second 3
fields signifies for device id.
 In a network, switch maintain the MAC address of all system connected through it.
 Switch will recognise the MAC address through the IP address of the corresponding system
and do unicast.
 We can view MAC address by the command
o #ifconfig in linux
o #ipconfig in windows

SWITCH:-

 It is a multiport device which is used to provide connection to the system to interconnect.


 It unicast the message to the system connect through it
 Unicast means one to one & it uses MAC address to talk
 It is used in Data Link layer

CSMA/CD :-

 It is a protocol used in data link layer


 It stands for carrier sense media access collision detection
 It will sense the media access , detect the collision and report to the next layer

LLC :-

 It is also used in data link layer


 It stands for logical link control
 It control the flow of data from source to destination

ROUTER :-

 It is used in network layer


 It is used to inter connect between different network
 It talk to the device using IP address and it maintain the ip of all the system connect through
it
 Number of router connected in a network is called HOP

GATEWAY :-

 It is a port in router through which a system can go out and comes in to the network
 Switch is connected to this port
 We can set gateway address in the router manual. Generally it take the 1st IP of the series ip
given in the network
 Router maintain an access list, it contains the IP of the systems, which will able to go out of
network

IP ADDRESS :-

 It is a logical address given to the network port for communication


 It is of two types
o IPv4
o IPv6
 IPv4 is version 4 IP address ,which consists of 32 bit of 4 octal
 IPv6 is version 6 IP address , which consists of 128 bit of 16 0ctals
 It can be viewed by the command
o Ifconfig in linux
o Ipconfig in windows

IPV4 IP ADDRESS :-

 It has 32 bit address


 It consists of different classes
o Class A
o Class B
o Class C
o Class D - multicast
o Class E – for future use
 Class A:-

 Subnet mask tell us about the class which the ip belongs


 Formula for subnet mask is 2^n -1
 In the above diagram subnet mask will be 2^8 – 1 = 255
 So for class A the subnet mask is 255.0.0.0
 The number of ip can be possible in class A is defined by the formula 2^n – 2= 2^24 -2 =
16777214
 For calculation propose it reserve 1bit in subnet
 So the recent bit is 128 , as it starts form 0, the range is from 1-127
 The 127 address is called loop back address , which is used for self testing of the system
 Pinging to local host means to self test or to check the adapter card as ip is given to the
adapter card

CLASS B:-
 Here it reserve 2 bit in subnet mask , so the recent bit is 64
 So the range is 128+64 = 192 ; As it starts from 0 ; 192-1 = 191
o The range became 128-191
o Subnet mask for class B is 255.255.0.0
o No of Ip generate for Class B is 2^16 -2

Class C:-

 Here it reserve 3 bit , so the recent bit is 32


 The scope will be 192+32 = 224 ; as it starts from 0 the ip will range from 192-223
 In an IP series it may ranges from 0 to 255
 We can’t use 0 and 255 for general purpose
o 0 for networking
o 255 for Broadcasting

SUBNETTING :-

 Dividing a bigger network into a number of smaller network is called subnetting


 It is used for security purpose and it helps us to avoid wasting of IP address
 If there is shortage of ip , it borrows the bit from subnet , if the subnet is like 255.255.254.0 ,
then we got to know that there is sub netting happened

TCP and UDP :-

These are the routed protocol used in transport layer

TCP :- UDP:-
 It is connection oriented  It is connection less
 It stands for Transfer control Protocol  It stands for user datagram protocol
 Data delivery in order  Data delivery not order
 It has secure data transfer  It may have insecure data transfer
 Data transfer rate slow  Data transfer rate fast
 TCP header is 20 byte  UDP header is 8 byte
 Acknowledgement given at every packet  No such Ack. Given in this case
of data receive  It is fast .so used in better performance
 It is secure so used in banking sector like film industry or voice transfer
 Connection oriented means dedicated
connection.

Routing protocol & Routed Protocol :-

 Routing protocol used in network layer and routed protocol used in transport layer
 Routing protocol routs the data based upon distance, traffic and bandwidth
 Routed protocol only carry the data from source to destination but the path decided by the
routing protocol
 Tcp and udp are routed protocol
 Rip – Routing Information Protocol
 Igrp- Interior Gateway Routing Protocol
 Ospf – Open Shortest Path Fast
 Bgp – Border Gateway Protocol
 Rip has only limitation upto 16 router, more than this It can’t access

VLAN
 it stands for virtual lan
 it is use to segregate the port or bind the port in the switch for security purpose
 switch can broadcast the message to the system connected through single vlan
 this broadcast message only go to the system in that vlan not to other
 standard vlan ranges from 1 to 1009
 here if switch will send msg for vlan 10,only the system in vlan 10 can receive it,not
other system will receive
 so it provide access control or security to the network
 total no of vlan ranges from 0 to 4095
 we can’t use or see 0 and 4095 as they used for system
 default vlan for sisco is vlan1
 normal vlan ranges from 2 to 1005
 after that extended vlan which ranges from 1006 to 4094

SWITCH CONFIGURATION

 initial configuration of switches done by console or serial cable


 console cable also used for debugging purpose
 we view the switch by console or serial cable

Switch configuration and Vlan creation practical:-

 Hyper terminal in windows and minicom in linux are application to configure the system
 In windows
Start -> program -> accessories -> communication -> HyperTerminal
 Catalyst is family name of series switch of cisco
o ISO is the operating system of cisco switch (Inter operating System )
 Symbols
o > user mode
 It only view the access but it can’t change the access
o # Enable mode
 Press en to go from user to enable mode
 In this mode we can view and change the access
 It is known as privileged mode
 #show running-config
o It show what configuration running in your system currently
o It fetches information from RAM
 #show startup-config
o It shows what configuration is present in NVRAM
 #show interface fastethernet 0/1
o It show the port information
 #configure terminal
o It is used to change the mode of terminal
 #shutdown
o It is used to make the port down
 #no shutdown
o It is used to make the port active
 #copy running-config startup-config
o To save the configuration
 #config t
#hostname san
o To change the hostname to san
 #no switch port access Vlan 2
o To remove Vlan2

Procedure to configure a switch:-

 Right click -> open terminal


 If it is user mode then #en to enable privilege mode
 Give password
 Type minicom s

Serial port -> press E -> press E(to set bps 9600) -> save as default -> exit

creating VLAN:-

#config t
#vlan 22
#name san
#exit
#show vlan
#config t
#interface fastethernet 0/21
#switchport access vlan 22
#exit
#show vlan
#copy running-config startup-config

#show mac-table

It see all the MAC address

#show interface brief

To see information about interface

#ifconfig eth0 up/down

To make the port up or down


OPERATING SYSTEM
 It is the interface between user and hardware
 OS is the combination of software and hardware
 OS = H/W + S/W

 Partition means the logical boundary created in hard disk .


 To avoid searching problem we store os in the immediate partition c drive
 C is the initial partition
 OS is a program which loaded over the hardware manage the hardware efficiently
(cpu,memory ..etc) and provide the environment for the user to interact with the
system
 C is initial partition as A & B drive reserve for floppy disk drive
 Windows file system –NTFS , FAT , ReFS
Linux file system – ext 2 , ext 3 , ext 4 , xfs

Booting process of OS

 When we power on the system SMPS (switching mode power supply) regulate the voltage
from AC to DC
 Then POST (power on self test) will distribute the regulated voltage among the components
present in the system.
 After that ACPI (Advance configuration power interface ) will manage the power internally in
the system
 Then the control passes to BIOS (Basic input output system) through Smbios (System
management bios)

 BIOS checks whether the basic component of the system present or not.
 It talks to the firmware of each component present in the system and display during booting
process
 It displays all hardware information of the component.
 It manages which device or hardware to boot or not.
 Firmware is a low level program which placed in the hardware at the time of manufacture to
direct interact with the component
Low level program means microcontroller level language.
 After bios completed its work control passes to MBR
 MBR (Master Boot Record) keeps the information about the booting devices.
 it stores the 1st sector of the booting device
 size of MBR is 512 byte as it stores 1st sector of the booting device
 once MBR found the booting device it point to the booting files to load into the system
 Here Vmlinuz and initrd are two major files to load into the system during initial boot
process
Vmlinuz is the kernel in OS which contains hardware information and driver details.
 It loads the basic driver that are required to boot the system
 It is loaded to the memory by the help of initrd.
Initrd
 It stands for initial ram disk
 It is used to create the space in memory to load vmlinuz and act as file system
 once vmlinuz loaded into the memory it tries to interact with the rest of the device to load
into the memory
 it loads the device driver for the hardware to interact
 Once vmlinuz completes its work it starts services and mount the devices
 Then it look for runlevel files from which init level is going to boot (starting point of booting)
 Enter into login give valid username and PWD

Errors

Q:-if adapter card is not detected ?

Ans:- The adapter card may not be properly connected to the PCI

The correct firmware may not be present

May be damaged hardware(adapter card)

Older bios version may not be recognise the firmware

May be the compatibility issue

Q:-Destination host Unreachable

Ans :- The network cable or physical connectivity error or cable not connected

Q:-Request time out

Ans:-if there is deferent series ip or deferent vlan given

Q:-If 2 system can’t talk each other

Ans:-

 There may be different vlan given to both


 They may have different series of ip
 Check the physical connection it may lost
 May be firewall active
Q:-if h/w is not detected

Ans:-

 May be BIOS can’t detect the firmware


 If BIOS recognise the h/w the problem is driver may not present

Q:-how we check which adopter card is used in our system

Ans:-

 Go to BOIS & check it


 At the time of post we can check
 Go to windows & check device manager
 By the command #lspci in linux

Q:-if 2 computer connected to switch & can’t talk to each other

Ans:-

 Check the cable


 Run ping command then see the error message by tail –f /var/log/messages

Q:-what is boot loader

Ans:-

 It’s the program which load os when we power on system


 MBR is one type of boot loader

Q:-how to replace the damage processor

Ans:-

 Server management s/w will help us to check which processor is damaged &then open
inventory tab, it’ll show which processor will damaged
 Then we have to remove the processor from socket & insert the new one in that place
Eg. Management s/w we can see or view management h/w

Q:-At the time of power on my computer shows no bootable device

Ans:-

 May be bootable device not present , hdd damaged


 Go to BIOS &set the boot device
Option ROM

 It is typically consists of firmware that is called by the system bios. It helps the bios to talk
with the firmware of the device.
 Without option ROM bios can’t talk to the firmware of the device

OS

| |
Windows Unix
| |
Desktop version - 95 / 98/ME/2010 prof/vista/7/8 linux
Server version - NT/2000/2003/2008/2008r2/2012

LINUX
|

↓ ↓ ↓ ↓ ↓ ↓ ↓
Redhat Novell Oracle HP IBM Mandreke Ubuntu
RHEL SUSE OEL 5.0 Hp-UX AIX
RHEL 4.0 SLES 10 OEL 6.0
4.1 10sp1 OEL 7.0
: 10sp4
RHEL 5.0 SLES 11 sp1
5.1 11sp2
:
RHEL 6.0 SLES 12 sp1
6.1 :
RHEL 7.0
:

RHEL – Redhat Enterprise Linux


SUSE – Software und System-Entwicklung
OEL- oracle Enterprise Linux
SLES -Suse Linux Enterprise Server
Virtualisation OS

 It is an OS to use 100% of system component


 Vmware is the main vendor of virtualisation OS
 Hyper – v is virtualisation for Microsoft
 For Redhat – KVM ,XEN

Installation of OS
 Hardware requirement
I. Hard disk 15-20 gb
II. RAM 2gb
III. Processor p4
IV. Keyboard, Mouse
V. Os cd
 Types of installation
I. DVD
II. Pendrive
III. Network (PXE , FTP , NFS)

Default user for windows is Administrator

Default user for Linux is root

 Create directory in Linux


#mkdir <directory name>
To create the directory

#ls
List of file to show or Enter into the directory

#ls | grep <directory name >


To view the particular directory you have given

#pwd
To view present working directory

#cd <directory name>


Change directory

#cd
To go to the root
#ctrl+l
To clear the screen
 Create file in Linux
#touch <file name>
To create file

#ls – ltr
Display details about file and directory

#man ls
Help command

 Add content to file


#echo “i am san” > san (san is the file name)
#cat san
Display the content

>> - it add new content and keep the previous content


> -it add new content

 Vi editor

Vi editor consists of 3 modes

I. Insert mode
II. Append mode
III. Escape mode

Vi editor is case sensitive

I. Insert mode
 This mode enables you to insert text into the file
 Vi is always starts with command mode or escape mode
 To come to the insert mode simply type i
 Then press esc to go to the escape mode again
 In this mode the insert text goes before current cursor location
II. Append mode
 It is similar to insert mode
 We can add the content of the file in this mode
 Press ‘a’ to go to the append mode
 The main difference from insert mode is in this mode the text inserted after the
current location of cursor
III. Escape mode
 This is default mode of vi editor
 In this mode we can run only command
 Press esc to go to the escape mode
 Copy,paste,delete commands used in this mode

Commands use in escape mode

i. yy means yank
To copy a line ; to copy 4 line type 4yy
ii. p
To paste anything which has copied
iii. dd
to delete a line
iv. dw
to delete the word
v. yw
to copy the word
vi. u
for undo purpose

If we want to copy more than one word, keep cursor on the 1st word count the words along with
spaces

eg :- want to copy :-

to linux

12 3

Here 3yw to copy the above

vii.
x used to delete the character
viii.
y used to copy a single character
ix.
:w
to save and stay on that editor
x. :wq
write and come out from editor
xi. :q!
To force come out from editor
xii. :set nu
to set the number the line in escape mode
xiii. shift +g
to go to the last line
:6 to go to the line no 6
xiv. man vi
to enter into help file of vi editor
xv. /file information to search the file content and press ‘n’ to go next
 How to create user
 useradd <user name>
passwd username
password
conform password

 how to set permission to file or directory

_rw_ r_ _ r_ _
Owner group other
r- read (4) , w –write(2) , x - execute (1)
 setting the permission by the command chmod
 shell is a scripting language of linux which used to automate your manual setting

give permission to file

#chmod 750 san (7 means full permission to owner , 5 means read & execute permission to group , 0
means no permission to other)

Press ! to forcefully add content by owner

./ - used to run the file

Eg :- ./ san

Add user to group

#useradd –g

#chgrp <group name eg : - xyz>

Directory structure

Like driver in windows (c,d,e) there is directory in linux

root

| | | | | | | | | | | | | | |

root boot etc dev home opt lib bin sbin temp mnt media proc var lost&found

i. root : - root is an user as well as directory


it is super user of OS who manage the file system
ii. boot :- it is a directory which maintains the booting file of OS like Vmlinuz , grub.
To go to boot directory # cd /boot
iii. etc : - this directory maintains the configuration file
System configuration file stores in etc
To go to etc directory #cd /etc
iv. dev :- all device information stores in dev . device information means all hardware
information stores
v. mnt :- in linux we can’t use pen drive directly. we need an intermediate between os and
pen drive

This intermediate is called mount and pen drive is called mount device

 the pen drive and usb device is called as follows


ide -> hda 1 ; hda means 1st device and 1 is 1st partition
hdb
::
SAS /SATA / SCSI - > sda 1
sdb2
::

To mount a device

#mount /dev/sda1 /mnt

#cd /mnt

 mnt is the user defined mount


 dmesg :- it keep track of hardware changes
 to save remove mount device or unmount device
#umount /mnt
 #mount will show all mount device present
vi. home :- all user comes under home other than root
vii. opt :- it is an optional directory where all files and folders copy to this directory
viii. lib :- It contains the library file , predefined files are stored under this directory
modules , firmware comes under this directory
ix. bin :- Binary files are stores under bin directory
General binary files stores under this directory
dmesg , mount , ls , like user level command
x. sbin :- System binary files stored under this
System related command stored under this like useradd , userdelete
poweroff , fsck
xi. temp - temporary files are stored under this directory
xii. media :- it is a directory which keep automatically mount device to media directory
System use this directory to do automatic mount
It is called system defined mount
To go to mount #cd /media/cd-rom
xiii. proc :- This directory hold current processor information
How much memory used, hard disk information comes under
It’s like task manager in windows
xiv. var :- it is variable directory which is used to store log files and http files
Log files means what happens in the system it keep record
eg : - var/log
var/www/html
xv. lost and found :- This directory maintains the information about the corrupted files ,
Systems details and restore it
It’s like recycle bin
We can check the corrupted file by the command ---- #fsck

Give permission to user :-

The super user gives the root id to the normal user to access the entire thing without giving the root

Password

Go to #vi /etc/passwd -- if the root id is 0:0 set this id to 0:0 to the user to access

User can access the system but we can’t change the system

INSTALLATION PROCESS SLES 11 sp2

 Minimum partition should be done in linux is root , boot ,swap


 We can take 2 partition root and swap
 Swap is virtual memory of linux created in hard disk
 Swap concepts comes when we load application for execution purpose , if the memory is
not sufficient to load the application ,we need virtual memory
 Size of swap is double size of RAM
 To increase swap size #vi /etc/fstab

Steps of installation:--

Network installation:--

 Connect the network cable make sure that the network port as 1st boot device
 Go to the bios from boot option set the network port as 1st boot device
 Reboot the system then boot option will come select the os which you want to install
 Now vmlinuz and initrd will load to the system or memory
 Vmlinuz will load the driver to interact with device
 Select the keyboard language
 Mention the ip address of server from where the os is going to install
 Select the mount point of os and click next mount point means link point
Then welcome page come

Cd installation:-

 Insert the cd reboot the system ,make sure that cd is 1st boot device
 Then 5 option will come then select from cd or dvd ,then welcome page come
Installation start :-
 Select the agreement and click next ,then probing start means it take some time to interact
with the hardware
 Select installation mode as new installation and click next
 Set the time zone from map
 Select server based scenario
i. Physical machine
ii. Virtual machine
Select physical machine
 Then we got the page installation setting with option
i. Partitioning
ii. Software

Select partitioning

 Then we got two option of partitioning


i. Automatic
ii. Custom

Select custom partition

 Then allocate memory for installation and press next


 Now select file system as ext 3 or ext 4 and mount point as root from the drop down
 Then select partition type from
Extended
Primary

Select extended

 We select extended, as primary partition does not allow more than 4 partition , but
extended allow more than 4 partition
 Then select software , like c,c++ compiler select the application and click install

Diskdruid is a tool which create auto partition

It is a tool which is inbuilt in system to create automatic partition of hardware

POST INSTALLATION PROCESS :--

 After reboot select licence and agreement,click yes and go next


 Firewall – disable , Selinux – disable click forward
 Kdump – kernel dump file enable and allocate memory of 512mb, click forward
 Click time and date then forward
SWAPPING:-

 During execution of an application if there is shortage of memory , then os manage


to load the application to the virtual memory
 When processor need the application to execute , those application swap from
virtual memory to physical memory , this process is called swapping
Difference between RHEL 6 and RHEL 7

Features RHEL 7 RHEL 6

Default File
XFS EXT4
System

Kernel
3.10.x-x kernel 2.6.x-x Kernel
Version

Kernel Code
Maipo Santiago
Name

First Process systemd (process ID 1) init (process ID 1)

Traditional runlevels defined :


runlevels are called as "targets" as shown below:
runlevel 0
runlevel0.target -> poweroff.target
runlevel 1
runlevel1.target -> rescue.target
runlevel 2
runlevel2.target -> multi-user.target
runlevel 3
runlevel3.target -> multi-user.target
Runlevel runlevel 4
runlevel4.target -> multi-user.target
runlevel 5
runlevel5.target -> graphical.target
runlevel 6
runlevel6.target -> reboot.target
and the default runlevel would be
/etc/systemd/system/default.target (this by default
defined in /etc/inittab file.
is linked to the multi-user target)
/etc/inittab
Hostname variable was defined in the
Host Name
hostname variable is defined in /etc/hostname. /etc/sysconfig/network configuration
Change
file.
Maximum (individual) file size = 500TB Maximum (individual) file size = 16TB
Maximum filesystem size = 500TB Maximum filesystem size = 16TB
Max
Supported File
(This maximum file size is only on 64-bit machines. (This maximum file size is based on a
Size
Red Hat Enterprise Linux does not support XFS 64-bit machine. On a 32-bit machine,
on 32-bit machines.) the maximum files size is 8TB.)
Change In File
/bin, /sbin, /lib, and /lib64 are now nested under /bin, /sbin, /lib, and /lib64 are usually
System
/usr. under /
Structure

Boot Loader GRUB 2 GRUB 0.97

NFS NFS4.1 NFS4


OS

Driver

 Driver is a high level program which helps os to interact with hardware through kernel

Kernel

 Kernel is a foot print of os which passes information directly to hardware through firmware

Driver are available in two methods

i. Inbox driver or built in


ii. Outbox driver or Async

Inbox driver

 The driver which are present in the os during bonding or integration of os is called inbox
driver
 This driver released or available in the market before os released or at the time of os
released

Outbox driver

 The driver which supply to the os externally or inject separately to os is called outbox driver
 This driver released or available in market after release of os
 File server is a place where all software stores

Modules

 this is a component which take information from driver to kernel


 the command to view modules present in system
#lsmod

Adapter card Module name

RAID (LSI) megaraidsas ---- pci

Mptsas------------mezzine

Network Intel 1G igb

10G ixgbe

Broadcom 1G bnx2

10G bnx2x

HBA Qlogic 4G QLa2xxx

8G Qla4xxx

Emulex 4G Lpfc

CNA Qlogic n/w Qlge

Fc Qla2xxx

Emulex n/w OCE

FC lpfc

Cisco n/w ENIC

FC FNIC

Update Running kernel

 After installation of any application or software we have to update the module in kernel,
because the os need to interact with the software properly to use it. For this propose we
need to update the module in kernel .it can be done by rebooting
 If we are doing any important work with our system at that time we install an application we
need to reboot the system. By rebooting the system at that time we may lose data.
 So to avoid this problem & to update the module in kernel at running condition we use 2
methods
 Insmod
 Modeprobe

INSMOD

 It depends on dependency error


 Any supporting file missing is called dependency issue
 While updating the module if there are any dependency issue occur , it through the error
message instead of updating the module
 To store .ko file and to update the module write
#insmod /lib/modules/kernel version/kernel/driver/net/bnx2.ko
Here bnx2 is module name
 We use net for network only
 If it is HBA ,FC , CNA then write scsi instead of net

Updated driver stored in

#Insmod /lib/modules/kernel version/kernel/update/net/igb.ko

MODEPROBE

 This is used to update the module in running kernel


 While updating the module if there is any dependency issue occur. It will correct the
dependency issue &insert the module
 To store the ko file & update the module
#modeprobe bnx2 (module name)
 .ko is the kernel object file
 Kernel is updated when we insert the corresponding module

Q:- how to check dependency error

Ans:- #vi /etc/modeprobe.conf

Q:- how to see the driver updated?

Ans:- lib/modules/kernel version/kernel/update/net/bnx2

vi /etc/fstab

 it is used to increase the swap memory


 it is used to do NFS configuration
 it is used to do permanent mount
Driver installation steps

 mounting
 when we insert the usb device where the modules are present in compressed
format
 mount the device ; see the device name by the command #dmesg or #mount
 then mount it
#mount /dev/sdc /mnt
 then copy the compressed file to opt directory
 go to the opt directory and view the driver in compressed format
#cd /opt
#ls will view files
 in this step there are multiple modules present in different compressed format like
 <file name> . tar
 <file name> .gz
 <file name> .tgz
 <file name> .rpm
 <file name> .src.rpm

To unzip the file

 <file name> .tar


If we select .tar file to install 1st we have to unzip the file

#tar xvf <file name>


 If we select .gz file
To unzip file
#gunzip –d <file name>
 If we select .tgz file
To unzip file
#tar –xvzf <file name>
 then we have to install the selected compress file
Write #ls to view make file present or not
If make file present
 when we view the make file , see the path where the make file is present , enter
into that
eg. Lets the make file present in qlgc like
(Qlge)make
 to enter into make file
# cd qlge
 when we enter into that file where make is present
to compile the file
# make
To install the file
# make install

If extra file present


if there is extra file present in that unzip file we have to install that extra file
instead of using make file and make install
 install the extra file using the command
./extras/build.sh
 then update the kernel by inserting the install module
we can insert the module in two ways
i. insmod
ii. modeprobe

eg : - #insmod /lib/modules/kernel version/kernel/driver/net/igb/igb.ko

#modeprobe igb

 if select .rpm
 here there is no need to find make file and make install
this file can be install directly
#rpm –ivh <file name.rpm>
 if select .src.rpm
#rpm –ivh <file_name.src.rpm>
#cd /usr/src/redhat
#rpmbuild –bb SPECS/filename.spec

then update the kernel using insmod and modeprobe


#modinfo <module name > -- to verify the module install or not
#rpm –ivh - install .rpm file
#rpm –uvh - to update the latest .rpm file
#rpm –e - to remove current .rpm file

COMMANDS

i. View user
# who am i -- view who is the current user
#who -- view total member of user
ii. Remove file or directory
#rm <file name> remove empty file
#rm -rf <file name> remove with all the content
#rmdir <directory name> remove directory
iii. To show error message
#vi /var/log/messages
iv. View file content
#cat <file name>
/content --- to search content in file
Eg: - /error
v. Copy file
#cp file name destination address (if you are copy from present directory)
vi. Check
#fsck - it checks corrupted file
#lsmod - list of module present
#cat /etc/redhat-release - To see OS version
#uname –r - display kernel version
#arch - display architecture
#file <file name> - display file information
#modeinfo <module name> - Display module information
vii. Module operation
#rmmod <module name> - to remove module
#ps –ef - To view running process
#ps –ef | more - To view running process page wise
#vi install –txt - to view driver information or read me file
viii. To kill process
#kill PID
To kill forcible
#kill -9 PID
ix. To show last 10 error messages
tail –f var/log/messages
x. To show first 10 error messages
#head /var/log/messages
xi. To see memory
#free - memory used
#df - show the free space of disk in KB format
#df –h - show the free space of disk in GB format
#top - To see the system performance
Ctrl + c - Stop processing
#fdisk –l - Display hard disk partition
xii. Configure IP Graphically
#neat
 It will show windows with two interface i. eth0
ii. eth 1
 By click edit we get Ip setting manual or automatically
 Then set IP and click on activate and start network service by
#service network status - it display the network status
#service network start/stop/restart - it will used to start or
stop or restart the network service
 To set IP to rhel 5 and above series graphically we use
#neat
#system-config-network
 In sles there is
#yast2 - show driver information of sles
Q:- how to supply driver during installation(out box driver)

Ans:-

 When we install rhel there is an option like boot


 To supply driver we have to write
# linux add or # linux text(command line)
 Then it will show the option where the driver is present , then it will install the driver
 But in SLES if the os version is less than 11 press F5 or more than 11 press F6 & then give
path to the driver where it is present
 .dd file used only during installation but .img file use during or after installation

# rpm -ivh

I - install

V - verbose(it will run in backend)

H - human readable

# tar -xvf

X - extract

V - verbose ,F - forcible

 In windows to supply driver externally we have to press F6

Path to assign IP manually (permanent ip)

# vi /etc/sysconfig/networking/devices/ifcfg –eth0

This will show

Device = eth0

Boot proto = none

hwaddr = 00: 15:17:29:83:9f (MAC)

onboot = yes

type = Ethernet

netmask = 255.255.255.0

IP Address = 192.168.1.11

User ctl = no

Ip v6 init = no

PEERDNS = yes
Then run the command

#service network restart

If we do onboot = no , then if we restart network , it won’t affect the port

By default onboot = no , we have to make it yes, then reboot the system

Restart the network then ip will set or changes

Temporary set IP

#ifconfig eth0 192.160.1.12 netmask 255.255.255.0 up

For affecting the IP we have to restart the port eth0

#service network restart

After this it will show the new IP address

DHCP

 DHCP stands for Dynamic Host Configuration Protocol


 DHCP automatically assigns ip address to the network port
 It works on DORA concept (Discovery , offer , Request ,Acknowledgement )
 In discovery the client send the message through switch or broadcast the message to DHCP
at broadcasting address as dhcp discovery message
 When DHCP server receives DHCP discovery message from client which is lease request , the
reserves an ip address for the client and make a dhcp offer message to the client .this offer
contains client MAC address ,ip address that server is offering , subnetmask , lease
duration and ip address of DHCP server
 In response to the dhcp offer the client replies with a dhcp request with the offered address
to any dhcp server which it want , other dhcp server receives this messages & withdraw their
offer as the server informed that whose offer is accepted for ip lease
 Then dhcp server receive the request from the client & send a dhcp packet which contains
leas period & ip address for the client as acknowledgement. Then ip configuration
completed
 DHCP does not relocate the address if lease period exist
 Client may extend its lease period with subsequent request
 Client may send message to DHCP before lease expired telling it that it no longer need the IP
address , so the same Ip can be assigned to other
Default lease time :-
 It is the default time a dhcp server assigned an IP to a system
 It is the minimum time duration the system will use the IP assigned
by the dhcp

Max lease time :-

 It is the maximum time duration the dhcp will assigned the IP for the system

Binding state active :-

 It means the system logged on and using the IP and lease time present or
continue

Binding state free :-

 It means the system not logged on and IP not using or lease time expire .In
this case dhcp can assigned the Ip to other new logged system
 But in binding state active dhcp can’t assigned the same IP to other system

To configure DHCP ::-

#vi /etc/dhcpd.conf

It will show the subnet mask 10.164.23.0 netmask 255.255.255.0

range 10.164.23.1 10.164.23.150 } means the IP range from 1 to 150

To start dhcp service ---- #service dhcpd start

 DHCP will store the IP which is assigned to system or to view all the IP used
#vi var/lib/dhcp/dhcpd.lease :-- it shows the lease information and assigned ip
address

To fix IP to MAC address :-

#vi /etc/dhcpd.conf in this file write

Fixed address

MAC - addr

Ip-addr

Like above open the dhcp by the above command and add the MAC address and IP which you want
to set

Private and public IP :-

 When several system connected in a LAN all the system will get private IP
 When we connect with internet or a web site need a public IP
 The public IP is provided by the ISP as the private ip can’t routed over ISP

DHCP patching :-

 It is like backup operational of DHCP ,if one dhcp scope to assigned IP is over Then
another DHCP will take the work of previous one

#mount -0 loop :- we use loop to use multiple user parallel or to create multiple thread

#find . or find / :- this . means we are searching in current directory where we present

/ means we search in root

rp :- recursive persistently

cp :- is used to copy the file but scp –rp is used to copy while directory.

commands

#du :- shows disk user

#logoff :- to log off the user

#who :- how many user present

Sudo user

 It is an user which has privileged to root password can do a little more thing as
compare to normal user but it can’t do everything

ping 192.168.1.12

 To view the network connectivity , it is used to see the physical connectivity


between two or more device in a network

ethtool eth0

 To see the port status interface information and to see the link established or not

RUN LEVEL
 #vi /etc/inittab or stores in RC file
 It is a software configuration of the system which allowed a selected group of
process to exists
 In which level your system will be come up or boot up
 Using init the system get initialized

#who –r or runlevel :- It display which run level your system going

Different types of run level

There are 7 run level present

i. init 0 - Run level 0 - Used for shut down propose


ii. init 1 - Run level 1 - single user mode
iii. init 2 - Run level 2 - multi user and no network support
iv. init 3 - Run level 3 - multi user with network support and no graphics
v. init 4 - Run level 4 - unused
vi. init 5 - Run level 5 - multi user with network supports and graphics
vii. init 6 - Run level 6 - reboot the system

 to see RUN LEVEL or Where run level placed


#vi /etc/inittab
 default run level ----- Run level 5

Q:- If graphical mode does not come after booting ?

Ans :- Run level problem ,may be it is in single user or multiuser mode with no graphics

Set Run Level 3 or Run level 5 to enter graphics mode

Q:- How to change root Password ?

Ans :- Go to single user mode and change the user password

#init 1

#passwd

It will ask for new password

Then retype the password

 to see the run level which is active


#runlevel
Q : - How to access server remotely ?

Ans :-

i. ssh - secure shell (port no 22)


ii. telnet (port no 23)

Both the above are used to access server remotely

 ssh is more secure than telnet


 ssh <ip address >
 telnet <ip address >

configure telnet

#vi /etc/xinetd.d/telnet

Then make disable no

How to access in graphically mode :-

 through VNC we can access the server in graphical mode


VNC – virtual network communication
 in windows RDP (remote desktop protocol ) is same as VNC in linux
path to RDP
start -> program -> accessories -> communication -> remote

How to configure VNC

 To remove or delete VNC


#rm –rf /root/.vnc
 #VNC server
Password :
Verify:
#vi /root/.vnc/xstartup

Then enter and comment out the line

#twme comment the line using # and write start kde (kde & gname two different desktop)

Hard link :-

 #ln –s Hard link is the physical area where data store

Soft link :-

 It is the link given to that physical area


Q :- How to create log for OS ?

Ans :- #sosreport -- It create log above hardware information , memory , hard disk ,processor

 To see interface information , port status and to see the link establish or not - #ethtool eth0

Command

#ntsysv :- we can enable or disable the services

 If the service is enable * will be present ,by pressing space we can make disable it

#chkconfig - - list | more :- it will show which run level will on or off

 It will show all the run level

#system-config :- it will show all the configuration

#system-config-package :- it will show particular package configuration

#yum :- yellowday updater modifier

 It is a tool through which we can update or install any application through the
redhat server
 Which OS is installed from that server we can download or install it

To config yum :- #vi /etc/yum/yum.conf

#repository :- it is the place where all application store to provide user automatically according to
need.

 Server creates the repository

#vi /etc/hosts :- it will show the ip address of your system or host name of the system

 Here we can give or change the host name

#service iptables start :- To enable the firewall

#service iptables status :- It will show service status

#service iptables stop :- To disable the firewall

To change or give host name

 Go to host by #vi /etc/hosts


Then give host name to ip address

 Here we have to use the command

#vi /etc/resolv.conf : - it keep record of DNS entry


Then give the name of user

 Restart the network service


#service network restart

#dmidecode :- Display all the hardware information of the system

#dmidecode | grep pci :- it will show about PCI

#lspci :- to find all the adapter card present in the system

#lspci | grep Qlogic :- show about Qlogic

#dmesg :- it record all hardware changes

#var/log/messages :- it keep record of application as well as hardware information about error

#vi /etc/grub.conf :- it is used to see or to change the booting priority

 It will show like


#boot = /dev/sda
Default = 0
Root (hd0, 0)
Timeout = 5
 Here default 0 means redhat is to boot first means redhat is 0th partition or
1st most partition
 If we have multiple os , then let say linux and windows then see window
partition , if it is 1 , then set default =1 , after that window will boot 1st

Proxy Server

 It is a server which decide whom to allow or whom not to allowed for the user connected to
the server
 It’s like a watchman or firewall
 It maintains all IP provided by ISP or public IP

#vi install.log

 Use to keep record of packages installed , errors occur during installation of OS

#vi anaconda-ks.cfg

 It will keep record of installation file or procedure , what are selected during os installation
 It helps us to perform automatic installation
 Ks stands for kick start file
 It is used to perform automatic installation
 Anaconda uses this file to perform auto installation

SAMBA

 #vi /etc/samba/smb.conf

Make browable = yes

It helps on os to interact with different type of os

Windows has inbuilt samba

 In above diagram if system A want to talk to system B , we have to install samba in system A
to communicate , as system B has inbuilt samba
 To start samba service
o Service samba start
o Service samba status

WINSCP

 It is used to copy from windows to linux machine


 Its main function is secure file transfer between a local and a remote computer
 We have to install this tool in the windows machine and then log in as different user from
the windows machine
 It will show as the desktop of the different user in right side and your system in left side ,
you can just drag the file from right side and drop in left side , so that the files will be save
in linux machine from windows machine.
DNS Port no 53

 DNS check the IP ,when an user enter any address it check the ip of that address.
 DNS converts the corresponding IP address to name and vice versa
 It has two methods
1. Forwards DNS
2. Reverse DNS
 Proxy server act like firewall
 DNS stands for Domain Name System , it’s like our phone book in mobile
 #vi /etc/resolve.conf ---- It keep record of the DNS entry

ACTIVE DIRECTORY

 it centralize our network and store information about network resources across the entire
domain
 Active directory uses Domain Controller to keep this centralized storage available to network
user

PXE

 It stands for preboot executive environment


 It is a program built into the adapter card placed in ROM chip
 Why pxe required?
 If we have given a task of installing more than 100 computers
 When we install the Os in all computer one by one , one system will
take 45 mins to complete the installation process.
 Its more time consuming to install such a number of system
 By using PXE setup we can install the os at a time to all the
computers connecting to the pxe server

Pxe create an environment which will helps us to install the os in
user system automatically or manually
 In this scenario network port is 1st boot device
 Hardware requirement for PXE server
 High end server including p4 or above processor
 2gb memory or more
 40 gb or more hard disk based upon requirement
 Network adapter card which supports PXE
 Any linux OS
 Network switch and cables

 Install RHEL 5.5 on your server. During installation process create bigger size of root
directory where we need to copy more OS image
 Select following package
o tftp
o http/ftp/nfs
o selinux
o DHCP

TFTP (69)

 It stands for Tribal file Transfer Protocol


 It is a protocol which carry Vmlinz and initrd img file to user system ,as the user
system don’t have any protocol to receive the files
 Primarily the user system was dead to receive any file or to understand dhcp as
there is no os in the system.
 tftp does all the above work
HTTP port no :80

 #vi /etc/httpd/httpd.conf
 It stands for hyper text transfer protocol
 It transfer all the data to client system except vmlinuz and initrd
 It has only one way transfer of data

FTP port no :: 20

 #vi /etc/vsftpd/vsftpd.conf
 It stands for file transfer protocol
 It is also used to transfer data . it has two way transfer of data
 It transfer data from one host to another host

NFS PORT NO :: 2049

 It stands for network file system


 It is a client or server system that allow user to access files across a network and
treat them as a local file directory

SELINUX

 It stands for security linux


 Used for security propose

DHCP

 Used to assigned ip automatically to client system


 The user system network port will get an IP after dhcp configuration for communication
propose
 Now we have to give host name and static IP address of the server by
#vi /etc/hosts
 Configure dhcp by command
o #vi /etc/dhcpd.conf
o Define a file “pxelinux.o” under dhcp and next server ip of tftp server (10.10.10.1)
o File name “pxelinux.o” (it is binary file act as boot loader )

 Because when dhcp take the request , it assigns an ip to the client along with this file to load
from the server
 Pxelinux.o is a binary file which is present in OS image file or download it and install it.
 It can be found out by installing a package called “syslinux”
 Define boot message or index for os to install
#cd /tftpboot/linux-install/msgs
#vi boot.msgs
Then create index for OS
1. RHEL 7.0
2. Sles
::

When we select 1 ,it will go to serch configuration , if wont find it , then we have
to define config file under default directory .
 Copy the HTTP protocol
o Copy the OS image file to root directory by create a directory ISO under root and
copy the OS image to this
o To copy write
 #scp –rp root @10.103.33.160: /rhel/ISO
Here root is the root of file server where os image is present , here ip is the
ip of file server
o We copy the OS image from root of the file server to the ISO directory of pxe server ,
where ISO directory is created under root of pxe server
Scp-server connection protocol
Rp-recursive persistently
 Now configure http in server , if http already installed then the below directory created
automatically
#cd /var/www/html
 Then create a directory named rhel 5.5 under html
#mkdir rhel5.5
 Mount the OS image file into http directory by the command
#mount -o loop /ISO/rhel-server-5.5-i386-dvd.iso /var/www/html/rhel5.5
To retrieve iso files to http
 TFTP configuration
 To configure tftp write
#vi /etc/xinetd.d/tftp
 Then make disable parameter yes to no
 Then a directory created tftpboot/linux-install
 And copy pxelinux.o to this directory
 Tftpboot/linux-install this is called as os identifier , it helps us to indentify
the os as it is redhat
 Create pxelinux.cfg directory under linux-install to add configure
#tftpboot/linux-install/pxelinux.cfg
 Add config file to this directory pxelinux.cfg named as default
 Under this default directory define Vmlinux and initrd img and index of os
present in boot msg
Label 1

Kernel rhel 5.5 /Vmlinuz

Append initrd = rhel 5.5 / initrd.img ramdisk size 7000


If we want to add kick start file to perform automatic installation we can add it like

Method = http://10.104.33.150

Rhel 5.5 – ks.cfg ip= dhcp

 Create a directory rhel 5.5 under tftpboot/linux-install and copy vmlinux and initrd files to
this tftpboot/linux-install/rhel5.5
 Give executive permission to both the file by
#chmod 777 * rhel5.5
 To copy Vmlinux and initrd file first find it and then copy like
#find /-name vmlinux –print
 After Vmlinux and initrd loaded to the system then we have to disable the firewall/selinux
 Then start the services
#service dhcpd start
#service httpd start
#service xinetd start
#service iptables stop
 Then make the network port of client system to 1st boot device
Q:- How to install automatically ?
Ans :- copy anaconda file to http directory
#cd /var/www/html
#ls
 Then go to default directory add anaconda
Method
http:// 192.168.10.11
rhel5.5 – ks.cfg ip=dhcp
 To see boot message or define index for os to install
o #cd /tftpboot/linux-install/msgs
o #vi boot.msg
This will show boot index page where all the os present like
1- RHEL
2- SLES
3- Cent os
Storage

 Storage is nothing but the information where it resides or its a datacentre gowdan
 In a desktop the harddisk are directly connected to the mother board using IDE,SAS,SATA
cable
 In this senario , if harddisk crashed we lost the data if we have not taken the backup.
 In server industry the hard disk are connected using RAID controller card
 Here the RAID controller card provides protection to data
 It also provide faster data read write operation and protection to disk failware

 Here 9260-8i raid card used , i means ingress , in case of ingress adapter card we can
connect 8 hard disk to a single port of the adapter card .
Eg:- if 9261-8i has 2 ports we can connect 8*2 =16 hard disk

 Ingress means inside the server , means hard disk will connect inside the server
 In case of 9260-8e , e means e-gress , Here similarly we can connect 8 hard disk to a single
port in adapter card
INGRESS EGRESS
 Data transfer rate faster than  data transfer rate comparatively
egress slow.
 Use inside the server that  Used outside the server that means
means in ingress card hdds hard disks are used outside the
are used inside the server. server.
 It is denoded as(i)  Denoted as symbol (e).
Desktop SERVER
 it is having less component like  It is having more component
cpu,memory,harddisk.  Multiuser purpose at a time
 Single user purpose at a time  Management port available
 Management port not available  More pci present
 less no. Of pci  We can recovery data when hdd lost
 Can ‘t recovery data at hdd lose

RAID

 It stands for redundant array of independent disk


 It provides group of the disk & create logical disk
 Create large capacity of hdd
 Better read write performance as compared to individual disk
 It provides redundant to the data means back up to the data if disk got failed
 We can retrieve data even if hdd got crashed
 Storing of data is easy as data is stored into different hdd

DRAWBACK

Extra adopter card & disk is required so the cost is high

TYPES OF RAID

 Hardware raid
 Software raid

 hdd is called passive device as it required instruction to active or to do something


 Raid is active device as it can do anything on its own to active
 By span we can combine disk into logical drive
 To go to raid card bios at the time of booting press ctrl+H

HARDWARE RAID
 It depends upon h/w(raid control card)
 Hardware raid is faster than software raid
 It is independent of OS
 It is more expensive
 In case of hardware raid there is a dedicated hardware to perform i/o operation. So the
system resources uses for its own task (Running application), So we get better performance
 It supports all raid levels

SOFTWARE RAID
 It does not required H/W resources
 It is slower than H/W raid
 It depends upon OS
 It less Expensive
 Server is used to running the application , in same time server utilize its
resources(cpu , memory ) to perform the i/o operation . So there will be slower
response .
 It may not support all raid levels

RAID LEVELS

Straight Level Combined RAID

RAID 0 R 0+1 = R01

RAID 1 R 1+0 = R10

RAID 2 R 5+0 = R50

RAID 3 R 6+0 = R60

RAID 4

RAID 5

RAID 6

PCI

 It required pci slots to plugged into the mother board


 Connected to back plane
 Here we can connect Network adapter card

Mezzine

 It is directly plugged into the mother board


 Directly connected to HDD
 Here we can connect RAID adapter card

RAID 0

 It is level in raid technology


 It is stripped of block level data
 Minimum disk required is 2
 Capacity = No of disk * minimum capacity of a single disk
 FT = 0

 Piece of data is called stripe or chunk of data called stripe

Advantage:-

 Easy to implement and better read write operation

Disadvantage :-

 If any one of hard disk got damaged we can’t retrieve the data

Uses :-

 Used in gaming industry as better read write operation

RAID 1

 It is mirror of block level data


 Minimum disk required is 2.
 We need to take even no of disk.
 Capacity=no of disk *minimum capacity of single disk /2
 Fault tolerance 1 means single disk failure
 In this case a single data stored in drive or one data store in hdd1 and its copy is stored in
hdd2

ADVANTAGES : -

 Single disk failure we can retrieve data


 Typically supports hot swapping of disks

DISADVANTAGES: -

 More than one disk failure we can’t retrieve data


 It take more memory as half of the total disk is used

USES :-

Small scale industry

RAID 2

 It stripped of bit level data with ECC(Error correcting code)


 Minimum disk 3
 It not used in industry as it is very slow
 Here bit of data travel
 To read a data of 512 byte ,the cylinder moves 512 times so its very slow
 ECC means , it check the error after every bit of data send

RAID 3

 It is stripped of byte level data with dedicated parity


 Minimum disk 3
 Capacity = (No of disk - 1)*minimum capacity of single disk
 Fault tolerance = single disk failure
 Here one dedicated disk is present to store the parity
 Parity means the clone of actual data which required a little space to store ,no physical data
stores in parity
 By using parity we can retrieve the loss data using XOR technology
 XOR gate means two input & single output
 Once data stored to the disk , the parity will stored to the third disk.

Advantage :-

 It has dedicated parity

Disadvantage :-

 Conjunction happens to the parity disk during write operation


 Don’t use in industry as byte level data transfer
 At a time A data and parity of A can’t be write to the disk
 Both disk failure we can’t retrieve data

RAID 4

 It is stripped of block level data with dedicated parity


 All same as RAID 3

USES 3 & 4

 As here better read performance we use in film industry or mail server

RAID 5

 It is stripped of block level data with distributed parity


 Minimum disk required 3
 Capacity = (no of disk-1) * minimum capacity of single disk
 FT=1
 In every disk there is a data as well as parity
 The same disk data parity can’t store in that disk

Uses

 It is popular raid used in all industry


 Mostly used in banking sector

RAID 6

 Stripped of block level data with dual distributed parity


 Minimum disk required 4
 Capacity = (no of disk - 2)* minimum capacity of single disk
 FT=2

Here a single disk parity will store 2 times in different disk

Advantage :-

 Two disk failure we can retrieve the data


 Very high data redundancy

Disadvantage:-
 More costly and more hard disk is used

State of RAID

Online:-

 Optimal state or ready to use

Offline :-

 Sleepy state or not ready to use

Degraded:-

 Something missing on raid but it can use and retrieve the data. If the disk failure is equal to
fault tolerance.
Eg:-in raid 1 the FT =1 ,If 1 disk failure it will go to degraded state

Rebuild/Reconstruction :-

 When faulty drive replaced by the new drive , the missing data will be replaced or rebuild
with to the new drive and when we add a drive to raid then the data will reconstruct to the
disk

Failed :-

 More than minimum disk failure, the raid move to failed state . more than fault tolerance =
no of disk failure

Hotspare and global hotspare :-

 Hotspare is a dedicated for particular raid level


 Global hotspare is available for all raid level
In the above case if any disk got damaged , let say D disk is damaged hotspare will replace
the damaged disk and A , B , C disks will try to load the previous data to the new disk

Spare disk is automatically assigned under fail state

Foreign volume:-

 If the raid controller card got damaged we have to use another raid to continue the system
 At this time the hard disk will treat the new raid as foreign volume as the new raid controller
does not belong to their configuration
 Similarly if a hard disk got damaged and new disk is replaced , the new disk is foreigner to RC
card

Import and Export :-


Combined RAID

 As there is some disadvantage in all raid this concept come

R01:-

 Mirror of stripped data


 Minimum disk required 4
 Capacity = No of disk * minimum disk capacity / 2
 FT = single disk failure

Through put:-

It is nothing but the amount of data passing through a system

Cut through I/O:-

It is an I/O accelerator for SSD that boost the throughput of the device connected to raid
controller card

Disk Roaming:-

It is nothing but moving physical disks from one cable connector or backplane slot to
another on the same controller

Disk migration:-

It is nothing but the migration of virtual disk from one controller to another with out taking
the target controller offline

Here the source controller should be offline


RAID 10

 Stripped of mirror data


 Minimum disk required 4
 Capacity = no. Of disk * minimum capacity of single disk /2
 FT = single disk failure
 Here disk get stripped and then mirror

 Even number of disk required


 Raid 1 with 4 disk , the operation will be same as Raid 10

RAID 50

 Stripped of block level data with distributed parity


 Minimum hard disk required =6
 Capacity = (no of disk - 2) * minimum capacity of single disk
 Fault tolerance = single disk failure
RAID 60

 Striped of block level with dual distributed parity


 Minimum disk =8
 Capacity = (no of disk -4 )* minimum capacity of single disk
 Fault tolerance = 2 disk failure
Fiber Channel (FC)

DAS

 It stands for Direct Attached storage


 Here the disk are directly connected to the server
 DAS depends on OS
 It uses block level I/O
 It is designed for small industry (50 – 100 people organisation )
 If data grows rapidly . DAS setup not recommended
 It is less cost effective
 It uses SAS, SATA, SCSI protocol

JBOD

 It stands for just bunch of drive


 Here speed is divided among the drives , eg:- if total speed of jbod is 14 GBPS and there are
7 drive present ,each drive has 2 GB speed
 No Redundancy
 Here there is no waste of drives that means total capacity is the addition of all single drive

SBOD

 It stands for switch bunch of drive


 Here the speed remain constant for all. Eg:-if the speed of SBOD is 14 GBPS and 7 drive is
connected ,then each has speed of 14 GBPS
 Redundant present
NAS

 It stands for Network Attached Storage


 In this case the server is connected to the switch using network connectivity and NAS head
connected to enclosure using FC
 NAS uses file level I/o
 It uses TCP/IP protocol to transfer data
 It uses NFS (network file system) protocol to communicate with linux os
 It uses CIFS (common internet file system ) protocol to communicate with windows OS
 It is implemented in mid size organisation having 5k to 10k people
 The only drawback is conjunction happen in front end due to network connectivity
SAN

 It stands for storage area network


 Here the end to end connection is FC interface
 To have san setup we need server having HBA, FC switch , controller and enclosure
 Controller is the target which manages the data to store into the enclosure
 Bunch of drive is called enclosure
 SAN uses block level I/O
 Because of FC connectivity SAN provides 100% data secure
 There will be no conjunction of data due to FC connectivity
 This setup used in large scale industry or enterprise
 It uses FC protocol to communicate with device
 It provide more security with help of zoning concept
 The only draw backs is cost as it is more expensive
FILE LEVEL I/O :- BLOCK LEVEL I/O:-
 It uses NFS or CIFS protocol over TCP/IP  It is basic mechanism of disk access using
Ethernet SCSI protocol
 In this case data can be shared among  It is fast and data can be transmitted in
different OS various block size like 2K ,4K ,8K ,16K
 Mainly used in Network communication ,64K, 128K .etc
 The I/O through file system to the hard  It is used in parallel SCSI cables , copper
disk is called file level I/O. It is used to and fiber cable
talk to files  Block I/O is what is used to talk to the
 File system contains the indexing of data device
stored in hard disk or it arrange the data
proper way in hard disk
 It’s quite slow to read or write the data

FIBER CHANNEL:-

 In this case data transfer through light packets


 Data transfer rate higher than of network cable
 If it is a 1G N/W adapter card & we use N/W cable to connect and transfer data, the data
transfer rate will be secure upto 700 to 800 MB . After this limit there may be chance of data
loss
 But in case of FC channel if we use 1G adapter card , the data can be transfer upto 1GB
,there will be no chance of data loss
 There is no chance of data loss even there is huge no of data transferred even no
conjunction happens
 Fiber cable is of two types
o Single mode
o Multi mode
 Single mode carries single beam of light
 Multimode carries multiple beam of light
 Single mode data can transferred longer distance like 10 KM
 Multimode used for shorter distance
SAN SETUP:-

 Server is called host as it initiate the system


 The HBA card having port address is called PWWN

PWWN :-

 Its stands for Port World Wide Number


 It is a 64 bit address to recognise the port of HBA adapter card
 HBA adapter card speeds are 4G/8G/16G depends on the model number
 To enter into adapter card or to know adapter card name , port name ,pwwn no. By entering
into the bios
o Qlogic bios – press ctrl+Q
o Emulex – press ctrl+E
 FC is combination of N/W and channel

NWWN :-

 It stands for Node World Wide Number


 This is an address to recognise the adapter card
 It is 64 bit address
 Every adapter card has only one NWWN and number of PWWN number depending upon the
number of port present

WWN :-

 It stands for World Wide Number


 It is used to recognise the switch
 It is a 64 bit address

GENERAL OVER VIEW OF FC :-

Goals of FC:-

 Allows many well known existing channel an networking protocols to run over same
physical interface
 It has high band width
 Flexible topology
 Connectivity over several K.M
 Supports for multiple data rate, media types and connector.

Uses of FC:-

 Uses in high performance storage and work group


 Large database and data wire house
 Storage backup system and recovery
 Server cluster network base storage
 Digital audio and video network
 Embedded military sensor
 Industrial control system

CHANNEL:- NETWORK:- FC :-
 It is a connection  Connection less  Circuit and packet
service  Logical circuit switch
 Channel is a physical  Unreliable transfer  Reliable transfer
circuit  High connectivity  High data integrity
 Reliable transfer  Longer distance  High data rate
 High speed  Software intense  Low latency
 Low latency  High connectivity
 Short distance  Long distance
 Hardware intense
FC PORT AND FC SYSTEM :-

 The port switch is present in HBA and placed in server is called HBA port or N-port or Node
port
 The port which is present in switch is called fabric port or F-port
 Again the port present in controller is called N-port

LOOP PORT:-

 When we interconnect between two node this is called NL port or node port
 When we interconnect between two fabric port is called as FL port

EXPANSION PORT:-

 The target port which is present in controller for connection of enclosure is called expansion
port or when we connect two switch that is called expansion port
 Enclosure has two port as input port and output port , connecting between 2 enclosor is
called L-port

HARDWARE REQUIREMENT FOR FC CONNECTIVITY :-

I. HBA
II. Fc cable
III. Switch
IV. Enclosure

FC TOPOLOGY :-

 Arrangement of devices in a fc environment .


I. Point to point
II. Arbitrated loop
III. Fabric

i. POINT TO POINT :-
 In this topology we can connect server with controller directly (DAS setup)
 Only 2 device can connected

ii. ARBITRATED LOOP :-

 In this topology se can interconnect devices in a loop


 It can use upto 127 devices
 When 2 device talk to each other , rest will stay ideal
 If any connection lost we can’t communicate

iii. FABRIC TOPOLOGY :-

 In this case host connected to controller through switch


 We can connect 16 million device
 There is a fc address of 24 bit address
o 2^24 = 16 million device can be connected
 Total 239 no of switch can be connected

TOPOLOGY COMPARISION :-

Point to point Arbitrated Fabric

No. Of ports 2 2-127 2^24


Max band width Link rate times Link rate times Link rate times
2 2 No of ports
Band width Allocation Dedicated Share by all loop ports Manage by fabric

Address Assignment N port Login Loop Initialisation and Fabric login


fabric login
No OF current circuit 1 1 No of port pairs

Effect of port Failure Link Fails Loop fails (port by pass Link between switch to
function required) host fails
Classes of service ALL Class 1 2 3 ALL
supported

Frame delivery order In order In order No guaranteed

Cost per port Port cost Port cost + loop Port cost + fabric cost
function

FC LAYERS

There are 5 layers

 FC 0
 FC1
 FC2
 FC3
 FC4

FC 0 LAYER

 It is similar to the physical layer or OSI reference model


 In this layer it includes data rate distance , cable & physical connector
 Here signal travels in electrical signal but like format (0,1)

FC 1 LAYER

 This layer is called as transmission protocol layer


 It defines encoding , decoding , transmission words & line level protocol
 In this layer information transmitted over a fibre channel this information should encoded
from 8 bit to 10 bit transmission character & then send serially bit by bit over the channel
 The information received over the link shall be collected 10 bit at a time & those
transmission character which are used for data is called data character , shall be decoded to
correct 8 bit codes
 The 10 bit transmission character supports all 256 8 bit combination
 Some of the remaining transmission character referred to as special character & used for
protocol management function

Q:- Why data encode required ?

Ans :-

 To maintain the balance between no of 0 & 1 transmitted so there by ensuring that


the received signal is free any dc component
 It provide the unique special character that exits outside of the normal 8 bit data
space
 Provides method for the detection of most but not all transmission errors.

Q:- What is order set ?

Ans :-

 There are 12 special character defined by 8 bit / 10 bit encoding scheme , out of them only
k28.5 character is used by the fiber channel
 The 1st character of transmission word is known as order set. It is transmission word that
includes some combination of special character and data character in set of frame , this set
of d&k is defined by order set or arrangement of d&k in a frame is called order set

ENCODING & DECODING :-

 8/10 bit encoding scheme


 Character are indentified as either data or special character
 At the transmitter 8 bit is split into 5 bit and 3 bit sub block
 The 5 bit sub block is encoded into 6 bit and 3 bit sub block encoded into 4 bit ,
hence we get 10 bit character.
 The encoder needs to know whether the input is data character or special character
to properly encode the input data
 The information of data or special character is provided by d/k input signal to the
encoder
 As each character is encoded , a check is made for number of 1 & 0 , if there is more
1 than 0 , then disparity is positive
 If there is more 0 than 1 , then disparity is negative
 If no. Of 0 is equal with 1 then the disparity is neutral
 Data character are represented as d and special character represented as k eg:-
k28.5 , D27.5
 Through analyser we can view the data and special character

FC2 Layer :-

 It provides 4 tire architecture approach to control and manage delivery of the package
 Four tire structure consist of
 Login
 Exchange
 Sequence
 Frame
 Login :-
 A login session that exist between two ports and allow highest level operation to
take place between those port.
 A session can be establish by an explicitly login process
 Exchange :-
 It consists of one or more related information units such as command , data and
status between two ports need to exchange
 Sequence :-
 Each information units delivered by using a sequence of one or more frames
 Because of frame size is limited by the standard, and the total information unit may
not fit in one frame.
 For this condition only we need to segment the information unit and use a
sequence of frame to deliver the information unit.
 Frame:-
 Frame carry information from one port to another port
 Frame would be thought as envelope used to transport the information across fc
interface

FC LOGIN PROCESS:-
 When a host connected to the Fc switch and target also connected to switch , how
they communicated with each other is defined under FC login process
 When host logged into switch the 1st process start or initiated by the n-port is called
FLogi request , N-port send the request to receive a valid FC-address from the switch
 N-port will send a flogi request frame that contains node name ,n port name and
service parameter from the source address of 0*000000 to the well known address
of 0*FFFFFE
o 0*FFFFFE is the broadcast address
o 0*000000 this means there is no 24 bit address in N port or source
 Same process happens with controller
 Once switch received the F-logi request from the n port, it will give a 24 bit address
as FCID that belongs to fabric as Flogi accept frame
o The 24 bit address is divided into 3 parts
 8 bit for domain id
 8 bit for area id
 8 bit for alpa id
o Domain :- no. Of switch connected
o Area :- this means the device connected to switch , it’s called area no. Of n
port connected
o Alpa :- no. Of port present
 Total no of node port or device = 239 switch * 256 areas * 256 ports = 15,663,104
(approx)
 Once FLogi completed its work and recive a valid 24 bit address , the next process
starts is known as Plogi request
 Plogi is port login
 During Plogi request n port will register its 24 bit FC id along with it sends 64 bit
PWWN ,NWWN ,port type , classes of services to the switch name server as the well
known address 0*FFFFFC
 The switch will accept the Plogi request and register all information into the name
server as Plogi accept frame
 Once the Plogi is completed PRLI process start , it’s nothing but node to node
communication
 Here node will not get any information from fabric but from other node
 It is related to Exchange ID (OXID ,RXID ) and session information (sequence ID ,
Sequence count)
o OX-originator ID
o RX- receiver ID
o Seq id – sequence id
o Seq – count – sequence count
 After this information has exchanged 2 node will communicate with each other
directly
 PRLI established with SCSI operating environment between source and target N port

FC FRAME :-

 SOF : start of frame


 Payload :- Actual data
o It contains the SCSI command and data
 CRC :- cyclic Redundancy Check
o It check any type of error and correct it
 EOF :- End of frame
 CTL :- Control
 Optional header is used for security purpose
 Type :- means which type of frame
 SCSI protocol contains the SCSI command and data and travels by the FC protocol to storage
device and the work of SCSI is to do I/O on the storage device
 Default id for SCSI HBA is 7

FLOW CONTROL :-

 It is a process of maintain the rate of data transfer between two ports to prevent a faster
sender from a slower receiver to avoid frame loss at receiver side due to lack of available
buffer.
 It is a mechanise to prevent or at least minimize the potential for frame loss due lack of
available buffer after receiving port
o Buffer :- temporary memory (register )
 Fiber channel implements two type of flow control
o Buffer to buffer flow control (BB credit)
o End to End flow control (EE credit )
 Buffer to Buffer
 This type of flow control address between N-port and F-port or
between two F-port
 While transmitting the data this BB-credit is used by each port to
send the frame

 End to End flow control :-


o This type of flow control will be performed between the source and
destination N-port and not between the individual intermediate link
o During login phase two N-port will send the number of frame they can
receive , this number is called as EE-credit
o While transmitting the data this EE-credit used by both the port to send the
frame
o Here switch remain silent or ideal
 Classes of services :-
 For the information to be communicated between two FC devices a class of service
should be agreed upon
 FC defines 5 classes of services (1, 2, 3, 4, 6)
 The set of criteria used to communicate between FC device is called class of services

1. Class 1 :-
a. State full connection between two N-port
b. Frame are delivered in order
c. Frame delivery guaranteed as ack is given
d. End to End flow control used
2. Class 2 :-
a. Connection less
b. Unordered delivery frame
c. Multiple flow control used
d. Fabric will check the data delivery
3. Class 3:-
a. Connection less
b. Unorder delivery frame
c. Delivery not guaranteed
d. BB-flow control used
e. No notification to originator of dropped frame.
4. Class 4:-
a. Stateful virtual circuit
b. Frame are delivery in order
c. Frame delivery guarranted
5. Class 6:-
a. Similar to class 1 with multicast
b. This performed by fabric

 FC 3 LAYER :-
 It is called as common service layer
I. Management server : FFFFFA
II. Time server : FFFFFB
III. Name server : FFFFFC
IV. Fabric controller : FFFFFD
V. Multicast server : FFFFF5
VI. Alias server : FFFFF8
VII. Quality of service server : FFFFF9
 FC 4 LAYER :-
 It is called ULP mapping layer
ULP – User level protocol
 It is equivalent to presentation layer of OSI
 This layer maps SCSI commands to FC Frames
 Protocol Used
o SCSI
o IP
o IPI-3(Intelligence peripheral interface ) used in tap disk communication
o ATM-AAL5 (ATM – Asynchronous transfer mode)
o IEEE 802.2 llc

-:ZONING :-

 Zoning is a fabric based service in storage area network which groups host and target ports
in switch that need to communicate
 It creates a group in which a node can communicate with each other only if they are the
member of the same zone
 Zoning is of two types
 Hard zoning
 Soft zoning
 Hard zoning
 It is the segregation of port or binding the port on the switch
 It is created based upon the slot number and port number of the switch
 In a slot there are many ports(8,16,24 ..) are present
 Brocade switch OS -> FOS (Fabric os)
 When a port is replaced or damaged rezoning required
 In hard zoning the configuration stored in ASIC chip
 It is more secure
 ASCI stands for :- Application specific Integrated Circuit

 Soft Zoning :-
 It is created based upon the PWWN of host and target
 We use HBA port of host and controller to bind , it does not depend on the switch
port
 The configuration of soft zoning stored in NS-table in the switch
 Here rezoning required if adopter card or controller port is damaged or changed
 NS-table stands for name server table
 It is less secure than hard zoning but easy to configure

 How to configure brocade switch


 Through serial cable or console cable we can access the switch
 Configure the ip address of management port using telnet or ssh
 Once you access through the terminal then we have to provide user name &
password of the switch

 Brocade switch configuration


 # minicom s set the bps & save as default
 # telnet ip put user name & password(ip of management port)
 # version
 It is used to know about which os version
 # switch show
 It display the switch details information
 # fabric show
 It also display switch information
 #ipaddr show
 It will display ip address of management port
 #ipaddr set
 It helps us to change the ip of management port

Switch

Config

Zone

Members

 Create configuration
o #cfgcreate “ config name ” , “Zone name”
 Display configuration
o Cfg show
 To add member to configuration
o #cfgadd “cfg name which is created ”, “ name of member”
 To create zone (Hard zoning)
o Zone create “name of the zone”, “0,1;1,2”
 Adding member to existing zone
o Zoneadd “zone name which created ”, “new member”
 Create zone(soft zone)
o #zonecreate “zone name ”, “pwwn of host ; pwwn of target ”
 save configuration
o #cfgsave
 to show zone
o #zoneshow “zone name”
 to remove zone
o zone remove “zone name”
 to create alias or duplicate name for port
o alicreate “name of alias” , “pwwn of port”
 to show alias
o #alishow
 #nsshow
o It will display all the device connected to the switch
 To show port
o Port show “0,1”
 In this Practical we are using network switch to FC at the management port only to access
the FC switch through telnet. We connect the network switch to management port as there
is no network port in FC

 We can also access the FC switch through serial cable

SAN SETUP
Controller :-

 Controller always provide space for the user


 Raid controller card acts like an internal controller but an case of DAS it
works like main controller
 It provide space for host or source
 Where the controller placed is called chassis ,it’s like a box where only 2 no
of controller can be plugged in
 Midplane is a place where we insert the controller
 Midplane is present middle of the chassis and the controller is hot pluggable

CLUSTER :-

 HA stands for high availability solution


 HA or clustering concept is something like a Replica of a component of same type in
a system when one component goes down then the other will take care of other
one. The two components may work parallel or may not.
 HA are of two type
 Active Active cluster
 Active passive cluster
 In Active active clustering both the controller are online
 If one controller got failed another will take task of the failed controller
 In this case the performance will be slow as only one controller work instead
of two
 In Active Passive cluster
 In this case at given time one controller will be operational
 The second controller always in a passive mode until unless the controller
goes down
 That means when the active controller goes down the passive will take the
task
 Performance remain same

 SERVER CLUSTERING (#vi /etc/cluster.conf)


 Interconnecting between two server is called heart beat
 here also there are two server interconnected and if one server goes down
or failed the another will take care of failed server
 clustering of server operated by cluster software
 for windows there is Microsoft cluster
 for linux – linux cluster
 power path is clustering features of EMC controller

 multi connection of source to switch or switch to controller is called multi


path
 this concept is used to avoid connection loss if one connection get lost then
the connection will continue in another path
 heart beat port is normal network port used to inter connect between
servers
 steel keeper :-
o steel keeper is a tool through which we can cluster different OS
 to do cluster configuration #vi /etc/cluster.conf
 During installation how to add Multipath?
 #linux – multipath
 We have to write it at the time of boot

CONTROLLER FEATURE:-

 AC – for power supply purpose


 Serial port – for configuration purpose
 Host port – To connect to switch
 Target port – To connect to enclosure
 Management port – For remote access

 Based on the controller model no. We use enclosure to connect with controller.

DIFFERENT CONTROLLER HAVING OS:-

 EMC – Flare
 IBM – Vx Works
 Netapp – ON tap

DIFFERENT CONTROLLER HAVING MANAGEMENT SOFTWARE:-

 EMC – Navisphere / Unisphere


 Netapp – Filer View
 IBM – Storage manager
 LSI – Santricity / Simplicity
 HP – Array Utility

SERVER MANAGEMENT SOFTWARE:-

 QLogic – Sansurfer
 Emulex – HBA any where
 LSI – Mega cli /MSN
 We use management software to manage the system without rebooting the system
 Juniper OS name is Junose
 We can connect controller to controller through cupper cable

SAN BOOT PROCESS:-


 It is a process to boot the os from san LUN is called san boot process
 Steps
 Make sure that the connectivity between server , FC switch and controller are
established or not
 First switch on the controller
 Power on the server , go to the HBA bios , eg:- for QLogic press CTRL+Q and
enter into the web bios and enable the adapter bios
 Note adapter card PWWN no
 Logged into the switch and create Zone(through management port with telnet )
keep host and target in same zone
 Now explain zoning and login process
 Connect to the controller using management software eg:- for EMC controller
CX4 – 120 we use Unisphere software
 Create RAID group based upon server admin request
 If we want to create raid 5 we will take minimum 3 disk and create raid , Then
create a LUN with specific capacity
 Create host group in controller , like create a group naming Dell
 Click on the host register PWWN no of the host
 Click on the host group and add PWWN to the host group

Click on LUN add to the same host group. This process is called LUN mapping or
LUN masking
 LUN MAPPING:
 It is a process of attaché the LUN to the host but the same LUN can view to the
other host, this called as LUN MAPPING
 The LUN can be use by other host
 LUN MASKING:-
 It is a process of binding the LUN into the host, but the same LUN will visible to
that host only, not to other host. This process is called LUN masking. Here that
host only use the LUN

 PERSISTENCE RESERVATION :-
 In this technique if a no of server connect to a single controller and assigned to a
single LUN , when one server write data to the LUN , other will remain silent or
write will lock for other server

 Go to the adapter card bios , enter into the selectable boot device , set that
LUN as 1st boot device then save and exit

 Then go to the system bios , set the LUN as 1st boot device

 Install the OS using local installation or PXE installation

 Now the server boot from SAN LUN , this process is called as SAN boot process

 In this case the LUN will behave as local drive to server

 NVRAM :-
→ It is stands for non volatile static ram
→ It is used to push data to the hard disk

LUN MAPPING PRATICAL:-

 Open controller software


→ Right click on computer name
→ Add to storage sub system
→ Give IP address of controller 1 and 2 if both are active , if one active then
give one IP only
 LUN CREATE METHOD :-
→ Right click on storage sub system
→ Create RAID
→ Automatic or manual
→ Select devices
→ Calculate capacity = next
→ Create lun
→ Give capacity of LUN
→ LUN name
→ NO -> Ok
 For removing host spare
→ Right click on hot spare drive
→ Hot spare coverage
→ Change view
→ Select drive
→ Unassigned it
→ Close window
 For recovery a drive
→ Select a drive
→ Click on advn. (upper layer)
→ Recovery
→ Revive
→ Drive
→ Yes
 For failing a drive
→ Select a drive
→ Click on advn.
→ Then recovery
→ Failed drive
 For changing controller ownership
→ Select the array
→ Right click on array
→ Change ownership
→ Then change ownership
 Mapping view
→ Mapping view
→ Right click on default group
→ Define host group
→ Give host name , group name
→ Close
→ Right click on host group name
→ Give host name
→ Select PWWN no.
→ Give alias name
 Here LUN which are created are default in undefined mapping
→ Goto undefined mapping
→ Then it will show the LUN which is created
→ Right click on LUN or undefined mapping
→ Define additional mapping
→ Select the group host
 To create new volume drive
→ Right click on computer
→ Select manage
→ Select the driver to initialize
→ Right click on drive create new simple volume
→ Next
→ Next

CISCO SWITCH ZONING :-

 From config mode we can do changes in the switch


 In FC switch all port goes to the default VSAN 1
 In MDS 9124 here last 2 character represent the number of port , here 24 port present and
the 1st two character represent the model number
 VSAN stands for virtual SAN
 It reduce the FC ID in the switch
 In a VSAN , the host connected have different FC ID , similarly in another VSAN the hosts
connected have the same FC ID which are assigned to 1st VSAN hosts
 Eg:- Same FCID in a VSAN can be used in another VSAN

VSAN 1 VSAN 2

Host 1 – FCID 1 host1 – FCID 1

Host 2 – FCID 2 host2 – FCID 2

Host 3 – FCID 3 host3 – FCID 3

CISCO ZONING :-

VSAN 3- Vsan – 4095

XYZ – zonset – 500

ABC – zone – 8000

BROCADE ZONING :-
Config

Zone

Add member

From config mode enter into VSAN data base

#config terminal

#vsan database

#vsan <vsan no>

#exit - come out off terminal

#sh vsan – show VSAN created

#do show VSAN – it will show VSAN in any mode

Set the Zone:-

#zoneset name <name of the zone set XYZ> <vsan number>

#zone name abc

#do show flogi database

It will display device connected to the switch and give valid address (PWWN ,
NWWN)

#member PWWN of the port ; PWWN of another port

To add multiple port or member

Eg:- member 11111;22222222

#zoneset active name <zoneset name> <VSAN>

Eg:- zoneset active name XYZ vsan 3

To remove any command

#no zone name ABC


#cp running-config startup-config

To save configuration

How to add port to VSAN?

→ #config terminal
→ #vsan database
→ Vsan <vsan number> interface Fc slot/port
→ Eg:-#vsan vsan3 interface FC 0/1

To give alias name :-

#FC alias <alias name> port number

Trunking:-

 The port which is connected from host to switch or the port where the port is
connected to the switch , that port is called access port
 The port where a switch is connected to another switch , that port is called trunk
port

To connect to switch:-

 To made the port as trunk or to connect to trunk port


o #switchport mode trunk
o #config interface FC 0/1

To made the port as access port:-

o #switchport mode access


o #config interface FC 0/1
VSAN :-

 It stands for virtual storage area network


 It is a collection of port in switch that form a virtual fabric and provide
isolation among the device that are connected to same fabric

Advantage :-

a) Scalability
b) Traffic isolation
c) Easy to configuration
d) Reduces the no. Of FCID in the switch
 To show zoneset - #show zoneset

 To display vender name as device address PWWN - #show fcns database

o FCNS- fiber channel name server

Block level I/O:- FILE LEVEL I/O:-


 It uses SCSI protocol to do read write  It uses CIFS and NFS protocol to
operation do read write operation
 In this case data write to the disk directly  In this case data write to the disk
to the block of the disk or block size through file system
 It is faster read write operation  It has lower read write operation
 Block level I/O is which talk to the disk  File level i/o is which talk to the
 Here parallel SCSI cable , FC cable used files
 Here Ethernet cable used mainly
in network environment
 File system maintain the
indexing of data in hard disk or it
arrange the data in proper way
in hard disk

Q: - Hard disk partition not showing what might be the problem?

Ans:- there may be LUN mapping or LUN masking problem

The device may be not valid partition

Zoning not created properly


Q:- How to use LUN in Linux?

ANS:- Till LUN creation is same

 Then run the command


o #fdisk –l to see the hard disk partition
 To scan HBA and to see the new device created
o #echo >>> /sys/class/fc-host/host0/scan
 #fdisk /dev/sdd
o To see the partition press P
o To create new partition press N
o It will show
 Primary (p)
 Extended (E)
 Then press p or E for partition as primary or extended. the start size and end size will
come
o Give start size = 1
o End size = 10g
o Then write :w to write
 Then implement the file system
o #mkfs.ext4 /dev/sdd1
 To read write operation we have to mount
o #mount /dev/sdd1 /san (san – is created directory)
o cd /san

 For windows we use different feature such as


o Domain controller
o Active directory
o File server
o Print server
o Antivirus server
 Like PXE in linux there is a process in windows called WDS (windows deployment
service)
 File server is a place where all software or application stores and can be shared to
the client
o To access the file server
 //192.108.1.1 //file server name
 How to install driver in windows?
o My computer -> properties -> device manager -> driver
o If driver showing any error like (?) symbol then go to device manager -> scan
the hardware
 FCIP :-
o It is protocol used in network and FC environment to interact between two
environment , but the problem is the speed variation , FC is more speed (8G
, 16G) but the network uses 1G speed
 FCOE :-
o By default the FCOE port supports network packets
o We can’t use only FC cable to FCOE it won’t support
o To connect FC cable directly to FCOE cisco switch has extra module called FC
module
o But in brocade or juniper we can change the module
o EMC controller for different environment
 Network -> VNX 5200
 FC -> EMC clarian cx4-120
o Where for ISCSI protocol used we can use ISCSI setup
 Different address used in different system

Network FC FCOE ISCSI

MAC FCID IP IQN

IP PWWN MAC

PWWN
FCOE

 FC frames are encapsulated over Ethernet.


 Protocol used FIP (FCOP initialisation protocol )
 It is a management protocol which keep track of whom to allow or not

 FIP is a 48 bit address combination of FCID and FC- MAC


o 48 bit = FIMA = FCID + FC – MAC
 FPMA is fabric provided MAC address
 Login process is all same as Login Process
ISCSI :-

 It is the SCSI protocol encapsulated over Ethernet


 The work of SCSI is to do I/o operation to disk
o Types of SCSI
 Software
 Hardware
 If there is no target to access software ISCSI can create target using openfiler
 In hardware there is a dedicated target
o ISCSI initiator
 Default port for ISCSI is 3260
TESTING

Testing is of 2 types

Definition:-

 It is process to test a protocol or an application in an intension to find error


 Another way testing can be defined in two ways
o Manual testing
o Automation testing

Verification :-

 It is used during the developing period .here manual testing required

Validation :-

 It is used after development of software or product


 Here automation testing required

 Manual testing is more important than automation testing

Testing chart

SNO Test Excepted Actual result Status Remark


procedure result
The error given is of 2 types

 High priority :-
o This means how soon the error should fix
 High severity :-
o This define how critical the error is

SDLC (software development life cycle )

 Requirement analysis
 Gathering information
 Design
 Coding
 Testing
 Implementation
 Maintenance

These all are the requirement for a product to released to market

 Test strategy is prepared by test architect


 PRD (product Requirement Document )
o It is prepared by high level persons like project manager

UNIT TESTING :-

 The testing after a certain code development is called unit testing

TEST PLAN:-

 It is a document which maintain information about resource (engineer ,


hardware ) , what to test or what not to test , time and schedule , how to
address issue and concern this information define in this document
 It is a dynamic document

PP-prototype box or PP box or prepilot used for testing purpose


 the box which is released to market is FCS
o FCS= First customer shipment
 Build is a program built into one bundle or bundle the program for testing
o Night build – Every day build
o Weekly build – once in a week
 RC (Release candidate)
o This means build is read to release for market
 GA (General Availability )
o This means final product ready to move
 Why testing required ?
o Ans :- to make sure that the product has no issue

The engineer who have base understanding of planning and analysis the code , syntax and
correct it , is known as white box tester

UNIT TESTING :-

 The engineer who does the unit testing . he should have some basic programming
Knowledge , like basic coding knowledge and syntax error and should correct it
 Unit testing has access the code while executing or running the code , it can be
change based upon the issue found
 Most of the cases the unit tester will sit close to the development team

Gray box :- in this case there is access to code but tester can’t change the code or fix the
problem

Black box :-

The test is performed by the engineer in which we can test the feature and
functionality of the product , no access to code , no re construction happen

Only find the issue but they can’t fix it

It consists of

1. Sanity
2. Functional
3. Regration
4. Integration
5. System
6. Compatibility
7. Performance
a. Load
b. Stress
8. Smoke
9. Adhoc
1. Sanity :-
 Basic function will test under this testing
 Basic functionality of testing is called sanity testing
2. Functional testing :-
 To test the functionality of product to make sure that the function working
properly or not
i. Eg:- Raid 5 (9266 i)
ii. If one port is support upto 8 hard disk
iii. Test 0,1,5,6
iv. Test state
 Here the functional thing should be available
i. h/w requirement should present
ii. Build should present
iii. Test cases should present
 Build is a software program which needs to verify against the product
3. If test cases fails then bug life cycle start
 Bugzila
 Mantis

NEW Status

Synopsis : Raid card don’t match criteria


Product: LSI 9260
Severity : high
Priority : medium
Description : raid 5 does not support
Interested : Email id of the person
Component : Raid 5 not working
Attachment : attachment or snap

Q:- How to rise a bug and what are the component to file a bug

Synopsis :-

 One line description of error or title of error is given in one line


Product :-

 It has dropdown menu of company

Severity :-

 It is nothing but how critical the issue is or how much impact it will create on
product
 It has dropdown with high , medium and low

Priority :-

 How soon the issue is going to fix or solved


 It has dropdown as high , low and medium

Description :-

 Gives the clear information about the issue


 Write all the details about the component
 Eg:- for raid 5 write server , firware version hard drive name and all
details
 Then write the procedure to create the raid

Interested :-

 Whom you want to inform the issue mail id of the person

Components :-

 It means which component of the product is not working

Attachment :-

 It may be the screenshot and log file and attach it , logfile used for
debugging purpose then click on submit
 After this it will create an id this number is called bug id

Bug life cycle :-

 New: When a new defect is logged and posted for the first time. It is assigned a status
NEW.
 Assigned: Once the bug is posted by the tester, the lead of the tester approves the bug
and assigns the bug to developer team
 Open: The developer starts analyzing and works on the defect fix
 Fixed: When developer makes necessary code change and verifies the change, he or she
can make bug status as "Fixed."
 Pending retest: Once the defect is fixed the developer gives particular code for retesting
the code to the tester. Since the testing remains pending from the testers end, the status
assigned is "pending request."
 Retest: Tester does the retesting of the code at this stage to check whether the defect is
fixed by the developer or not and change the status to "Re-test."
 Verified: The tester re-tests the bug after it got fixed by the developer. If there is no bug
detected in the software, then the bug is fixed and the status assigned is "verified."
 Reopen: If the bug persists even after the developer has fixed the bug, the tester
changes the status to "reopened". Once again the bug goes through the life cycle.
 Closed: If the bug is no longer exits then tester assign the status "Closed."
 Duplicate: If the defect is repeated twice or the defect corresponds the same concept of
the bug, the status is changed to "duplicate."
 Rejected: If the developer feels the defect is not a genuine defect than it changes the
defect to "rejected."
 Deferred: If the present bug is not of a prime priority and if it is expected to get fixed in
the next release, then status "Deferred" is assigned to such bugs
 Not a bug: If it does not affect the functionality of the application then the status
assigned to a bug is "Not a bug".

Regression testing :-

 The purpose of regression testing is to confirm that a recent program or code


change has not affected existing features.

Regression Testing is required when there is a

 Change in requirements and code is modified according to the requirement


 New feature is added to the product
 Defect fixing
 Performance issue fix

Integration testing:-

 Combine the module and verify the interface working or not


 Combination of unit is called module
System testing:-

 Whole system or End to End testing done


 How the customer use the product that testing is called system testing

Compatibility testing :-

 To verify that your product supports different vendor


 It is a compulsory testing for all product

Matrix :-

 This is document of component of testing device and which is support HCL


(hardware compactable list )

Performance :-

 To test the performance of the product


 Different tools: io meter

Hardware vendor for testing i. spirant

ii. Aixia

to measure the peak point where your system component don’t response, we need to do
performance test

load :-

load means to put a load that at which point the system can’t able to take the load or stop
working

bench mark :-

to compare between different component testing result

stress :-

to test performance we need to do read write operation

SUT- system under test

Retest :-

It is nothing but to check a particular component when the issue got fixed

Adhoc testing :-

This testing is happened at lesure period . it is done randomly without any proper document
and helps us to give better product
Alfa:-

It is done in company level . in company test happened

Beta :-

It is done in client level . in client office if any issue occurred after product release

Smoke testing :-

When a build is developed and comes to the tester , then the initial testing of that build by
the tester is called smoke testing . Here we see that the build is properly working or not.

User acceptance :-

It is similar to beta testing done by tester

Certification :-

It is one of testing where all application vendor provide kit against the hardware and then
test for a few days , then they certified that this vendor supports this hardware
Python

 Python is a powerful programming language.


 No need to compile your program before execute it.
 It is used as a scripting language
 It supports automatic garbage collector
 In python all are treated as object

 Python files have extension.py

 Python is a case sensitive programming language.

 Python is Object-Oriented: Python supports Object-Oriented style or technique of


programming that encapsulates code within objects.

A Python script can be executed at command line as python script.py

Identifier :-

 In Python identifier is a name used to identify a variable, function, class, module or


other object. An identifier starts with a letter A to Z or a to z or an underscore (_)
followed by zero or more letters, underscores and digits (0 to 9).
 Python does not allow punctuation characters such as @, $, and % within identifiers.

 Class names start with an uppercase letter. All other identifiers start with a
lowercase letter.

Keywords:-

You cannot use keyword as constant or variable or any other identifier names. All the Python
keywords contain lowercase letters only.

1. print :- used to print to console


2. while :- controlling the flow of the program
3. for :- used to create for loop
4. break :-interrupt the loop (cycle ) , if needed
5. continue :-used to interrupt the current cycle , without jumping out ofthe whole loop.
New loop will begin
6. If :- used to determine , which statement are going to be executed
7. elif :- stands for else if . if the first evaluates to false ,then it continue with the next
one
8. else :-is optional . The statement after the else keyword is executed, unless the
condition is true
9. is :- tests for object identity
10. and :- it behave like boolean expression
11. or :- at least one condition must be met
12. import :- import other modules into a python script
13. as :- if we want to give a module a different alias
14. from :- for importing a specific variable
15. def :- used to create a new user defined function
16. return :- exits the function and returns a value
17. lambda :- creates a new anonymous function
18. try ;- specifies exception handlers
19. except :- catches the exception and executes codes
20. finally :- it is always executed in the end .
21. raise :- create a user defined exception
22. del :- deletes objects
23. pass :- does nothing ,just pass the control
24. assert :- used for debugging purposes
25. class :- used to create new user defined object (class)
26. exec :- executes python code dynamically
27. yied :- is used with generators

Python has five standard data types −

 Numbers

 String

 List

 Tuple

 Dictionary

1. NUMBER:-

Number data types store numeric values. Number objects are created when you
assign a value to them

Eg:- var1= 10
Var2= 20

Python supports four different numerical types −

 int (signed integers)

 long (long integers, they can also be represented in octal and hexadecimal)

 float (floating point real values)

 complex (complex numbers)


2. STRING :-
 Strings in Python are identified as a contiguous set of characters
represented in the quotation marks
 String is immutable object means the position and value can’t be
change after created.
 We can use either pairs of single or double quotes
 Subsets of strings can be taken using the slice operator ([:])
 Index starting is 0 as beginning and -1 is the last index
 (+) sign is the string concatenation operator
 (*) is the repetition operator.

For example :-

>>>str = ‘Hello World!’

>>>print str #print the complete string - Hello World!

>>>print str[0] #prints first character –H

>>>print str[2:5] #print charter starting from 3rd to 5th –llo

>>>print str * 2 #prints string two times -- Hello WorldHello World

3. LIST :-
 A list contains items separated by commas and enclosed within square brackets ([])
 All the items belonging to a list can be of different data type.
 List is mutable object ,means can be modified after created.
 List can be access using the slice operator ([:])
 Index starting is 0 as beginning and -1 is the last index
 (+) sign is the string concatenation operator
 (*) is the repetition operator.

Eg:-

list = [ 'san', 786 , 2.23, 'john', 70.2 ]

list1 = [123, 'san']

print list # Prints complete list - ['san', 786, 2.23, 'john', 70.2]
print list[0] # Prints first element of the list – san

print list[1:3] # Prints elements starting from 2nd till 3rd - [786, 2.23]

print list[2:] # Prints elements starting from 3rd element- [2.23, 'john', 70.2]
print list1 * 2 # Prints list two times - [123, 'san', 123, 'san']
print list + list1 # Prints concatenated lists-- ['san', 786, 2.23, 'john', 70.2, 123, 'san']

4. TUPLES:-
 A tuple is a sequence data type that is similar to the list.
 A tuple consists of a number of values separated by commas.
 Tuples are enclosed within parentheses.()
 Tuples is immutable objet , the value can’t be updated .
Eg:-
>>> tuple = ( 'san', 786 , 2.23, 'john', 70.2 )
>>>tuple1 = (123, 'john')

>>>print tuple # Prints complete list - ('san', 786, 2.23, 'john', 70.2)
>>>print tuple[0] # Prints first element of the list- abcd
>>>print tuple[1:3] # Prints elements starting from 2nd till 3rd -(786, 2.23)
>>>print tuple[2:] # Prints elements starting from 3rd element- (2.23, 'john', 70.2)
>>>print tuple1 * 2 # Prints list two times-(123, 'john', 123, 'john')
>>>print tuple + tuple1 # Prints concatenated lists-('san', 786, 2.23, 'john', 70.2, 123, 'john')

5. DICTIONARY :-
 It consist of key-value pairs.
 A dictionary key can be almost any Python type, but are usually numbers or strings.
Values, on the other hand, can be any Python object.
 Dictionaries are enclosed by curly braces ({ }) and values can be assigned and
accessed using square braces ([])

Eg:-

dict = {}
dict['one'] = "This is one"
dict[2] = "This is two"

print dict['one'] # Prints value for 'one' key –This is one

print dict[2] # Prints value for 2 key- This is two

dict1 = {'name': 'san','code':6734, 'dept': 'sales'}

print dict1 # Prints complete dictionary -{'name': 'san','code':6734, 'dept': 'sales'}

print dict1.keys() # Prints all the keys - ['dept', 'code', 'name']


print dict1.values() # Prints all the values -['sales', 6734, 'san']
Data type conversion:-

int(x [,base]) Converts x to an integer. base specifies the base if x is a string.

long(x [,base] ) Converts x to a long integer. base specifies the base if x is a string.

float(x) Converts x to a floating-point number.

complex(real [,imag]) Creates a complex number.

str(x) Converts object x to a string representation.

repr(x) Converts object x to an expression string.

eval(str) Evaluates a string and returns an object.

tuple(s) Converts s to a tuple.

list(s) Converts s to a list.

set(s) Converts s to a set.

dict(d) Creates a dictionary. d must be a sequence of (key,value) tuples.

chr(x) Converts an integer to a character.

unichr(x) Converts an integer to a Unicode character.

hex(x) Converts an integer to a hexadecimal string.

oct(x) Converts an integer to an octal string.

Вам также может понравиться