Skip to main content

LVM (Logical volume Manager)-LINUX

 LVM 

LOGICAL VOLUME MANAGER

.what is LVM and it's example

.Advantage of LVM

.Possibilities of LVM

.Real -time LVM example

. Adding new space/disk using LVM

.Extending the space using LVM

LVM 

LVM Is  used to manage volume and disk on the linux server 
Logical volume Manager allows disk to be combined together.

Example of LVM

LIKE Partition of disk in windows C, D Drive similarly we can do the same in the Linux.
.Single disk can be divided into different partitions.

Multiple disk combined and group them into one -> then change it into different partitions.




Advantage OF LVM

.IN CASE OF DISK IS RUNNING OUT OF SPACE, YOU Can add disk without breaking partitions of your file system.

Possibilities of LVM

.New space can be created on a server for new project
.in case of low disk space, increase the space.
in case of extra space allocated to a partition ,capacity can be reallocated (reduce capacity in one volume group and add it to another).

Requirement

We need to deploy two new applicationsapp1 and app2 on our server and need a separate partitions and space for each application.

Steps of lVM for adding new space

1 install new hard disk drive

2. Make a partition to use it

3.Desiganate physical volume (pv)

4. Manage volume group (VG)

5. Manage logical volume (LV)

6. Apply a filesystem

7. Set a mount point

Partition using 'fdisk'

Follow the below steps to create new partition

1. choose n to create new

2. Chose P to create a primary partition.

3.Choose which number of partition we need to create.

4. Press Enter twice to use the full space of the disk.

5.We need to change the type of newly created partition type t.

6. which number of partition need to change , choose the number which we created

7. Here we need to change the type. we need to create LVM so we going to use the type code of LVM as 8e, if do not know the type code press L to list all type codes.

8 Print the partition what we created to just confirm.

9 Here we can see the ID as 8e LINUX LVM.

10. Write the changes and exit Fidsk




Designate physical volumes (pv) so that it will be available to lLVM as storage  capacity.

Command to create a PV 

#pvcreate /dev/sdb1

Display pv capacity and additional information :

#pvdisplay





Manage  Volume groups (vGS)

VG must have at least one member (vg 00 is our group name and  others are our PVS)

TO display information for a VG NAMED VG00

# vgdisplay vgapps




Manage Logical volumes (LVM)

TO create a Logical Volum

# lvcreate -L size (1G or It) -n lvname vgname

To display information for  LV 

# lvdisplay /dev/vgapps/<lvname>



Apply a filesystem and set a mount point.

-Run the mkfs.ex4 command on the LV.

Create a mount point by using mkdir.

-Manuallymount the volume using the mount command, or edit the /etc/fstab file to mount the volume automatically when the system boots.

-use the df -h command to verify the storage capacity available.






Extending a Disk  using LVM

For the frist time we have created a VG , now we will extend it

# vgextend vgapps /dev/sdb2

Add spaces to LV 

#lvextend -L+1G /dev/vgapps/app1-lv

Make this new space available to Filesystem

Here is the basic command for ext4

#resize2fs /dev/vgapps/app1-lv 3T

you can use the below command for xFS

#Xfs_growfs /dev/vgapps/app1-iv (now check using df -h )




Comments

Popular posts from this blog

Microsoft-windows-server-2019 New-Features

 windows server 2019is that latest windows server operating system till date and provides the best windows server  operating system for cloud solutions and provides the best integration with Azure  when compared to windows server 2016. The current version of windows server 2019 improves on the previous windows 2016 version in regards with better performance, improved security. better hyper-convergence and outstanding optimizations for hybrid integration. New Features in windows server 2019 Hybrid cloud option: windows 2019 server support Hybrid Cloud, Both on-premise and cloud solutions work together option. the cloud solution can work simultaneously with the on-premise version. New Features in windows server 2019 Storage Migration Service: storage Migration is a new feature/tool that helps migrate date from the legacy plat from to the new 2019 plat from. storage Migration services supports migrating data all the way from windows server 2023 to windows server 2019. it enables the inv

Crontab in linux- Examples and Command

A cron job in Linux is a time-based job scheduler. It is a utility that allows you to schedule and automate the execution of scripts, commands, or programs at specific intervals or at predetermined times. Cron jobs are commonly used in Linux and other Unix-like operating systems to automate repetitive tasks, such as system maintenance, log rotation, backups, and periodic data processing. The cron service is responsible for running these scheduled tasks. It reads a configuration file called the "crontab" (short for cron table) to determine when and which commands to execute. Each user on a Linux system can have their own crontab file, which lists the cron jobs specific to that user The crontab file uses a specific format to define the schedule of a cron job. It consists of six fields that specify the timing of the job: scss * * * * * command_to_be_executed | | | | | | | | | +----- Day of the Week ( 0 - 7 ) (Sunday = 0 or 7 ) | | | +------- Month ( 1 - 12 ) | | +--

