UniCom Tech India

UniCom Tech India Network Technology

06/11/2021
08/11/2018

Celebrate the magic and joys of Diwali

15/10/2017

How To Create LVM Using vgcreate, lvcreate, and lvextend lvm2 Commands
by Rajesh Maurya

LVM stands for Logical Volume Manager.

With LVM, we can create logical partitions that can span across one or more physical hard drives. First, the hard drives are divided into physical volumes, then those physical volumes are combined together to create the volume group and finally the logical volumes are created from volume group.

The LVM commands listed in this article are used under Ubuntu Distribution. But, it is the same for other Linux distributions.

Before we start, install the lvm2 package as shown below.

$ sudo apt-get intall lvm2

To create a LVM, we need to run through the following steps.

Select the physical storage devices for LVM
Create the Volume Group from Physical Volumes
Create Logical Volumes from Volume Group

Select the Physical Storage Devices for LVM – Use pvcreate, pvscan, pvdisplay Commands

In this step, we need to choose the physical volumes that will be used to create the LVM. We can create the physical volumes using pvcreate command as shown below.

$ sudo pvcreate /dev/sda6 /dev/sda7
Physical volume "/dev/sda6" successfully created
Physical volume "/dev/sda7" successfully created

As shown above two physical volumes are created – /dev/sda6 and /dev/sda7.

If the physical volumes are already created, you can view them using the pvscan command as shown below.

$ sudo pvscan
PV /dev/sda6 lvm2 [1.86 GB]
PV /dev/sda7 lvm2 [1.86 GB]
Total: 2 [3.72 GB] / in use: 0 [0 ] / in no VG: 2 [3.72 GB]

You can view the list of physical volumes with attributes like size, physical extent size, total physical extent size, the free space, etc., using pvdisplay command as shown below.

$ sudo pvdisplay
--- Physical volume ---
PV Name /dev/sda6
VG Name
PV Size 1.86 GB / not usable 2.12 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 476
Free PE 456
Allocated PE 20
PV UUID m67TXf-EY6w-6LuX-NNB6-kU4L-wnk8-NjjZfv

--- Physical volume ---
PV Name /dev/sda7
VG Name
PV Size 1.86 GB / not usable 2.12 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 476
Free PE 476
Allocated PE 0
PV UUID b031x0-6rej-BcBu-bE2C-eCXG-jObu-0Boo0x

Note : PE – Physical Extents are nothing but equal-sized chunks. The default size of extent is 4MB.
Create the Volume Group – Use vgcreate, vgdisplay Commands

Volume groups are nothing but a pool of storage that consists of one or more physical volumes. Once you create the physical volume, you can create the volume group (VG) from these physical volumes (PV).

In this example, the volume group vol_grp1 is created from the two physical volumes as shown below.

$ sudo vgcreate vol_grp1 /dev/sda6 /dev/sda7
Volume group "vol_grp1" successfully created

LVM processes the storage in terms of extents. We can also change the extent size (from the default size 4MB) using -s flag.

vgdisplay command lists the created volume groups.

$ sudo vgdisplay
--- Volume group ---
VG Name vol_grp1
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 3.72 GB
PE Size 4.00 MB
Total PE 952
Alloc PE / Size 0 / 0
Free PE / Size 952 / 3.72 GB
VG UUID Kk1ufB-rT15-bSWe-5270-KDfZ-shUX-FUYBvR

LVM Create: Create Logical Volumes – Use lvcreate, lvdisplay command

Now, everything is ready to create the logical volumes from the volume groups. lvcreate command creates the logical volume with the size of 80MB.

$ sudo lvcreate -l 20 -n logical_vol1 vol_grp1
Logical volume "logical_vol1" created

Use lvdisplay command as shown below, to view the available logical volumes with its attributes.


$ sudo lvdisplay
--- Logical volume ---
LV Name /dev/vol_grp1/logical_vol1
VG Name vol_grp1
LV UUID ap8sZ2-WqE1-6401-Kupm-DbnO-2P7g-x1HwtQ
LV Write Access read/write
LV Status available
# open 0
LV Size 80.00 MB
Current LE 20
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:0


After creating the appropriate filesystem on the logical volumes, it becomes ready to use for the storage purpose.

$ sudo mkfs.ext3 /dev/vol_grp1/logical_vol1

LVM resize: Change the size of the logical volumes – Use lvextend Command

We can extend the size of the logical volumes after creating it by using lvextend utility as shown below. The changes the size of the logical volume from 80MB to 100MB.

