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