SlideShare a Scribd company logo
Storage Management using LVM Sandeep Tyagi Persistent Systems
Agenda Q & A  What is LVM Body, Parts and Soul How to use LVM on Linux [ Some situations & LVM ] Discussion
Q & A Q & A  What is LVM Body, Parts and Soul How to use LVM on Linux Discussion
Some Qs WHAT DO YOU DO IF -  You have some of your partition filled up and you want to expand it You want to shrink your partition You have your disk/device filled up and you want to add one more disk/device (You need a single file system spread over multiple disks) You want to take backup of your file system/partition while you are still using it
A’s SOME OF THE SOLUTIONS - For expansion/shrinking a partition  Take backup of partition delete and recreate it with desired size (Might need a reboot) and restore the earlier data Use a tool like partition magic –  Generally needs a reboot Create a bigger partition, create file system, copy data of original partition and link the directory mounted on old files system to this new bigger partition For having partitions spread over multiple disks/devices RAID
Limitations In many cases requires rebooting the system Complex/proprietary technology (e.g. RAID volume manager) that requires specific skills for maintenance/management What if  You can’t reboot the system  OR Don’t have the patience/skills to  manage/maintain? These solutions look viable options but are they appropriate or perfect?
Answer is NO  We need a solution  That solves most of our problems discussed  Doesn’t force a reboot all the time Doesn’t force a backup all the time  And so on..
What is LVM Q & A  What is LVM Body, Parts and Soul How to use LVM on Linux Discussion
Logical Volume Manager  (LVM) Presents a higher level of disk storage Provides flexibility in allocating storage Facility of resizing file system while the file systems are online (though it needs modification/addition in/of tools) Facility to manage storage based on user-defined logical groups Easy maintenance
Body, Parts and Soul Q & A  What is LVM Body, Parts and Soul How to use LVM on Linux Discussion
Body, Parts and Soul Physical Volume Volume Group Logical Volume Physical Extents Logical Extents Device mapper Snapshot
Body, Parts and Soul  contd… Physical Volume (PV) is created out of Physical Device  Disk Anything that looks like a hard disk Volume Group (VG) Highest level abstraction in LVM Consists of one of more Physical Volumes Can contain one or more Logical volumes
Body, Parts and Soul  contd… Logical Volume  Is synonym of Partition  Basic entity on which you can create file systems  Extents Chunk of bytes such as 1k, 4k or 64k
Body, Parts and Soul  contd… Physical Extents Each Physical volume is divided in to extents called physical extents Are of same size as the Logical extents for the volume group Logical Extents Each logical volume consists of a number of extents called logical extents Extent size for all logical volume in a volume group is same
Body, Parts and Soul  contd… Snapshot A Read only/Read Write image of Logical Volume Device Mapper  A new component in Linux Kernel that enables use of LVM 2
 
