Professional Documents
Culture Documents
2022G.C 1
At the end of this Lessons, you will be able to understand
Introduction to LVM concepts
What is LVM ? RAID levels
Why use LVM? RAID implementations
LVM Structure Software and Hardware RAID
2
Introduction to LVM concepts
It provides a higher level view of the disk storage on the computer
system than the traditional view of the disks.
It is a more flexible approach to managing disk storage space.
It is used to display information about volumes and potential
targets, how to create and destroy volumes of various types.
It is a device framework that provides logical volume management
for the Linux kernel.
it allows for the collection of multiple physical hard drives and
partitions into a single volume.
3
What is LVM?
LVM stands for Logical Volume Management.
LVM created in Linux.
It combines partitions, increasing throughput and making it simpler
to resize and move storage volumes as needed.
It is a tool for logical volume management which includes
allocating disks.
With LVM, a hard drive or set of hard drives is allocated to one or
more physical volumes.
4
CONT(…)
The physical volumes are combined into logical volumes, with the
exception of the /boot partition.
The /boot partition cannot be on a logical volume group because
the boot loader cannot read it.
5
CONT(…)
The volume groups can be divided into logical volumes.
It assignees mount point, such as /home and / and file system
types, such as ext2 or ext4.
When partitions reach their full capacity, free space from the
volume group can be added to the logical volume to increase the
size of the partition.
6
CONT(…)
Why Use LVM ?
For the easier management of physical storage devices.
Allows file systems to be easily resized as needed.
With traditional storage, three 1 TB disks are handled individually.
With LVM, those same three disks are considered to be 3 TB of
aggregated storage capacity.
7
Advantages of using logical volume management (LVM)
8
Disadvantages using logical volume management (LVM)
The main disadvantage of LVM is that it adds another layer to the
storage system.
While the overhead of LVM is usually small, any decrease in
performance can be critical on busy systems.
9
LVM Structure
Logical Volume Management enables the combining of multiple
individual hard drives and/or disk partitions into a single volume
group.
That volume group can then be subdivided into logical volumes or
used as a single large volume.
Regular file systems, such as EXT3 or EXT4, can then be created
on a logical volume
10
LVM System Layer
LVM is a very cool volume management tool.
It can be used for a variety of tasks.
11
CONT(…)
LVM Layer 1: Physical Volumes
The bottom layer
Consists of disks, partition. or RAID arrays
LVM Layer 2: Volume Groups
Create using physical volumes
Consist of one or more physical volumes
13
CONT(…)
LVM Commands
How to create a LVM in Linux, these are the below steps to be
followed.
Select or identify the correct disks to be used for LVM.
Create a Physical Volumes (PV) on the disk.
Create the Volume Group(VG) on the Physical Volumes
Create Logical Volumes(LV) on the Volume Group
Create a file system for the logical volumes
14
CONT(…)
15
CONT(…)
Creating a Physical Volumes from hard drive
pvcreate /dev/sda1 – create a physical volume from sda1
pvdisplay
16
pvscan
CONT(…)
The pvs command provides physical volume information in a
17
CONT(…)
18
CONT(…)
vgdisplay vg1: Display details on a volume group
19
CONT(…)
Creating the Logical Volumes
The VG can be subdivided into one or more Logical Volumes
(LVs).
The VG has a total capacity, and then some part of that capacity
is allocated to a Logical Volume.
The lvcreate command carves storage capacity from a VG.
There are a few options to be aware of.
20
CONT(…)
The syntax for the lvcreate command is as follows:
Lvcreate -n [ logical volume name ] -L [ logical volume size]
[ name of the volume group where the lv to be created it].
Here is the command to create a 20M Logical Volume named lv02
carved from the vag01 Volume Group:
Lvcreate -n lv01 –L 20M vag01
21
CONT(…)
we created the vag01 Volume Group from one Physical
Volumes, /dev/sda1.
You can use the lvdisplay command to see the Logical Volume's
configuration.
22
LVM Components
26
CONT(…)
Discuses the following main concepts
Types of RAID
Disk Issues
27
CONT(…)
Characteristics of RAID
Fault-tolerance which is the ability to survive of one or several disk
failures.
Performance which shows the change in the read and write speed of
the entire array as compared to a single disk.
The capacity of the array which is determined by the amount of user
data that can be written to the array.
The array capacity depends on the RAID level
Does not always match the sum of the sizes of the RAID member
disks.
28
CONT(…)
RAID storage techniques
The main methods of storing data in the array are:
Striping : splitting the flow of data into blocks of a certain size
called block size then writing of these blocks across the RAID
one by one.
Mirroring : It is a storage technique in which the identical copies
of data are stored on the RAID members simultaneously.
Parity: It is a storage technique which is utilized striping and
checksum methods.
29
CONT(…)
RAID levels
RAID 0 - striping
RAID 1 - mirroring
RAID 3 - Striping plus Dedicated Parity
RAID 5- striping with parity
RAID 6- striping with double parity
RAID 10- combining mirroring and striping
30
CONT(…)
RAID 0 - based on striping.
It doesn't provide fault tolerance but increases the system
performance (high read and write speed).
In a RAID 0 system data are split up into blocks that get written
across all the drives in the array.
Not technically RAID, but a RAID card is used to implement.
Data is striped between disks. Improves I/O in most cases.
31
CONT(…)
RAID level 1 – Mirroring
It utilizes mirroring technique, increases read speed in some
cases, and provide fault tolerance in the loss of no more than one
member disk.
Data are stored twice by writing them to both the data drive (and
set of data drives) and a mirror drive (or set of drives).
Disks are mirrored, data is written to both disks at any time. One
disk can be lost without losing data.
32
CONT(…)
Disks are mirrored, data is written to both disks at any time.
One disk can be lost without losing data
33
CONT(…)
RAID 3 - Striping Dedicated Parity
Data is written across multiple disks (striping).
A dedicated disk is used for parity. Recovering from remaining
disks plus parity disk.
Lost parity disk = lost RAID array. Fast I/O. it is also similar to
RAID 5
34
CONT(…)
RAID 5:- Striping plus Distributed Parity
RAID 5 is the most common secure RAID level.
It requires at least 3 drives but can work with up to 16.
Data blocks are striped across the drives and on one drive a
parity checksum of all the block data is written.
can be achieved in software, a hardware controller is
recommended.
35
CONT(…)
Data is written across multiple disks (striping).
Parity is written across all disks.
Most popular type of RAID after RAID 1.
Can lose any 1 disk (set of 3)
36
CONT(….)
RAID level 6 – Striping with double parity
Similar to RAID 5 but uses two different parity functions.
If two drives fail, you still have access to all data, even while the
37
CONT(…)
Data is written across multiple disks (striping).
Parity is written across all disks multiple times.
Fixes issues with RAID 5. Can lose any 2 disk (set of 4).
Fixes issue with 1TB+ drives.
38
CONT(…)
RAID level 10 – combining RAID 1 & RAID 0
It is possible to combine the advantages and disadvantages of
RAID 0 and RAID 1 in one single system.
This is a nested or hybrid RAID configuration.
It provides security by mirroring all data on secondary drives
while using striping across each set of drives to speed up data
transfers.
39
CONT(..)
Data is mirrored in multiple sets and sets are striped.
Provides performance and fault tolerance.
Can lose multiple disks as long as no one mirror loses all disks.
Requires more disks for same storage space.
Referred to as nested or hybrid RAID
40
CONT(…)
RAID implementations
RAID can be created by two different ways:
With the use of operating system drivers, so called software RAID.
With the use of special hardware, so called hardware RAID.
Software RAID
Software RAID is one of the cheapest RAID solutions
Software RAID is created based on the user's computer and
therefore it uses the host system CPU for implementation
41
CONT(…)
Hardware RAID
42
CONT(…)
Hardware RAID is created using separate hardware.
Basically there are two options:
Inexpensive RAID chip possibly built into the motherboard,
More expensive option with a complex standalone RAID
controller
A hardware RAID has some advantages over a software RAID, such
as:
doesn't use CPU of the host computer
allows user to create boot partitions
handles errors better, 43
CONT(…)
Advantages and Disadvantages of RAID
Advantages
DATA loss is prevented due to the fact that data can be recovered
from the disk that are not failed.
An improvement in cost-effectiveness because lower-priced disks
are used in large numbers.
The use of multiple hard drives enables RAID to improve on the
performance of a single hard drive.
RAID is fault tolerant because in most of the RAID level's data is
redundant in multiple disks. 44
CONT(…)
Disadvantages
When a drive fails, the probability that another drive in the array
will also soon fail rises, which would likely result in data loss.
Because drives have much greater capacity now than when RAID
was first implemented, it takes a lot longer to rebuild failed
drives.
If a disk failure occurs, there is a chance the remaining disks may
contain bad sectors or unreadable data
45
46
- END -