]> git.proxmox.com Git - pve-docs.git/blame - pve-storage-lvm.adoc
factor out cleanup method
[pve-docs.git] / pve-storage-lvm.adoc
CommitLineData
aa039b0f
DM
1LVM Backend
2-----------
fc3425bd 3include::attributes.txt[]
aa039b0f 4
5f09af76
DM
5ifdef::wiki[]
6:pve-toplevel:
cb84ed18 7:title: Storage: LVM
5f09af76
DM
8endif::wiki[]
9
aa039b0f
DM
10Storage pool type: `lvm`
11
12LVM is a thin software layer on top of hard disks and partitions. It
13can be used to split available disk space into smaller logical
14volumes. LVM is widely used on Linux and makes managing hard drives
15easier.
16
17Another use case is to put LVM on top of a big iSCSI LUN. That way you
18can easily manage space on that iSCSI LUN, which would not be possible
19otherwise, because the iSCSI specification does not define a
20management interface for space allocation.
21
5eba0743 22
aa039b0f
DM
23Configuration
24~~~~~~~~~~~~~
25
26The LVM backend supports the common storage properties `content`, `nodes`,
27`disable`, and the following LVM specific properties:
28
29`vgname`::
30
31LVM volume group name. This must point to an existing volume group.
32
33`base`::
34
35Base volume. This volume is automatically activated before accessing
36the storage. This is mostly useful when the LVM volume group resides
37on a remote iSCSI server.
38
39`saferemove`::
40
41Zero-out data when removing LVs. When removing a volume, this makes
42sure that all data gets erased.
43
44`saferemove_throughput`::
45
8c1189b6 46Wipe throughput (`cstream -t` parameter value).
aa039b0f 47
8c1189b6 48.Configuration Example (`/etc/pve/storage.cfg`)
aa039b0f
DM
49----
50lvm: myspace
51 vgname myspace
52 content rootdir,images
53----
54
55File naming conventions
56~~~~~~~~~~~~~~~~~~~~~~~
57
58The backend use basically the same naming conventions as the ZFS pool
59backend.
60
61 vm-<VMID>-<NAME> // normal VM images
62
63Storage Features
64~~~~~~~~~~~~~~~~
65
66LVM is a typical block storage, but this backend does not support
67snapshot and clones. Unfortunately, normal LVM snapshots are quite
68inefficient, because they interfere all writes on the whole volume
69group during snapshot time.
70
71One big advantage is that you can use it on top of a shared storage,
72for example an iSCSI LUN. The backend itself implement proper cluster
73wide locking.
74
75TIP: The newer LVM-thin backend allows snapshot and clones, but does
76not support shared storage.
77
78
79.Storage features for backend `lvm`
80[width="100%",cols="m,m,3*d",options="header"]
81|==============================================================================
82|Content types |Image formats |Shared |Snapshots |Clones
83|images rootdir |raw |possible |no |no
84|==============================================================================
85
86Examples
87~~~~~~~~
88
89List available volume groups:
90
91 # pvesm lvmscan
92
deb4673f
DM
93ifdef::wiki[]
94
95See Also
96~~~~~~~~
97
f532afb7 98* link:/wiki/Storage[Storage]
deb4673f
DM
99
100endif::wiki[]
aa039b0f
DM
101
102