Body, Parts and Soul  contd… To use LVM on Linux system should have -  Device mapper in your kernel Device mapper support library (libdevmapper)  User space LVM tools
How to use LVM on Linux Q & A  What is LVM Body, Parts and Soul How to use LVM on Linux Discussion
How to Use LVM on Linux CREATING A NEW LOGICAL VOLUME Create a Physical Volume Create a Volume group Create a Logical Volume EXPANDING A LOGICAL VOLUME Create a Physical Volume Add it to the Volume Group that have the “target” Logical Volume – in case VG does not have enough space to  Expand the Logical Volume
Create a Physical Volume 1. From one or more partitions Mark each of the partition to be used as physical volume for Linux LVM by changing partition system id to 0x8e. This can be done with fdisk (using t option) Device Boot  Start  End  Blocks  Id   System /dev/cciss/c0d0p1  *  1  382  3068383+  83  Linux /dev/cciss/c0d0p5  6757  7266  4096543+  82  Linux swap / Solaris /dev/cciss/c0d0p6  7267  19716  100004593+  8e  Linux LVM /dev/cciss/c0d0p7  19717  25942  50010313+  8e  Linux LVM
Create a Physical Volume  contd… 2. From the whole disk   Erase the partition table of the disk. This can be done by zeroing first sector: #dd if=/dev/zero of=/dev/hda bs=512 count=1 Now create the physical volume from such devices (configured in 1 or 2)  #pvcreate device_path #pvcreate /dev/cciss/c0d0p6 #pvcreate /dev/cciss/c0d0p7 #pvcreate /dev/hda
Create a Volume Group Out of one or more Physical Volumes described in previous slides create a Volume Group using vgcreate #vgcreate diskvg /dev/hda #vgcreate partvg /dev/cciss/c0d0p5 /dev/cciss/c0d0p6 #vgcreate mixvg /dev/cciss/c0d0p5 /dev/hda Simplest version of command is  #vgcreate vgname pvname_s
Create a Logical Volume Out of VG created create any no of volumes (using lvcreate) #lvcreate options [-n lv_name] vg_name LV name is optional, if you don’t provide one, LVM will choose one for you. Now you can use this logical volume for creating your file system
Other Features Extend or shrink Logical volume  Expand or shrink VG/Remove PV from VG Move LVs/PEs Create a snapshot for a read only/read write view of the LV (can be used for online backups and many more things)
Some of the useful  commands pvcreate pvremove pvmove pvdisplay pvscan vgcreate vgremove vgextend vgreduce vgdisplay vgscan lvcreate lvremove lvextend lvreduce lvresize lvdisplay lvmdiskscan
Thanks!!! Resources www.tldp.org www.google.com   Search for keywords – LVM, LVM2, Device mapper, LVM HOWTO and many other we saw in previous slides “ man” (#man lvm should get you started)
Disclaimer Views expressed in this document are of the authors and does not necessarily represent the view of Persistent Systems. Persistent Systems Private Limited (“Persistent”) logo is trademark of Persistent in India and/or other countries. Information provided in this document might change without notice. Names of products, company and services may be trademarks or service marks of others. This document is provided “AS IS” with no expressed or implied warranties. Use the information in this document at your own risk.
Next ???  EVMS !!!

More Related Content

PPT
VMware Presentation
PDF
Presentation disaster recovery in virtualization and cloud
PDF
AWS EC2
ODP
Logical Volume Manager. An Introduction
PDF
Linux: LVM
PPTX
vm provisioning
PPTX
Serverless Architecture
PPTX
What is Virtualization and its types & Techniques.What is hypervisor and its ...
VMware Presentation
Presentation disaster recovery in virtualization and cloud
AWS EC2
Logical Volume Manager. An Introduction
Linux: LVM
vm provisioning
Serverless Architecture
What is Virtualization and its types & Techniques.What is hypervisor and its ...

What's hot (20)

PPT
Linux file system
PPTX
Basic commands of linux
PPTX
Storage As A Service (StAAS)
PPTX
Hybrid Cloud and Its Implementation
PDF
Virtualization for Cloud Environment
PDF
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
PPTX
VDI and Application Virtualization
PPTX
Hci solution with VxRail
PPTX
PDF
AWS ELB
PPTX
Linux fundamentals
PPT
Introduction to Virtualization
PDF
Linux Directory Structure
PPTX
Storage basics
PPTX
A simple introduction to redis
PPTX
What is AWS?
PPTX
PPT
Cloud deployment models
PPTX
Virtualization
PPTX
Fundamental Cloud Architectures
Linux file system
Basic commands of linux
Storage As A Service (StAAS)
Hybrid Cloud and Its Implementation
Virtualization for Cloud Environment
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
VDI and Application Virtualization
Hci solution with VxRail
AWS ELB
Linux fundamentals
Introduction to Virtualization
Linux Directory Structure
Storage basics
A simple introduction to redis
What is AWS?
Cloud deployment models
Virtualization
Fundamental Cloud Architectures
Ad

Viewers also liked (20)

PPTX
PPTX
Red Hat - LVM - Mazenet Solution
PDF
Lvm advanced topics
PDF
Sito Maas-Workshop: Marko Forsblom, LVM
PDF
Installing Linux: Partitioning and File System Considerations
PPTX
SQL Server vNext on Linux
PDF
7 linux fdisk command examples to manage hard disk partition
ODP
Using CloudStack With Clustered LVM
PDF
Course 102: Lecture 22: Package Management
PPTX
Ceph and OpenStack - Feb 2014
PPTX
Colour vision with lvm
PPT
The information systems life cycle
PDF
Course 102: Lecture 26: FileSystems in Linux (Part 1)
PPT
Making of marketing
PPT
Ch09
PDF
Course 102: Lecture 14: Users and Permissions
DOCX
Leyenda de origen mapuche colocolo
PPTX
Larisa
Red Hat - LVM - Mazenet Solution
Lvm advanced topics
Sito Maas-Workshop: Marko Forsblom, LVM
Installing Linux: Partitioning and File System Considerations
SQL Server vNext on Linux
7 linux fdisk command examples to manage hard disk partition
Using CloudStack With Clustered LVM
Course 102: Lecture 22: Package Management
Ceph and OpenStack - Feb 2014
Colour vision with lvm
The information systems life cycle
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Making of marketing
Ch09
Course 102: Lecture 14: Users and Permissions
Leyenda de origen mapuche colocolo
Larisa
Ad

Similar to Storage Management using LVM (20)

PDF
Master Logical Volume Management - RHCSA+.pdf
PDF
Manage Logical Volume in RHEL - RHCSA (RH134).pdf
PDF
Putting some "logic" in LVM.
PDF
lvm logical volume management is a tool in Linux that allows you to manage st...
PDF
Linux LVM Logical Volume Management
PPSX
Logical volume manager xfs
ODP
Lvm and gang 2015
PDF
Managing Multiple Logical Volumes - RHCSA+.pdf
PPT
Storage Management in Linux OS.ppt
ODP
Disks and-filesystems
ODP
Disks and-filesystems
PPTX
Linux training in chandigarh
PDF
Red hat lvm cheatsheet
PDF
Inspection and maintenance tools (Linux / OpenStack)
PPTX
3 - Disk Partitioning in Red Hat
TXT
PDF
Cluster logical volume_manager
ODP
4. storage lvm
PPT
logical volume manager.ppt
PDF
Configuring+Disks+and+Filsystems-pdf.pdf
Master Logical Volume Management - RHCSA+.pdf
Manage Logical Volume in RHEL - RHCSA (RH134).pdf
Putting some "logic" in LVM.
lvm logical volume management is a tool in Linux that allows you to manage st...
Linux LVM Logical Volume Management
Logical volume manager xfs
Lvm and gang 2015
Managing Multiple Logical Volumes - RHCSA+.pdf
Storage Management in Linux OS.ppt
Disks and-filesystems
Disks and-filesystems
Linux training in chandigarh
Red hat lvm cheatsheet
Inspection and maintenance tools (Linux / OpenStack)
3 - Disk Partitioning in Red Hat
Cluster logical volume_manager
4. storage lvm
logical volume manager.ppt
Configuring+Disks+and+Filsystems-pdf.pdf

More from Priyank Kapadia (15)

ODP
Ubuntu, Canonical and the release of Feisty
PDF
OLPC and INDIA
PDF
Open Source - Hip not Hype
ODP
How to start an Open Source Project
ODP
Developing Multilingual Applications
PDF
Open Solaris
ODP
How to build Debian packages
ODP
PDF
ASTERISK - Open Source PBS
ODP
C Types - Extending Python
ODP
Applying Security Algorithms Using openSSL crypto library
PDF
Authentication Modules For Linux - PAM Architecture
ODP
Google Web toolkit
PPT
Debugging Applications with GNU Debugger
PPT
Linux Kernel Development
Ubuntu, Canonical and the release of Feisty
OLPC and INDIA
Open Source - Hip not Hype
How to start an Open Source Project
Developing Multilingual Applications
Open Solaris
How to build Debian packages
ASTERISK - Open Source PBS
C Types - Extending Python
Applying Security Algorithms Using openSSL crypto library
Authentication Modules For Linux - PAM Architecture
Google Web toolkit
Debugging Applications with GNU Debugger
Linux Kernel Development

Recently uploaded (20)

PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Empathic Computing: Creating Shared Understanding
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
A Presentation on Artificial Intelligence
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Cloud computing and distributed systems.
PDF
Modernizing your data center with Dell and AMD
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Empathic Computing: Creating Shared Understanding
20250228 LYD VKU AI Blended-Learning.pptx
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
“AI and Expert System Decision Support & Business Intelligence Systems”
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Reach Out and Touch Someone: Haptics and Empathic Computing
Per capita expenditure prediction using model stacking based on satellite ima...
A Presentation on Artificial Intelligence
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Network Security Unit 5.pdf for BCA BBA.
Cloud computing and distributed systems.
Modernizing your data center with Dell and AMD
Unlocking AI with Model Context Protocol (MCP)
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf

Storage Management using LVM

  • 1. Storage Management using LVM Sandeep Tyagi Persistent Systems
  • 2. Agenda Q & A What is LVM Body, Parts and Soul How to use LVM on Linux [ Some situations & LVM ] Discussion
  • 3. Q & A Q & A What is LVM Body, Parts and Soul How to use LVM on Linux Discussion
  • 4. Some Qs WHAT DO YOU DO IF - You have some of your partition filled up and you want to expand it You want to shrink your partition You have your disk/device filled up and you want to add one more disk/device (You need a single file system spread over multiple disks) You want to take backup of your file system/partition while you are still using it
  • 5. A’s SOME OF THE SOLUTIONS - For expansion/shrinking a partition Take backup of partition delete and recreate it with desired size (Might need a reboot) and restore the earlier data Use a tool like partition magic – Generally needs a reboot Create a bigger partition, create file system, copy data of original partition and link the directory mounted on old files system to this new bigger partition For having partitions spread over multiple disks/devices RAID
  • 6. Limitations In many cases requires rebooting the system Complex/proprietary technology (e.g. RAID volume manager) that requires specific skills for maintenance/management What if You can’t reboot the system OR Don’t have the patience/skills to manage/maintain? These solutions look viable options but are they appropriate or perfect?
  • 7. Answer is NO We need a solution That solves most of our problems discussed Doesn’t force a reboot all the time Doesn’t force a backup all the time And so on..
  • 8. What is LVM Q & A What is LVM Body, Parts and Soul How to use LVM on Linux Discussion
  • 9. Logical Volume Manager (LVM) Presents a higher level of disk storage Provides flexibility in allocating storage Facility of resizing file system while the file systems are online (though it needs modification/addition in/of tools) Facility to manage storage based on user-defined logical groups Easy maintenance
  • 10. Body, Parts and Soul Q & A What is LVM Body, Parts and Soul How to use LVM on Linux Discussion
  • 11. Body, Parts and Soul Physical Volume Volume Group Logical Volume Physical Extents Logical Extents Device mapper Snapshot
  • 12. Body, Parts and Soul contd… Physical Volume (PV) is created out of Physical Device Disk Anything that looks like a hard disk Volume Group (VG) Highest level abstraction in LVM Consists of one of more Physical Volumes Can contain one or more Logical volumes
  • 13. Body, Parts and Soul contd… Logical Volume Is synonym of Partition Basic entity on which you can create file systems Extents Chunk of bytes such as 1k, 4k or 64k
  • 14. Body, Parts and Soul contd… Physical Extents Each Physical volume is divided in to extents called physical extents Are of same size as the Logical extents for the volume group Logical Extents Each logical volume consists of a number of extents called logical extents Extent size for all logical volume in a volume group is same
  • 15. Body, Parts and Soul contd… Snapshot A Read only/Read Write image of Logical Volume Device Mapper A new component in Linux Kernel that enables use of LVM 2
  • 16.  
  • 17. Body, Parts and Soul contd… To use LVM on Linux system should have - Device mapper in your kernel Device mapper support library (libdevmapper) User space LVM tools
  • 18. How to use LVM on Linux Q & A What is LVM Body, Parts and Soul How to use LVM on Linux Discussion
  • 19. How to Use LVM on Linux CREATING A NEW LOGICAL VOLUME Create a Physical Volume Create a Volume group Create a Logical Volume EXPANDING A LOGICAL VOLUME Create a Physical Volume Add it to the Volume Group that have the “target” Logical Volume – in case VG does not have enough space to Expand the Logical Volume
  • 20. Create a Physical Volume 1. From one or more partitions Mark each of the partition to be used as physical volume for Linux LVM by changing partition system id to 0x8e. This can be done with fdisk (using t option) Device Boot Start End Blocks Id System /dev/cciss/c0d0p1 * 1 382 3068383+ 83 Linux /dev/cciss/c0d0p5 6757 7266 4096543+ 82 Linux swap / Solaris /dev/cciss/c0d0p6 7267 19716 100004593+ 8e Linux LVM /dev/cciss/c0d0p7 19717 25942 50010313+ 8e Linux LVM
  • 21. Create a Physical Volume contd… 2. From the whole disk Erase the partition table of the disk. This can be done by zeroing first sector: #dd if=/dev/zero of=/dev/hda bs=512 count=1 Now create the physical volume from such devices (configured in 1 or 2) #pvcreate device_path #pvcreate /dev/cciss/c0d0p6 #pvcreate /dev/cciss/c0d0p7 #pvcreate /dev/hda
  • 22. Create a Volume Group Out of one or more Physical Volumes described in previous slides create a Volume Group using vgcreate #vgcreate diskvg /dev/hda #vgcreate partvg /dev/cciss/c0d0p5 /dev/cciss/c0d0p6 #vgcreate mixvg /dev/cciss/c0d0p5 /dev/hda Simplest version of command is #vgcreate vgname pvname_s
  • 23. Create a Logical Volume Out of VG created create any no of volumes (using lvcreate) #lvcreate options [-n lv_name] vg_name LV name is optional, if you don’t provide one, LVM will choose one for you. Now you can use this logical volume for creating your file system
  • 24. Other Features Extend or shrink Logical volume Expand or shrink VG/Remove PV from VG Move LVs/PEs Create a snapshot for a read only/read write view of the LV (can be used for online backups and many more things)
  • 25. Some of the useful commands pvcreate pvremove pvmove pvdisplay pvscan vgcreate vgremove vgextend vgreduce vgdisplay vgscan lvcreate lvremove lvextend lvreduce lvresize lvdisplay lvmdiskscan
  • 26. Thanks!!! Resources www.tldp.org www.google.com Search for keywords – LVM, LVM2, Device mapper, LVM HOWTO and many other we saw in previous slides “ man” (#man lvm should get you started)
  • 27. Disclaimer Views expressed in this document are of the authors and does not necessarily represent the view of Persistent Systems. Persistent Systems Private Limited (“Persistent”) logo is trademark of Persistent in India and/or other countries. Information provided in this document might change without notice. Names of products, company and services may be trademarks or service marks of others. This document is provided “AS IS” with no expressed or implied warranties. Use the information in this document at your own risk.
  • 28. Next ??? EVMS !!!