Professional Documents
Culture Documents
SWAP CONFIGURATION
Swap memory is nothing but virtual memory. When the physical memory
[RAM].is full the virtual memory (hard disk) is converted into a swap.
The inactive pages are moved from RAM to swap.
Swap space can be created in two ways.
1. One is using free partition
2. Second one is using a sized file from an existing disk.
When we have these types of requests. We have to check whether there
is any change or not.
If there is any change we have to check whether it is preapproval or not.
After the approval, we have checked the present swap size by using the
free -m & Swapon -s commands.
After checking the present swap we get to know how much swap needs
to be added. Then we have to check. If there is any free disk available.
By using #lsblk & fdisk -l commands.
If available we are provided to create a swap file system.
If not, we have to contact the storage team to add a free disk after
getting confirmation from the storage team. We have to scan the disk in
os level by using
#echo “- - -” >/sys/class/scsi_host/host0/scan
Then, we have to check whether the disk is added in os level is not.
#fdisk -l & lsblk
After , finding free disk using #fdisk <device name>
After labelling the disk we have to create a swap file system using command.
#mkswap <device name>
Then we have to mount the create swap to the existing swap.
#swapon <device name>
BONDING & TEAMING
In linux bonding is a combination of two (or) more multiple nic cards
called bonding as well as teaming.
It is a method of combining two (or) more network interfaces together
into a single interface.
Bonding can only configure physical servers.
Mainly we are using the bonding concept for increased bandwidth and
high availability & redundancy.
If we want to configure the bonding minimum 2 nic cards are required.
If there are no nic cards is attached to the “os” level after that we will
check the nic cards by using
#Ifconfig -a
We have multiple mode policies available but mostly we are using
mode=0,mode=1.
My environment is using only mode=0. It is a round-robin [active- active]
mechanism.
I am aware of mode=0 & mode=1
mode = 0 [active - active] round-robin
mode =1 active - backup
If you want to create a bonding you have to create one configure file
under.
/etc/sysconfig/network-scripts/
#vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=10.10.6.222
NETMASK=255.0.0.0
GATEWAY=10.10.0.1
ONBOOT=yes
BOOTPROTO=none
BONDING_OPTS=”mode=0 (or) mode=1 miimon=100”
#vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
#vi /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
When we configured the bonding with mode=0 if any nic card fails then
the entire load goes to another nic card.
As well as the bonding with nic mode=1 if an active nic card fails then
the backup nic card becomes active automatically.
To check the bonding status by using command.
#cat /proc/net/bonding/bond0
"Bonding and Teaming in Linux" Bonding is a method in Linux where two or more network
interfaces are combined into one, either called bonding or teaming. It's used to merge
interfaces for higher bandwidth, availability, and redundancy, usually on physical servers.
To set up bonding:
To configure bonding:
DEVICE=bond0
IPADDR=10.10.6.222
NETMASK=255.0.0.0
GATEWAY=10.10.0.1
ONBOOT=yes
BOOTPROTO=none
BONDING_OPTS="mode=0 (or) mode=1 miimon=100"
For NIC cards:
● Create /etc/sysconfig/network-scripts/ifcfg-eth1:
● makefile
● Copy c
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
●
● Create /etc/sysconfig/network-scripts/ifcfg-eth2:
● makefile
● Copy code
DEVICE=eth2
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
Bonding with mode=0 shares load; if a NIC card fails, traffic shifts to another card. Bonding
with mode=1 has a backup; if an active NIC fails, the backup NIC takes over.
'ipaddr'.
Most NICs default to auto-negotiation, with modes like 10, 100, or 1000
Usually, full duplex is preferred, and half duplex might be used for
backup or restoration.
to turn on
to turn off
SYS INFO
/etc/issue
/etc/redhat-release
Each of the directory contains important information, where required for the booting the
device drivers, configuration files & etc.
Let me describe shortly about the each directory.
1. /bin: all executable primary programs required for booting. It contains basic
commands which can run in the single-user-mode.
Ex: du, df, tar, rpm, wc, history & etc.
2. /boot: it holds files during the boot-up process, including Linux-Kernel.
3. /dev: Contains device files for all the hardware devices on the machine.
Ex: Cdrom, cpu, & etc.
4. /etc: contains the configuration files for every individual program.
5. /home: default user home directory.
6. /lib: the Lib directory contains the KERNEL MODULES and SHARED LIBRARY
these images required to boot the system and run commands in the root file system.
7. /lost+found: this Directory is installed during installation of Linux. It is useful for
recovering the files that may be broken due to unexpected shut-down.
8. /media: temporary mount directory is created for removable devices.
9. /mnt: Temporary mount directory for mounting the file system.
10. /opt: It contains third party application softwares.
11. /proc: A virtual and pseudo-file-system which contains information about the running
process with a particular process-id and PID.
12. /root: the root is the home directory for the root user and should never be confused
with “/”.
13. /run: the directory is the only clean solution for the early-runtime-dir problem.
14. /sbin: it contains binary executable programs, required by the System
Administrator, for Maintanance.
Ex: iptables, fdisk, ifconfig, swapon, reboot & etc.
15. /srv: Service is abbreviated as “srv”. This directory contains server-specific and
service-related files.
16. /sys: Modern Linux distributions includes a /sys a directory as a virtual file system.
17. /tmp: Its means a Temporary File system.
18. /usr: contains executable binaries, documentation, source code, libraries for the
second-level program.
19. /var: Stands for the variable. The contents of the files are expected to grow. This
directory contains log, lock, spool, mail, and temp files.
LINUX HAVING CONFIGRATION FILES: let us discuss about their location and their usage.
Linux is an operating system which having well-defined configuration files {binaries, man
pages, info files & etc for every process.
/etc/motd: motd stands for Message Of The Day, The Message users get upon login.
/etc/termcap: An ASCII file that defines the behaviour of Terminal, console and printers.
/etc/X11: Configuration files of X-Windows system.
INTRODUCTION
BASIC Commands
#df –h It is showing file system, size, used, available, use%,
mounted
#df –h .{which file we want see To know the exact location of the file system.
we need to be in that path and
then execute this command.
#cd / Go to root
#vi /etc/sysconfig/network-scripts/ifcfg-eth0/
#ifconfig -a —network interface to check ip address.
Service network restart :- to reset the ip address
FIND COMMAND
#find /var -xdev -type f -ls|sort -rn --key=7|head -20
# cat FILENAME Print the content of the provided file on the terminal
#head <filename> — view data from the top up to 10 lines. — man page for head
– if we use this command #head -n <filename> we have to keep a number in the
place of n. Then we view that number of lines.
# head -n 5 FILENAME This example displays the top 5 lines of provided file
By default the head utility displays the first ten lines of a file.
#tail <filename> — view data from the end up to 10 lines. — man page for tail
– if we use this command #tail -n <filename> we have to keep a number in the
place of n. Then we view that number of lines.
# tail -n 5 FILENAME This example will display the last 5 lines of the provided file
# less When you want to view a file that is longer than one screen, you can use either the
FILENAME less utility or the more utility.
You can use keyboard arrow to navigate around the file to read the text
RENAME COMMAND
#mv <old-name> <new-name> – This command used to change the name of the
file.
m # mv Changes the Name of a File man
v EXISTING- page
FILENAME for mv
NEW-FILENAME The mv (move) utility can rename a file without making a
copy of it. The mv command line specifies an existing file
and a new filename using the same syntax as cp
FILTERS
#grep “keyword” <filename>— grep is used to search the line (or ) sentence in a
huge amount of data.
— -i — case sensitive ( if we enter -i will get output either lower case & upper case
also )
— -iw — case sensitive , exact word. (if we enter -we will get the exact output word
in a file).
— -iv — if we don’t want the line (or) word in a particular file we use -v.
— -n — it is used to show the number in format.
The filters are used to sort the data in a file if data is very huge in amount. | pipe is
used for the filters.
Ex:-
#ls -l | grep -i “o” ifcfg-eth0
#ls -l |more.
re # grep The grep utility searches through one or more files to see man page
p STRING whether any contain a specified string of characters. for grep
FILENAME
This utility does not change the file it searches but simply
displays each line that contains the string.
#df -h — To check file systems — how to check file systems or no of file systems
and mounted file systems.
du -l
Du -lrth
Du -lh
—
#pwd — to check the present working directory.
#init 6 — reboot.
#init 0 — shutdown
Ctrl +b — start up
Ctrl +e — shutdown
ctrl +j — suspend
Ctrl +r — restart
touch # touch FILE Create empty file man page for touch
Navigation or cd commands:
#cd — To go into a directory or change directory —(move to users home
directory) if we enter cd it goes to the home directory.
#cd .. — It is used one step back for the directory.
#cd ../.. — It is two steps back from the directory.
#cd - — it helps to go the previous path.(swap)
Vi editor
#vi <filename> — By using this command we can create a file , view the
data, append the data, modify the data.
INSERT MODE:
EXECUTE MODE:
w — Save.
wq — save & quit.
wq! — save & quit forcefully.
q — quit without save.
q! — quit without saving forcefully.
set nu — Display number of lines.
COMMAND MODE:
yw – Copy word.
yy – Copy line.
3yy – Copy 3 lines.
p — Paste.
cc — Remove the content of the line and create an empty line.
dd – Delete line.
dw – Delete word.
cw – change word.
x – Delete character.
r — Replace character.
R – Replace line.
u – Undo last change.
U — undo last change line.
^ — Position cursor at start line.
$ — Position cursor at end line.
gg — move to the top of the screen.
M - middle of the screen
G — move to the end of the screen.
After the scanning the lun the logical name will be created.
STAGE –3 — FIND THE DISK —Check the disk created or not.
By using #fdisk -l we check whether the disk is created in the required order or not.
The disk partitions defined and/or created during the installation are
configured to be automatically mounted whenever the system boots.
However, what happens when additional disk drives are added to a system
after the installation is done? The answer is "nothing" because the system
was not configured to mount them automatically. However, this is easily
changed.
The answer lies in the /etc/fstab file. This file is used to control what file
systems are mounted when the system boots, as well as to supply default
values for other file systems that may be mounted manually from time to
time.
STAGE –10— umount /mount point /sbi1///
The #umount -a read from mtab entries details info
STAGE –11— mount /mountpoint /sbi1
The #mount - a reads fstab entries details info
STAGE –12— df -h /mountpoint /sbi1
The #df -h reads mtab entries
STAGE –13— ACCESSING THE PARTITION DISK
By using this command #cd /MOUNT POINT(sbi1)
*****
#mount -t ext4 /disk /mnt – if we want to check whether any mount file created disk
or not - we have to check with a temporary mount point- the /mnt is used for
temporarily if we mount also there will be no problem.
How to find whether the file system was created for a disk or not.
By using the command #blkid we check if the file system was created to a disk or
not.
How to check file system type(fs type) .
By using the command #df -Th we can check file system type, which type it is
created on disk.
How to change owners?
By using the command #chown <new owner name> :<gid> <path> we can
change the ownership of the particular file or directory.
● We can give the one user in one group but we can change the group with
another group.
Ex:
[root@NANI-SYS-26-13-B ~]# chown bhanu:9000 /home/bhanu
[root@NANI-SYS-26-13-B ~]# ls -ld /home/bhanu
drwx------ 4 bhanu chch 4096 Apr 25 14:21 /home/bhanu
[root@NANI-SYS-26-13-B ~]#
How to give owner permissions?
#chmod 644 file
By using this command we can give the owner permission. And also we tell the file to
who can access this particular file.
–USER ADMINISTRATION–
#useradd <username> or useradd <option> <argument> <username>
OPTIONS:
- u —UID - c —Comment - g —Primary Group Name or GID
- c —Comment - o —Override -s —Shell
- G — Secondary group - M — without home directory.
Ex :-- #useradd -u 2301 -g [2300 or 23a] -d /home/bobby -s /bin/bash bobby
#useradd -u 2301 -g [2300 or 23a] -M -d /home/bobby -s /bin/bash bobby
—/etc/passwd -every user information will be stored in this file.
Ex:- [root@NANI-SYS-1-6-A ~]#cat /etc/passwd
[root@NANI-SYS-1-6-A ~]# cat /etc/passwd |grep -i hari
hari:x:2306:2300::/home/hari:/bin/bash
[root@NANI-SYS-1-6-A ~]#
Stage –4 Creating the password for the user #passwd bobby then we have to
enter password for two times.
Ex :-- #passwd bobby
Changing password for the user bobby.
New password:
Retype new password:
Passwd: all authentication tokens updated successfully.
#passwd <username> or <option> <username>
OPTIONS:
- S — status of the lock - l — lock the password
- u—unlock the password - x <number> –we have to mention the expiry
date, if we mention -1 in the place of number it says that unexpire user.
—/etc/shadow —every user password information will be stored in this file. It will be
stored in encrypted format.
Ex:- [root@NANI-SYS-1-6-A ~]# cat /etc/shadow
[root@NANI-SYS-1-6-A ~]# cat /etc/shadow|grep -i hari
hari:!!$6$iVqNqTwu$/sKxWgSVSLja/
LCUxt4ux2gSK3IIKsqy.oLAIlTdnzzm7oYTwOwEVuOJfGv3uRPJ6tUsaytf6ZmIhc2CL
TmQC0:19432:::2:::
[root@NANI-SYS-1-6-A ~]#
—chage <username> or <option> <username> {CHANGE AGE}—it is to view
and edit the permissions.
OPTIONS:
- l — list of all above parameters.
Ex: [root@NANI-SYS-1-6-A ~]# chage -l hari
Last password change : Mar 16, 2023
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : -1
Maximum number of days between password change : -1
Number of days of warning before password expires :2
—/etc/login.defs –default permission of the passwd settings are available at this
file.
-HOW TO CHANGE SECONDARY GROUP-
#usermod -G <group id> <username> –it is used to add a second person in the
group.
To check the second person #cat /etc/group.
Ex :[root@NANI-SYS-1-6-A ~]# cat /etc/group|grep -i hari
lsg:x:6800:tom,mendis,haris,levi,rony
[root@NANI-SYS-1-6-A ~]#
SWAP
Swap is an independent file system managed by kernel not by the
operating system or by the hardware.The swap is nothing but the extended
memory. We can use the hard disk as an extended ram.
The swap space is located on disk, in the form of a partition or a file.
Swap space in Linux is used when the amount of physical memory (RAM)
is full. If the system needs more memory resources and the RAM is full,
inactive pages in memory are moved to the swap space. While swap space
can help machines with a small amount of RAM, it should not be
considered a replacement for more RAM. Swap space is located on hard
drives, which have a slower access time than physical memory. Swap
space can be a dedicated swap partition (recommended), a swap file, or a
combination of swap partitions and swap files. But , it can also be set
afterward by using the mkswap and swapon commands
SWAP-IN: Moving data from Swap space to the main memory of the machine.
SWAP-OUT: Moving main memory contents to Swap disk when main memory space
fills up
● Sometimes it is necessary for the 1gb or 1gb ram install system. As per
the above recommended swap space condition we have add 4gb [2
times greater than the swap size].
Stage-1 ADD LUN OF 4GB
RIGHT CLICK ON THE TOP SCREEN.
CLICK ON THE SETTINGS
ADD THE NEW LUN
CLICK ON OK
Stage-2 SCAN THE LUN
#echo “- - -” > /sys/class/scsi_host/host0/scan
Stage-3 CHECK THE LUN WHETHER ADDED OR NOT
#fdisk -l
Stage-4 MAKE FILE SYSTEM OF SWAP
#mkswap <disk name>
Stage-5 UPDATE THE SWAP
#swapon <disk name>
ERASE OPTIONS
● -e |-- erase erase option.
● - - nodeps don’t check dependencies packages before uninstalling the
packages.
● -q query
● -f find the file – used to check in which packages the command.
Ex: rpm -qf /sbin/fdisk or #which fdisk
- - last used to check the last installed package.
Cd /var/www/html.
PATCHING
There is a version and release for every version. For example: RHEL
6.9 the 6 – version 9 is release. For every version the vendor rearranges the
security issue and corrects the mistakes like security , performance , bugs
fixes.
If they have a security issue they will release another version
immediately with a new update. Like 6.0,1,2,3,4,5,6,7,8,9,10.
This process they called OS patching / kernel upgrade.
The patching is two types
1. Reboot patching
2. Hotpatching
REBOOT PATCHING : [firmware(update)+os patching]
We have to shutdown the server after the patching. Needs 2 to 3 hours
or more to install the patches .
The reboot patching may be done yearly once.
STEP–1: Shut down apps/db(database)
STEP–2: Apply patches (os/firmware)----- patch script
STEP–3: reboot
STEP–4: Start applied db(database)
If any file is deleted for the server. If we added the data after deleting it.
We can't retrieve the file.(if back file also deleted)
Log is activity of the server /var/log – all activity
HOTPATCHING:
We do not need to shutdown the server after the patching. It is a live
patching. It is mostly kernel patching and having 0 down time.
---------------------
Patching servers as a way to update linux systems and keep them
secure. As new vulnerabilities are recognized , software developers release
fixes, available via update. It’s imperative that these patches are applied to
keep data secured. And to minimise the risk of malicious impacts.
As we know for every version there will be updates released by the product
vendors.
Major reasons for the patching of the kernel is bugs, issues, performances &
security bugs /vulnerability.
If the vendors got security patches named RHSA (RED HAT SECURITY
ADVISORY) the vendors will fix the security issues and release the new release.
Advisors are pieces of metadata that tie an update to a human-readable
description. These advisors are created by Red Hat engineering when they generate
a new package and are published on the RED HAT CUSTOMER PORTAL.
Advisories come in three types:-
● Red Hat Security Advisory ( RHSA) : RHSAs contain one or more security
fixes and might also contain bug or enhancement fixes.RHSAs are generally
considered the most important type of errata for many organisations. RHSAs
are ranked using a severity rating of low, moderate, important or critical based
on the severity of the vulnerability.
● Red Hat Bug Advisory (RHBA) : RHBAs always contain one or more bug
fixes and might contain enhancements, but do not contain security fixes.
Because RHBAs are released for bug fixes, they are often considered more
important than an RHEA in priority.
● Red Hat Enhancement Advisory ( RHEA) : RHEAs contain one or more
enhancements or new features and do not contain bug fixes or security fixes.
Essentially, a RHEA is released when new features are added and an
updated package is shipped.
Red Hat commits to generating errata advisories for different products based on
public lifecycle policies.
OS means the operating system that travels from the first factor of the disk
called OS.
OS—[GUI+APPS+TOOLS+KERNEL]
OS means the combinations of GUI,APPS,TOOLS,KERNEL.]
User is — version ex;-6.8,6.9. Admin is — only the kernel version.
*** INIT — It is the first program . it loads the stages of the Runlevels.
Three services will be added in the one runlevel to another runlevel.
These are the commands to check which runlevel i am in.
● Runlevel
● Who -r
One runlevel to another runlevel services will be increased.
if , I am in at the stage of #init 3 . I changed the runlevel 3 to 5 then changed the
command user interface to graphical user interface.
The INIT configuration file presents at the /etc/init/control-alt-delete.conf
Runlevels
#init 0 — Power off
#init 1 — Single user/resume mode
#init 2 — multi user
#init 3 — multi user with NFS {NETWORK FILE SYSTEM}
#init 4 — not in use
#init 5 — x11 –GUI
#init 6 — reboot
The OS is installed for usage of apps +service +users
PROCESS MANAGEMENT
Process means a running program in execution. If there is any application
going on there are some services running for each service there will be some
processes running in the background for each service.
It generally takes an input, processes it and gives us the appropriate output.
There is two types of processes:
1. Foreground processes: this names another interactive process. These
are the processes that are executed by the user. They are not initiated
by the system services. These processes take input from the user and
return the output. But the major disadvantage is when new processes
run directly in the terminal. We cannot do another process in the same
terminal.
2. Background processes: this is named another non-interactive process.
These processes are executed or initiated by the system itself or by the
users. Although these processes can be managed by the user. These
processes have a unique process id {PID} and parent process id
{PPID}. Then it is easy for the user and the system to run other
commands or the tasks in the foreground. In parallel the other
background processes running in the background.
As all know the parent process id and the process id will be assigned by the
kernel.
These are kernel major operations:
● MEMORY MANAGEMENT
● DISK MANAGEMENT
● SECURITY MANAGEMENT
● PROCESS MANAGEMENT
There are two types of processes running in the operating system:
1. Process
2. Daemon
PROCESS: The process starts the task and after the completion of the task it
will exit. It’s not continuous service. It is also called a foreground process.
DAEMON: Daemon are all names or it said continuous service. If the activity
occurred, it run’s the task and after compilation of the task it will go to sleep
mode. If there is no task it will be there in sleep mode.
It will be represented as a “ d” letter in the end.
The kernel assigns some PID ‘s for the process running in the system
depending on the task given by the user.
There is a tree chain link created by the kernel for the processes depending
on service and the applications running on the system.
These PID and PPID numbers are assigned randomly depending on the task
and the processes. In case the process is completed the pid will be allocated
another process that is not comparable to before one.
The PID and PPID lifetime is up to the task completion or up to the reboot.
What does the kernel do?
It creates a [PID] under the [PPID], where it performs the process of a
program to the operating system on the processor.
Every [PID] has a group id named as [PPID]. As we call PID is a child for the
PPID. “ There are a bunch of processes having different [PID] running for the
single service that have the same [PPID] because the processes are running
for the same application in the system”.
In case, if we delete the [PPID} all the children will become orphans .
In case, if we delete the child[PID] the parent process id [PPID] will allocate a
new PID number for the deleted child. Although the child is there in the
system.
In some scenarios for the [PPID] deleted. When we check the status of the
service. It comes as the service is dead. The child will not be deleted until the
system reboot.
No longer will child services harm the system. But, it will occupy space in the
system when it reaches the high occupancy in the system. The server will
hang up. If we reboot the server automatically the server deletes the
undeleted child processes.
LAB
#sleep 100
1. In this case, the name of the processes is sleep 100 but you may
change the same as per your need.
2. For stopping a process in between its execution. To stop the foreground
process in between of its execution we may press CTRL+Z to force stop
it. Pressing CTRL+Z in between the execution of the command will stop it.
#sleep 100
^Z
[1]+ stopped sleep 100
#
3. To get the list of jobs that are either running or stopped.
It will display the stopped processes in this terminal and even the pending ones.
#jobs -l
[1] + stopped sleep 100
#
4. To run all the pending and force stopped jobs in the background.
This will start the stopped and pending processes in the background.
#bg
[1]+ sleep 100 &
#
5. To get the details of the process running in the background.
#ps -ef |grep -i sleep
service
Or
5. Verifying the changes : after restart the network services verify the
interface whether the changed name is running or not . by using this commands
#ifconfig -a or #ip link show the interface should be a newly changed network
interface name.
LOGICAL VOLUME
Lvm means LOGICAL VOLUME MANAGEMENT. The combination of 2 or more
physical disks in order to make a big logical disk is named as logical volume.
● Lvm allows the creation of a number of file systems on the single hard
disk.
disk space. The normal partition cannot be extended for that application
partition , then delete the partition and again will create the partition with
more disk space , then format the disk and mount the partition and finally
restore the application from the backup. The process requires the down
time.
So, to overcome the problem the LVM concept is used. It is used to extend
or reduce the file system as per the client requirement without of anydata.
8e.
the lv. And create a filesystem and mount the filesystem with a mount point.
The logical volume can easily increase or decrease as per the requirements.
physical extent.
volume.
reduce logical volume size with the simple commands. We can re-
by,
group by,
Or
5. Make the file system on the above created logical volume by,
volume name>
6. Create a mount point to the above created LVM file system by,
by,
#mount /dev/<volume group name>/<logical volume name>
<mount point>
#vim /etc/fstab
Esc + :wq!
#mount -a
Raid levels
RAID (Redundant Array of Independent Disks) is a data storage technology that combines
multiple physical disk drives into a single logical unit for improved performance, data redundancy, or both.
There are several RAID levels, each with its own characteristics and benefits. Here are some commonly
1. RAID 0 (Striping): Data is divided across multiple drives in stripes without redundancy. It offers
improved performance by distributing data across drives, but there is no fault tolerance. If one
drive fails, data loss occurs.
2. RAID 1 (Mirroring): Data is mirrored across two or more drives. It provides redundancy, as all
drives contain identical data. If one drive fails, data can be retrieved from the remaining drives.
3. RAID 5 (Striping with Parity): Data is striped across multiple drives, and parity information is
distributed across all drives. Parity information allows for data recovery in case of a single drive
failure. RAID 5 requires a minimum of three drives.
4. RAID 6 (Striping with Double Parity): Similar to RAID 5, but with two sets of parity information.
RAID 6 can tolerate the failure of two drives simultaneously, providing higher fault tolerance
compared to RAID 5. RAID 6 requires a minimum of four drives.
5. RAID 10 (RAID 1+0): It combines mirroring (RAID 1) and striping (RAID 0). Data is mirrored
across multiple pairs of drives and then striped across the mirrored pairs. RAID 10 offers both
performance and redundancy, but it requires at least four drives.
6. RAID 50 (RAID 5+0): It combines striping (RAID 0) and RAID 5. Data is striped across multiple
RAID 5 arrays. RAID 50 provides improved performance and fault tolerance but requires at least
six drives.
7. RAID 60 (RAID 6+0): Similar to RAID 50, but with RAID 6 instead of RAID 5. It combines
striping (RAID 0) and double parity (RAID 6). RAID 60 offers high performance and fault
tolerance, but it requires at least eight drives.
These are some of the commonly used RAID levels, but there are also other variations and hybrid RAID
levels available, each with its own advantages and considerations depending on the specific use case and
requirements.
What is RAID? What is the use of the RAID and how many types of RAIDs available?
(ii) Software RAID (Does not depends on vendors and less expensive when compared to
Hardware
How many types of software RAIDs are available and their requirements?
(i) RAID - 0 —
(iii) RAID - (1+0) --- Mirroring + Stripping ---- Minimum 4 disks required
(iv) RAID - (0+1) --- Stripping + Mirroring ---- Minimum 4 disks required
(v) RAID - 5 ---- Striping with parity ---- Minimum 3 disks required
To configure RAID - 0, minimum 2 disks are required and the partition id is "fd".
To configure RAID - 1, minimum 2 disks are required and the partition id is "fd".
In this the same data will be written on 2 disks ie., exact copy on both the disks.
if one disk fails, we can recover the data from another disk.
To configure RAID - 5, minimum 3 disks are required and the partition id is "fd".
If one disk fails, we can recover the data using the remaining two disks and parity.
RAID - 5 uses Striping with parity and requires only three disks. Because of Stripping the
data reading
and writing will be fast.And by using parity we can recover the data if one of the three
disks failed.
So, the main advantage of RAID - 5 we can get fast writing, reading and also redundancy
fault
RAID LEVELS
RAID means REDUNDANT ARRAY OF INDEPENDENT DISKS.
It is a data storage technology that combines multiple disk drives
into a single logical unit for improving the performance ,data
redundancy or both.
There are two types of raid available. They are:
1.Hardware RAID : it depends on vendors . These are more
expensive to use.
2.Software RAID : it doesn’t depend on the vendors. These are less
costly to use.
RAID’s are maintained by the system administrator.
There are mainly 3 raid levels to discuss . they are
1.Raid 0
2.Raid 1
3.Raid 5
RAID 0
The raid 0 has two levels :
1. Linear / Concat
2. Stripe
Linear /concat:
● The linear level should have a minimum one disk to
create lvs.
● In this reading formance is high and writing formance is
low because in this linear level write the data parallel in
disks .
● It don’t waste the space and zero fault tolerance
Stripe:
● In striping data added across the multiple disks at the same
time by dividing the contents.
● so write performance is high , read performance is low.
● Assume if we have two disks and if we save content to logical
volume it will be saved under both two physical disks by
dividing the content.
● RAID 0 is used for better performance, but we can’t get the
data if one of the drives fails.
1. RAID 0 has High Performance.
2. Zero Capacity Loss in RAID 0. No Space will be wasted.
3. Zero Fault Tolerance ( Can’t get back the data if any one of disk
fails)
RAID 1:
RAID 1 is implemented with a mirror. It means an exact clone (or
mirror) of the data written in two drives.
A minimum two number of disks or more needed to create RAID 1
and it is useful only when read performance or reliability is more
precise than the data storage capacity.
Mirrors are created to protect the data loss due to disk failure.
When one disk fails, the same data can be retrieved from another
functioning disk. However, the failed drive can be replaced from the
running computer without any user interruption.
Features of RAID 1
1. Mirror has Good Performance.
2. 50% of space will be lost. Means if we have two disks with
500GB size total, it will be 1TB but in Mirroring it will only show us
500GB.
3. No data loss in Mirroring if one disk fails, because we have the
same content in both disks.
RAID 5:
In RAID 5, data strips across multiple drives with distributed parity.
The striping with distributed parity means it will split the parity
information and stripe data over the multiple disks, which will have
good data redundancy.
For RAID Level it should have at least three hard drives or more.
RAID 5 is being used in the large scale production environment
where it’s cost effective and provides performance as well as
redundancy.
Linux provides several tools for accessing files on remote systems
connected to the network.
Nfs stands for Network file system. Here it is used to share/mount the
hard disc through the network. An NFS server can export one or more
directories that can be mounted on a linux machine.
NOTE: that if you need to mount a linux filesystem on a windows
machine. You need to use Samba/CIFS instead.
Basically, NFS has the three NFS versions.
1.NFS v2
2.NFS v3
3.NFS v4
At present we were mainly using the NFS v4 for greater security with
allowed by the firewall. The network information service (NIS) maintains
Configuration files for all systems on a network.
What is FTP?
➔ FTP stands for the File Transfer Protocol.
➔ Ftp is a standard internet protocol provided by TCP/IP. And been
used for transmitting the files from one host to another.
➔ It is mainly used for transferring the web page files from their
creator to the computer that acts as a server for other computers
on the internet.
➔ It is also used for downloading the files to the computer from
servers.
It provides the sharing of files.
It is used to encourage the use of remote computers.
It is to transfer the data-more reliable and efficiently.
Why do we have to use FTP?
Basically, FTP has two types, one is data connection :it mainly transmits
the data from one host to another host. And, another one is control
connection : is used to secure the connection properly. Even if the two
systems are different and also the structure is different.
Find command and using of options
Yum
Yum is to install the packages along with rpm it will ask the dependencies file to install
the packages. So, we use yum for no dependencies.
To check whether yum is configured in our server.
#yum repolist
We can configure the yum at #cd /etc/yum.repos.d/
Trusted Authentication
It is nothing but, if we tried to login without passwd from one server to another
server by using an automated key is known as trusted authentication.
Mostly , this trusted authentication was used in the same application deployed
server. This trusted authentication has not been done at one to another type of
application of a different application server. If we do that it leads to security
issues.
Where users can login by 2 ways one is with passwd and another one is with
using keys.
There are two types of keys generated. They are
Public key
Private key
Private key means the key. And the public key means the lock.
Vm-ware
Installation procedure for Vm-ware
Module ‘HV’ power on failed virtualized intel VT-x/EPT is disabled for this ESX virtual
V-center
First we need to turn on the system where the
vmware esxi machine.
And we
Step5:-- After creating the datacenter we need to click on the cluster that we added before or
ctrl+L