Difference between revisions of "System/LVM"

From LunaSys
Jump to navigation Jump to search
 
Line 23: Line 23:
 
== Creation d'un snapshot ==
 
== Creation d'un snapshot ==
  
  lvcreate -n snapname -L 1G lvname_to_snap
+
  lvcreate -n snapname -L 1G -s lvname_to_snap
  
 
The size corresponds to the size of changes occuring since the snap was taken.
 
The size corresponds to the size of changes occuring since the snap was taken.

Latest revision as of 13:18, 28 January 2012

Creation d'un VG

vgcreate vgname /dev/sda

Creation d'un LV

lvcreate -n lvname -L 65536000000b vgname

Exemple pour une migration d'une image de VM:

Récupération de la taille de l'image:

ls -l /var/lib/libvirt/images/filename.img

Création du LV au byte pres:

lvcreate -n lvname -L 65536000000b vgname

Copie de l'image sur la partition LVM:

dd if=filename.img of=/dev/vgname/lvname

Creation d'un snapshot

lvcreate -n snapname -L 1G -s lvname_to_snap

The size corresponds to the size of changes occuring since the snap was taken.

Suppression d'un LV

lvremove /dev/vgname/lvname