Difference between revisions of "Lvm"

From PostgreSQL_wiki
Jump to: navigation, search
Line 19: Line 19:
 
root@host:~# lvremove /dev/vg-one-100/vm-134-0
 
root@host:~# lvremove /dev/vg-one-100/vm-134-0
 
Logical volume vg-one-100/vm-134-disk-0 is used by another device.
 
Logical volume vg-one-100/vm-134-disk-0 is used by another device.
  +
root@host:~# dmsetup info -c | grep '134'
 
root@host:~# ls -la /sys/dev/block/253\:21/holders
 
root@host:~# ls -la /sys/dev/block/253\:21/holders
 
lrwxrwxrwx 1 root root 0 Dec 2 20:20 dm-27 -> ../../dm-27
 
lrwxrwxrwx 1 root root 0 Dec 2 20:20 dm-27 -> ../../dm-27

Revision as of 19:54, 4 December 2023

Installatie verloopt met:

udell-kvm:~# apt-get install lvm2

creeer fysiek volume

# pvcreate /dev/sda?
# pvdisplay
# pvscan

creeer volume group

Creeer een logical volume

# vgcreate dev-xen /dev/sda? (Kan ook bij de install)
# vgdisplay

logical volume

Nieuw logical volume

lvcreate -L <size> (1T) -n <name> <volume group>

Voorbeeld:

lvcreate -L 8G -nkvm01 dev-kvm

Verwijderen volume group

Soms wil een volume group niet weg.

root@host:~# lvremove /dev/vg-one-100/vm-134-0
  Logical volume vg-one-100/vm-134-disk-0 is used by another device.
root@host:~# dmsetup info -c | grep '134'
root@host:~# ls -la /sys/dev/block/253\:21/holders
lrwxrwxrwx 1 root root 0 Dec  2 20:20 dm-27 -> ../../dm-27
root@host:~# dmsetup remove /dev/dm-27
root@host:~# lvremove /dev/vg-one-100/vm-134-0
  Logical volume "vm-134-disk-0" successfully removed

Terug naar: Webhuis bouwstenen