How TO Manage Groups Ad User on linux

Linux Admin - User Managemen When discussing user management, we have three important terms to understand − Users   Groups Permissions We have already discussed in-depth permissions as applied to files and folders. In this chapter, let's discuss about users and groups. CentOS Users In CentOS, there are two types accounts –  System accounts − Used for a daemon or other piece of software .   Interactive accounts − Usually assigned to a user for accessing system resources . The main difference between the two user types is − System accounts are used by daemons to access files and directories. These will usually be disallowed from interactive login via shell or physical console login .. Interactive accounts are used by end-users to access computing resources from either a shell or physical console login. With this basic understanding of users, let's now create a new user for Bob Jones in the Accounting Department. A new user is added with the adduser command. Following

User quota in Linux step by step

  Linux Admin – Quota Management As a Linux administrator, quota management is an important aspect of managing file systems and controlling disk usage by users. Quotas allow you to set limits on the amount of disk space a user or a group can consume. Here's a general guide on how to manage quotas in Linux:                Enabling Quota Management in C Linux is basically a 4 step process – Step 1  − Enable quota management for groups and users in /etc/fstab. Step 2  − Remount the filesystem. Step 3  − Create Quota database and generate disk usage table. Step 4  − Assign quota policies. Enable Quota Management in /etc/fstab First, we want to backup our /etc/fstab filen − [root@localhost ~]#   cp -r /etc/fstab ./ We now have a copy of our  known working  /etc/fstab in the current working directory. We made the following changes in the options section of  /etc/fstab  for the volume or Label to where quotas are to be applied for users and groups. usrquota grpquota  As you can see, we

Why use vSAN in VMware?

 VMware vSAN, which stands for VMware Virtual SAN, is a software-defined storage solution offered by VMware. It is a component of VMware's vSphere virtualization platform and is designed to provide highly scalable, high-performance shared storage for virtual machines (VMs) in a vSphere environment. vSAN allows you to pool together the direct-attached storage devices (such as hard drives or solid-state drives) from multiple servers in a vSphere cluster and create a distributed storage infrastructure. By aggregating the storage resources from these servers, vSAN creates a shared storage pool that can be utilized by VMs running on those servers. Key features and benefits of VMware vSAN include: Hyperconverged Infrastructure (HCI): vSAN is a key component of VMware's HCI solution. It combines compute, storage, and virtualization resources into a single software-defined platform, simplifying data center operations and reducing hardware costs. Highly scalable and elastic : vSAN a

how to install VMware esxi tools in windows server 2019 step by step

To install VMware Tools on a Windows Server 2019 virtual machine running on VMware esxi, you can follow these step-by-step instructions: Start the Windows Server 2019 virtual machine. 2. From the VMware menu, go to VM -> Guest -> Install/Upgrade VMware Tools. This will mount the VMware Tools ISO to the virtual machine 3. Open File Explorer on the Windows Server 2019 virtual machine.  4.  Locate the CD/DVD drive, which should show the VMware Tools disc icon. 5. Right-click the CD/DVD drive and select "Open" or double-click it to open the contents. 6. Run the "setup.exe" file to begin the VMware Tools installation. 7. If prompted by User Account Control (UAC), click "Yes" to allow the installation to proceed. 8. The VMware Tools installation wizard will appear. Click "Next" to proceed. 9.  On the next screen, select the desired installation options. The default options are usually suitable for most installations,

What is? Dhcp Server In-Networking

 A DHCP (Dynamic Host Configuration Protocol) server is a network service that automatically assigns IP addresses and other related network configuration parameters to devices on a network. It simplifies the process of network configuration by dynamically allocating IP addresses to devices as they connect to the network. PLAN the IP Address Range and Exclusions Besides degerming how to places the DHCP server into the network  structure, you also to plan the ip address ranges you" ii use as well as which ip addresses to reserve or exclude from this pool of addresses. use the following list to help plan the IP address ranges to use and exclude . . Determine the range of ip addresses that the DHCP server will manage. Most likely, this will be private address range such as 10.x.x.x or 192.168.x.x, or a site-local addresses such as FEC::/10. .Make a list of any IP addresses to exclude to support hosts with static IP addresses. only DHCP server and hosts that don't' works as