0% found this document useful (0 votes)
36 views11 pages

Linux Field

This document reports on a field work conducted by 6 students from the B.Sc. Information Technology program at KG College of Arts and Science. The field work focused on Linux and Shell Programming and was conducted in the 2022-2023 academic year under the guidance of faculty coordinator Ms. Lavanya Perumal. The report provides details on logical volume manager in Linux, including how logical volumes are used to aggregate space from physical volumes into linear or striped configurations and how data is mapped across physical volumes in those configurations. It also outlines formatting and display options for the LVM commands.

Uploaded by

2126ja17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views11 pages

Linux Field

This document reports on a field work conducted by 6 students from the B.Sc. Information Technology program at KG College of Arts and Science. The field work focused on Linux and Shell Programming and was conducted in the 2022-2023 academic year under the guidance of faculty coordinator Ms. Lavanya Perumal. The report provides details on logical volume manager in Linux, including how logical volumes are used to aggregate space from physical volumes into linear or striped configurations and how data is mapped across physical volumes in those configurations. It also outlines formatting and display options for the LVM commands.

Uploaded by

2126ja17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

KG COLLEGE OF ARTS AND SCIENCE

Affiliated to Bharathiar University and Accredited by NAAC


ISO 9001 : 2015 Certified Institution
KGiSL Campus, Coimbatore - 35

REPORT OF THE FIELD WORK


Academic Year 2022 - 23

Submitted By:

Reg. No. Name of the Students


2126J0078 GOWRI SHANKAR TR
2126J0084 KANISHKA S
2126J0085 KARMEGA KUMAR A
2126J0098 PRATHEESH N
2126J0111 SENTHIL R
2126J0115 SHIVANI B
2126J0121 THARANI THARAN R

Faculty Coordinator

Ms. Lavanya Perumal


Assistant Professor, Department of Information Technology
April 24, 2023
KG COLLEGE OF ARTS AND SCIENCE
Affiliated to Bharathiar University and Accredited by NAAC
ISO 9001 : 2015 Certified Institution
KGiSL Campus, Coimbatore - 35

REPORT OF THE FIELD WORK

Academic Year: 2022 – 2023

Programme Name: B.Sc. Information Technology

Programme Code: 26J

Course Name: Linux and Shell Programming

Course Code: 43B

Semester: IV

Batch & Section: 2021 – B.Sc. IT -‘A’

Submitted By:

Reg. No. Name of the Students


2126J0078 GOWRI SHANKAR TR
2126J0084 KANISHKA S
2126J0085 KARMEGA KUMAR A
2126J0098 PRATHEESH N
2126J0111 SENTHIL R
2126J0115 SHIVANI B
2126J0121 THARANI THARAN R

Faculty Coordinator with Designation: Ms. Lavanya Perumal

Date of Submission: 24/04/2023


Title: Logical Volume Manager

Objectives:

 As of the Red Hat Enterprise Linux 7.3 release, LVM supports log reports, which
contain a log of operations, messages, and per-object status with complete object
identification collected during LVM command execution
 LVM provides a wide range of configuration and command line options to produce
customized reports and to filter the report's output.

LVM Logical Volumes


 In LVM, a volume group is divided up into logical volumes. The following sections
describe the different types of logical volumes.

Linear Volumes
 A linear volume aggregates space from one or more physical volumes into one logical
volume. For example, if you have two 60GB disks, you can create a 120GB logical
volume. The physical storage is concatenated.

 Creating a linear volume assigns a range of physical extents to an area of a logical


volume in order.
Extent Mapping

 The physical volumes that make up a logical volume do not have to be the
same size. “Linear Volume with Unequal Physical Volumes” shows volume
group VG1 with a physical extent size of 4MB.

 This volume group includes 2 physical volumes named PV1 and PV2. The
physical volumes are divided into 4MB units, since that is the extent size. In
this example, PV1 is 200 extents in size (800MB) and PV2 is 100 extents in
size (400MB).

 You can create a linear volume any size between 1 and 300 extents (4MB to

1200MB). In this example, the linear volume named LV1 is 300 extents in size.

Linear Volume with Unequal Physical Volumes

 You can configure more than one linear logical volume of whatever size you require
from the pool of physical extents. “Multiple Logical Volumes” shows the same
volume group as in “Linear Volume with Unequal Physical Volumes”, but in this case
two logical volumes have been carved out of the volume group: LV1, which is 250
extents in size (1000MB) and LV2 which is 50 extents in size (200MB).
Multiple Logical Volumes

Striped Logical Volumes

 When you write data to an LVM logical volume, the file system lays the data out
across the underlying physical volumes. You can control the way the data is written to
the physical volumes by creating a striped logical volume.

 For large sequential reads and writes, this can improve the efficiency of the data I/O.

The following illustration shows data being striped across three physical volumes. In this
figure:
 the first stripe of data is written to the first physical volume
 the second stripe of data is written to the second physical volume
 the third stripe of data is written to the third physical volume
 the fourth stripe of data is written to the first physical volume
In a striped logical volume, the size of the stripe cannot exceed the size of an extent.

Striping Data Across Three PVs

 Striped logical volumes can be extended by concatenating another set of devices onto
the end of the first set. In order to extend a striped logical volume, however, there must
be enough free space on the set of underlying physical volumes that make up the
volume group to support the stripe.

 For example, if you have a two-way stripe that uses up an entire volume group, adding