$ sudo lvextend -L100 /dev/vol_grp1/logical_vol1
Extending logical volume logical_vol1 to 100.00 MB
Logical volume logical_vol1 successfully resized

We can also add additional size to a specific logical volume as shown below.

$ sudo lvextend -L+100 /dev/vol_grp1/logical_vol1
Extending logical volume logical_vol1 to 200.00 MB
Logical volume logical_vol1 successfully resized

15/10/2017

Happy Diwali

06/09/2017

Hi friends
We are going to learn Redhat OS of linux

09/09/2016

The Filesystem Hierarchy Standard (FHS) defines the directory structure and directory contents in Unix-like operating systems. It is maintained by the Linux Foundation. The latest version is 3.0, released on 3 June 2015. Currently it is only used by Linux distributions.

18/01/2016

VMware VMotion enables the live migration of running virtual machines from one physical server to another with zero downtime, continuous service availability, and complete transaction integrity. It is transparent to users.

Perform Live Migrations in VMware:-VMware vSphere live migration allows you to move an entire running virtual machine fr...
18/01/2016

Perform Live Migrations in VMware:-
VMware vSphere live migration allows you to move an entire running virtual machine from one physical server to another, without downtime. The virtual machine retains its network identity and connections, ensuring a seamless migration process. Transfer the virtual machine's active memory and precise ex*****on state over a high-speed network, allowing the virtual machine to switch from running on the source vSphere host to the destination vSphere host. This entire process takes less than two seconds on a gigabit Ethernet network.
Automatically optimize virtual machines within resource pools.
Perform hardware maintenance without scheduling downtime or disrupting business operations.
Move virtual machines away from failing or underperforming servers.
- See more at: http://www.vmware.com/in/products/vsphere/features/vmotion .0wP0RVcG.dpuf-
VMware vSphere live migration allows you to move an entire running virtual machine from one physical server to another, without downtime. The virtual machine retains its network identity and connections, ensuring a seamless migration process. Transfer the virtual machine's active memory and precise ex*****on state over a high-speed network, allowing the virtual machine to switch from running on the source vSphere host to the destination vSphere host. This entire process takes less than two seconds on a gigabit Ethernet network.
Automatically optimize virtual machines within resource pools.
Perform hardware maintenance without scheduling downtime or disrupting business operations.
Move virtual machines away from failing or underperforming servers.
- See more at: http://www.vmware.com/in/products/vsphere/features/vmotion .0wP0RVcG.dpuf

Simplify Array Migrations and Storage UpgradesVMware vSphere® Storage vMotion® enables live migration of virtual machine...
18/01/2016

Simplify Array Migrations and Storage Upgrades
VMware vSphere® Storage vMotion® enables live migration of virtual machine disk files within and across storage arrays without service disruptions. Non-disruptive virtual machine disk file migration to different classes of storage enables cost-effective management of virtual machine disks as part of a tiered storage strategy.
Perform zero-downtime storage migrations with complete transaction integrity.
Migrate the disk files of virtual machines running any supported operating system on any supported server hardware.
Perform live migration of virtual machine disk files across any Fibre Channel, iSCSI, FCoE and NFS storage system supported by VMware vSphere.
- See more at: http://www.vmware.com/in/products/vsphere/features/storage-vmotion .JF6BmoNH.dpuf

07/09/2015

Hi Friends if any query for Computer and server related please discuss with us on comment TAB..

07/09/2015

What is vSphere ?
vSphere is suite of products packaged shipped by VMware virtualization company, which includes products. Like VMware ESXi hypervisor, VMware vCenter Server, etc.

VMware ESXi ?
ESXi or hypervisor is bare metal OS which virtualizes x86 server hardware. You use ESXi ( OS ) installation media to install OS on top of hardware just like you install any other OS like Windows or Linux

Once you have VMware ESXi installed on a x86 server hardware I is ready to virtualized. What does it mean ? - It means you can now use same server to create , configure, run more than one virtual machines and install required Operating systems within Virtual Machines they are referred as Guest Operating systems which could be Windows or Linux etc

Further, vCenter server is another VMware Product shipped in vSphere bundle that helps you manage one or more ESXi servers from a centralized location.

Happy rakshabandhan
29/08/2015

Happy rakshabandhan

Address

Mumbai
400008

Alerts

Be the first to know and let us send you an email when UniCom Tech India posts news and promotions. Your email address will not be used for any other purpose, and you can unsubscribe at any time.

Contact The Business

Send a message to UniCom Tech India:

Share