0% found this document useful (0 votes)
5 views

10 Steps about How to create LVM Volume - UX Techno

sdffbfdgbdfbd

Uploaded by

Chinmay Dakhane
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

10 Steps about How to create LVM Volume - UX Techno

sdffbfdgbdfbd

Uploaded by

Chinmay Dakhane
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

10 Steps about How to create LVM Volume - UX Techno https://linuxroutes.

com/how-to-create-lvm/

December 29, 2016 By admin — Leave a Comment

0 Shares
 Share  Share  Tweet  Pin0  Share
0  Share
0

Logical Volume Manager (LVM) is a software which provides the abstraction layer over the physical disk.
Which hides the details regarding where does data stored on the disk or from where the data comes from
actual physical disk whenever it is requested.Before learning how to create lvm lets learn terms in LVM so
that it will become easy to grasp the commands about LVM administration.

1. The Physical Disk/Media: It is the raw hard disk where the actual data is going to store. Ex: :
/dev/hda, /dev/hda6, /dev/sda.
2. Physical Volume (PV ): To bring the physical disk under LVM control we need to create the LVM data
structure on the disk. once its created the its called as a PV.
3. Physical Extents (PE):PV is divided into PE’s. AWS (26)
4. Volume Group( VG): is made of number of PE coming from one or more PV’s..
devops (15)
5. Logical Volume (LV ): A Logical Volume is the end result of our work, and it’s there that we store our
information. Extra (1)
�. FileSystem:is the actual formatted LM which is formatted �rst and the mounted on the directory for
Helm (2)
actual storage of the information.
HPUNIX (4)
To understand the above terms more clearly refer to below diagrams:
Kali Linux (2)

Physical Volume, contains Physical Extents: Kubernetes (7)

Linux (100)
+-----[ Physical Volume ]------+
| PE | PE | PE | PE | PE | PE | LVM (4)
+------------------------------+
Python (2)

Volume Group, containing 2 Physical Volumes (PVs) with 6 Physical Extents: Ubuntu (3)

1 of 5 08-01-2024, 00:34
10 Steps about How to create LVM Volume - UX Techno https://linuxroutes.com/how-to-create-lvm/

+------[ Volume Group ]-----------------+ Uncategorized (4)


| +--[PV]--------+ +--[PV]---------+ |
| | PE | PE | PE | | PE | PE | PE | |
| +--------------+ +---------------+ |
+---------------------------------------+

* indicates required
We now further expand this: Name

+------[ Volume Group ]-----------------+


| +--[PV]--------+ +--[PV]---------+ |
Email Address *
| | PE | PE | PE | | PE | PE | PE | |
| +--+---+---+---+ +-+----+----+---+ |
| | | | +-----/ | | |
| | | | | | | |
| +-+---+---+-+ +----+----+--+ |
| | Logical | | Logical | |
| | Volume | | Volume | |
| | | | | |
| | /home | | /var | |
| +-----------+ +------------+ |
+---------------------------------------+

This shows us two �lesystems, spanning two disks.

The /home �lesystem contains 4 Physical Extents, the /var �lesystem contains 2 Physical Extents.

Practicals: Now lets learn how to create LVM volume so that it can be mounted on Linux server.

1. Checking the attached disk:

[root@mann ~]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders


Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00076e7f

Device Boot Start End Blocks Id System


/dev/sda1 * 1 39 307200 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 39 2093 16501760 83 Linux
/dev/sda3 2093 2611 4161536 82 Linux swap / Solaris

Disk /dev/sdb: 5368 MB, 5368709120 bytes


255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 2147 MB, 2147483648 bytes


255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

2 of 5 08-01-2024, 00:34
10 Steps about How to create LVM Volume - UX Techno https://linuxroutes.com/how-to-create-lvm/

Disk /dev/sdc doesn't contain a valid partition table

Disk /dev/sdd: 1073 MB, 1073741824 bytes


255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sdd doesn't contain a valid partition table

Disk /dev/dm-1: 440 MB, 440401920 bytes


255 heads, 63 sectors/track, 53 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/dm-1 doesn't contain a valid partition table

2. Create LVM data structure on the disk /dev/sdc

[root@mann ~]# pvcreate /dev/sdc

Physical volume "/dev/sdc" successfully created

2a. R ec h e c k i t u si ng pvdis ply c o mm and.

[root@mann ~]# pvdisplay


--- Physical volume ---
PV Name /dev/sdb
VG Name vg01
PV Size 5.00 GiB / not usable 4.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 1279
Free PE 1174
Allocated PE 105
PV UUID 3p2Wdk-SkZD-76ko-TQiP-IrwX-Whk5-WIzR7Q

"/dev/sdc" is a new physical volume of "2.00 GiB"


--- NEW Physical volume ---
PV Name /dev/sdc
VG Name
PV Size 2.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID qoiBZ4-mRwV-G96p-U07x-zxwf-4iqY-wLPKUS

3 . C re a t e n e w VG

[root@mann ~]# vgcreate myvg /dev/sdc

Volume group "myvg" successfully created

4.Then Create new LV of size 200mb in the newly created VG.

[root@mann ~]# lvcreate -L 200 myvg

3 of 5 08-01-2024, 00:34
10 Steps about How to create LVM Volume - UX Techno https://linuxroutes.com/how-to-create-lvm/

Logical volume "lvol0" created

5. Check the LV

[root@mann ~]# lvdisplay


--- Logical volume ---
LV Name /dev/myvg/lvol0
VG Name myvg
LV UUID Jul8hw-3hWt-HYzM-cjiA-jysn-1YrU-4SPqgV
LV Write Access read/write
LV Status available
# open 0
LV Size 200.00 MiB
Current LE 50
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0

--- Logical volume ---


LV Name /dev/vg01/lvol0
VG Name vg01
LV UUID ziIOqS-WGe6-uv6X-F4GU-x7U9-MSfA-9ugZ42
LV Write Access read/write
LV Status available
# open 0
LV Size 420.00 MiB
Current LE 105
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1

0 Shares
 Share  Share  Tweet  Pin0  Share
0  Share
0

Pages: 1 2

• How to tune linux kernel parameter


• What is Linux sticky bit and how to set Linux sticky bit.
• How to setup linux iSCSI target initiator on RHEL7 for Storage allocation
• How to resolve “error: Failed dependencies:” error
• How to resolve “bash: wget: command not found” Error
• Awesome way to improve process monitoring: Install htop Linux on RHEL, Ubuntu and fedora.
• How to convert xls �le to csv �le in Linux and vice versa
• How to enable disk quota that manages the space
Filed Under: Linux, LVM
December 29, 2016

If this post helped you by any means, then Please


Support Us! by making Payment Payment Link.
Subscribe For RSS Feed::Here.
Like my facebook page FaceBook Page
Follow Us on Twitter:: Twitter
Follow Us on YouTube:: YouTube

4 of 5 08-01-2024, 00:34
10 Steps about How to create LVM Volume - UX Techno https://linuxroutes.com/how-to-create-lvm/

Your email address will not be published. Required �elds are marked *

Comment *

Name *

Email *

Website

Please enter an answer in digits:

17 − 8 =

5 of 5 08-01-2024, 00:34

You might also like