Logical Volume Manager <ul><ul><li>An Introduction </li></ul></ul>
Logical Volume Manager What is? <ul><li>LVM  (Logical Volume Manager) allows to manage disks in a different way: creates o...
Logical Volume Manager What is? <ul><li>LVM  (Logical Volume Manager) allows to manage disks in a different way: creates o...
Logical Volume Manager Concepts <ul><li>Physical Volume  (PV) : physical partition from real disk </li></ul><ul><li>Volume...
Logical Volume Manager Concepts <ul><li>Create one or more VG from one or more PV, and then create LVs in each VG </li></u...
Logical Volume Manager PVs <ul><li>pvcreate: creates a PV </li></ul><ul><li>pvremove: removes a PV </li></ul><ul><li>pvdis...
Logical Volume Manager VGs <ul><li>vgcreate: creates a VG </li></ul><ul><li>vgremove: removes a VG </li></ul><ul><li>vgext...
Logical Volume Manager VGs (1) Create one or more partitions with fdisk, with type LVM (2)  pvcreate /dev/sda1 (3)  pvcrea...
Logical Volume Manager LVs <ul><li>lvcreate: creates a LV </li></ul><ul><li>lvremove: removes a LV </li></ul><ul><li>lvsca...
Logical Volume Manager LVs (1) Create a VG (2)  lvcreate -L<size> -n <name> <vg> lvcreate -L10G -n mylv myvg It creates  /...
Logical Volume Manager Snapshots <ul><li>A snapshot is an image of a LV </li></ul><ul><li>Created instantly </li></ul><ul>...
Logical Volume Manager Snapshots <ul><li>Snapshot is like a 'pointer' to the same data in original LV </li></ul><ul><li>Ea...
Logical Volume Manager Uses of Snapshots <ul><li>To test: create snapshots and then use them as the main partitions </li><...
Logical Volume Manager LVM and other technologies /dev/* /dev/mapper/* /dev/* /dev/* /dev/md0 LUKS RAID
Logical Volume Manager LVM and other technologies /dev/* /dev/mapper/* /dev/* /dev/vg/* /dev/* /dev/* /dev/vg/* LUKS LVM
Logical Volume Manager LVM and other technologies /dev/* /dev/vg/* /dev/vg/* LUKS LVM
Logical Volume Manager LVM and other technologies /dev/vg/* /dev/* /dev/mapper/* LUKS LVM
Logical Volume Manager LVM and other technologies /dev/vg/* /dev/vg/* /dev/* /dev/* LUKS LVM RAID
Logical Volume Manager LVM and other technologies /dev/* /dev/* /dev/* /dev/vg1/* /dev/* /dev/* /dev/* /dev/vg2/* /dev/vg3...
Logical Volume Manager My Laptop /dev/sdaA tmp home swap sbox root var music /dev/sdaB /dev/sdaC LUKS VG-CRYPT VG-UNCRYPT
Logical Volume Manager The End That's all, folks!
Upcoming SlideShare
Loading in …5
×

Logical Volume Manager. An Introduction

5,252 views

Published on

Introduction to LVM and how it is related with other modules like LUKS.

Published in: Technology
1 Comment
4 Likes
Statistics
Notes
No Downloads
Views
Total views
5,252
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
347
Comments
1
Likes
4
Embeds 0
No embeds

No notes for slide

Logical Volume Manager. An Introduction

  1. 1. Logical Volume Manager <ul><ul><li>An Introduction </li></ul></ul>
  2. 2. Logical Volume Manager What is? <ul><li>LVM (Logical Volume Manager) allows to manage disks in a different way: creates one or more virtual disks with virtual partitions, from physical partitions </li></ul><ul><li>No limited by physical disk </li></ul>
  3. 3. Logical Volume Manager What is? <ul><li>LVM (Logical Volume Manager) allows to manage disks in a different way: creates one or more virtual disks with virtual partitions, from physical partitions </li></ul><ul><li>No limited by physical disk </li></ul>
  4. 4. Logical Volume Manager Concepts <ul><li>Physical Volume (PV) : physical partition from real disk </li></ul><ul><li>Volume Group (VG) : like a virtual disk </li></ul><ul><li>Logical Volume (LV) : a partition in a Volume Group </li></ul><ul><li>Physical Extent (PE) : like a 'cluster' in PV </li></ul><ul><li>Logical Extent (LE) : like a 'cluster' in LV </li></ul>
  5. 5. Logical Volume Manager Concepts <ul><li>Create one or more VG from one or more PV, and then create LVs in each VG </li></ul>VG /dev/sda1 /dev/vg/lv1 /dev/sda2 /dev/vg/lv2 /dev/vg/lv3
  6. 6. Logical Volume Manager PVs <ul><li>pvcreate: creates a PV </li></ul><ul><li>pvremove: removes a PV </li></ul><ul><li>pvdisplay: shows information about a PV </li></ul><ul><li>pvscan: scan all PVs in the system </li></ul><ul><li>pvck: check a PV for errors </li></ul>(1) Create one or more partitions with fdisk, with type LVM (2) pvcreate /dev/<partition>
  7. 7. Logical Volume Manager VGs <ul><li>vgcreate: creates a VG </li></ul><ul><li>vgremove: removes a VG </li></ul><ul><li>vgextend: extend a VG with more PVs </li></ul><ul><li>vgreduce: drops PVs from a VG </li></ul><ul><li>vgdisplay: shows info about VG </li></ul><ul><li>vgscan: scan for all VGs in system </li></ul><ul><li>vgchange: change VG properties </li></ul><ul><li>vgck, vgexport, vgmerge, vgsplit, vgrename </li></ul>
  8. 8. Logical Volume Manager VGs (1) Create one or more partitions with fdisk, with type LVM (2) pvcreate /dev/sda1 (3) pvcreate /dev/hdb2 (4) pvcreate /dev/hdc3 (5) vgcreate myvg /dev/sda1 /dev/hdb2 /dev/hdc3
  9. 9. Logical Volume Manager LVs <ul><li>lvcreate: creates a LV </li></ul><ul><li>lvremove: removes a LV </li></ul><ul><li>lvscan: scan for all LVs in a system </li></ul><ul><li>lvdisplay: shows info about a LV </li></ul><ul><li>lvrename, lvresize, lvreduce, lvchange </li></ul>
  10. 10. Logical Volume Manager LVs (1) Create a VG (2) lvcreate -L<size> -n <name> <vg> lvcreate -L10G -n mylv myvg It creates /dev/myvg/mylv (a link to /dev/mapper/myvg-mylv ) mkfs.ext3 /dev/myvg/mylv
  11. 11. Logical Volume Manager Snapshots <ul><li>A snapshot is an image of a LV </li></ul><ul><li>Created instantly </li></ul><ul><li>Read-only / read-write (LVM2) </li></ul>lvcreate -s -L<size> -n <name> <lv> RW: lvcreate -s -L1G -n mylv-snapshot /dev/myvg/mylv RO: lvcreate -s -L1G -n mylv-snapshot -p r /dev/myvg/mylv
  12. 12. Logical Volume Manager Snapshots <ul><li>Snapshot is like a 'pointer' to the same data in original LV </li></ul><ul><li>Each time data in original LV is modified (or in snapshot if it was created as RW), a copy is done previously in exception table </li></ul><ul><li>When it becomes full it is automatically disabled </li></ul>
  13. 13. Logical Volume Manager Uses of Snapshots <ul><li>To test: create snapshots and then use them as the main partitions </li></ul><ul><ul><li>If you don't like something, revert to original and drop the snapshots </li></ul></ul><ul><li>To backup: use a snapshot to create backups </li></ul><ul><ul><li>This way, you can continue to work while backuping is done, without a problem of having an inconsistency </li></ul></ul>lvcreate -s -L1G -n snaproot /dev/vg/lvroot run-backup.sh /dev/vg/snaproot lvremove -f /dev/vg/snaproot
  14. 14. Logical Volume Manager LVM and other technologies /dev/* /dev/mapper/* /dev/* /dev/* /dev/md0 LUKS RAID
  15. 15. Logical Volume Manager LVM and other technologies /dev/* /dev/mapper/* /dev/* /dev/vg/* /dev/* /dev/* /dev/vg/* LUKS LVM
  16. 16. Logical Volume Manager LVM and other technologies /dev/* /dev/vg/* /dev/vg/* LUKS LVM
  17. 17. Logical Volume Manager LVM and other technologies /dev/vg/* /dev/* /dev/mapper/* LUKS LVM
  18. 18. Logical Volume Manager LVM and other technologies /dev/vg/* /dev/vg/* /dev/* /dev/* LUKS LVM RAID
  19. 19. Logical Volume Manager LVM and other technologies /dev/* /dev/* /dev/* /dev/vg1/* /dev/* /dev/* /dev/* /dev/vg2/* /dev/vg3/* /dev/vg3/* LUKS LUKS LVM LVM LVM
  20. 20. Logical Volume Manager My Laptop /dev/sdaA tmp home swap sbox root var music /dev/sdaB /dev/sdaC LUKS VG-CRYPT VG-UNCRYPT
  21. 21. Logical Volume Manager The End That's all, folks!

×