a single physical volume to the volume group will not enable you to extend the stripe.

 Instead, you must add at least two physical volumes to the volume group. For more
information on extending a striped volume, “Extending a Striped Volume”.
A Detailed Explanation on LVM:
 As we have already mentioned that the concept of using LVM is very much similar to
virtualization; therefore, its working is also more or less the same as virtualization.

 We will try to understand the working of LVM by creating an example scenario.


Generally, we have a physical device that is divided into multiple partitions

 All these partitions have a file system installed on them which can be used to manage
these partitions.

Format Control

Whether you use the pvs, lvs, or vgs command determines the default set of fields displayed
and the sort order. You can control the output of these commands with the following
arguments:

 You can change what fields are displayed to something other than the default by using
the -o argument. For example, the following output is the default display for
the pvs command (which displays information about physical volumes).

# pvs
PV VG Fmt Attr PSize PFree
/dev/sdb1 new_vg lvm2 a- 17.14G 17.14G
/dev/sdc1 new_vg lvm2 a- 17.14G 17.09G
/dev/sdd1 new_vg lvm2 a- 17.14G 17.14G

The following command displays only the physical volume name and size.

# pvs -o pv_name,pv_size
PV PSize
/dev/sdb1 17.14G
/dev/sdc1 17.14G
/dev/sdd1 17.14G

 You can append a field to the output with the plus sign (+), which is used in
combination with the -o argument.
 Adding the -v argument to a command includes some extra fields. For example,
the pvs -v command will display the DevSize and PV UUID fields in addition to the
default fields.
# pvs -v
Scanning for physical volume names
PV VG Fmt Attr PSize PFree DevSize PV UUID
/dev/sdb1 new_vg lvm2 a- 17.14G 17.14G 17.14G onFF2w-1fLC-ughJ-D9eB-
M7iv-6XqA-dqGeXY
/dev/sdc1 new_vg lvm2 a- 17.14G 17.09G 17.14G Joqlch-yWSj-kuEn-IdwM-
01S9-XO8M-mcpsVe
/dev/sdd1 new_vg lvm2 a- 17.14G 17.14G 17.14G yvfvZK-Cf31-j75k-dECm-
0RZ3-0dGW-tUqkCS

 The --noheadings argument suppresses the headings line. This can be useful for
writing scripts.
The following example uses the --noheadings argument in combination with
the pv_name argument, which will generate a list of all physical volumes.

# pvs --noheadings -o pv_name


/dev/sdb1
/dev/sdc1
/dev/sdd1

 The --separator separator argument uses separator to separate each field.


The following example separates the default output fields of the pvs command with an
equals sign (=).
# pvs --separator =
PV=VG=Fmt=Attr=PSize=PFree
/dev/sdb1=new_vg=lvm2=a-=17.14G=17.14G
/dev/sdc1=new_vg=lvm2=a-=17.14G=17.09G
/dev/sdd1=new_vg=lvm2=a-=17.14G=17.14G

To keep the fields aligned when using the separator argument, use
the separator argument in conjunction with the --aligned argument.

# pvs --separator = --aligned


PV =VG =Fmt =Attr=PSize =PFree
/dev/sdb1 =new_vg=lvm2=a- =17.14G=17.14G
/dev/sdc1 =new_vg=lvm2=a- =17.14G=17.09G
/dev/sdd1 =new_vg=lvm2=a- =17.14G=17.14G
 You can use the -P argument of the lvs or vgs command to display information
about a failed volume that would otherwise not appear in the output. For
information on the output this argument yields, see “Displaying Information
on Failed Devices”.

 For a full listing of display arguments, see the pvs(8), vgs(8) and lvs(8) man
pages.

 Volume group fields can be mixed with either physical volume (and physical
volume segment) fields or with logical volume (and logical volume segment)
fields, but physical volume and logical volume fields cannot be mixed. For
example, the following command will display one line of output for each
physical volume.

# vgs -o +pv_name
VG #PV #LV #SN Attr VSize VFree PV
new_vg 3 1 0 wz--n- 51.42G 51.37G /dev/sdc1
new_vg 3 1 0 wz--n- 51.42G 51.37G /dev/sdd1
new_vg 3 1 0 wz--n- 51.42G 51.37G /dev/sdb1

Logical Volume Creation Overview

The following is a summary of the steps to perform to create an LVM logical volume.
1. Initialize the partitions you will use for the LVM volume as physical volumes (this
labels them).
2. Create a volume group.
3. Create a logical volume.

After creating the logical volume you can create and mount the file system. The examples in
this document use GFS2 file systems.

1. Create a GFS2 file system on the logical volume with the mkfs.gfs2 command.
2. Create a new mount point with the mkdir command. In a clustered system, create the
mount point on all nodes in the cluster.
3. Mount the file system. You may want to add a line to the fstab file for each node in the
system.
Conclusion

 This article provided you with a brief overview of logical volume management which
is a very important framework of the Linux operating system. Without this framework,
we have very limited options for managing our storage space.

 Also, these options fail to resolve the conflicts between the varying storage needs of
multiple users. That is why LVM is considered as an essential component of the Linux
based systems.
Name of the Students Faculty Coordinator HoD

GOWRI SHANKAR TR

KANISHKA S

KARMEGA KUMAR A

PRATHEESH N

SENTHIL R

SHIVANI B

THARANI THARAN R

You might also like