summaryrefslogtreecommitdiff
path: root/doc/guix.texi
diff options
context:
space:
mode:
authorMikhail Tsykalov <tsymsh@gmail.com>2020-11-06 12:47:38 +0300
committerLudovic Courtès <ludo@gnu.org>2020-11-26 00:05:39 +0100
commita9a2fdaabcc78e7a54d9a6bcfa4ee3de308e9a90 (patch)
tree1852c17d33cc33ce572810f8042fe5c24a7ef235 /doc/guix.texi
parent788df2ecd62d5c2fc0d94928f45c947e6393e20b (diff)
downloadguix-patches-a9a2fdaabcc78e7a54d9a6bcfa4ee3de308e9a90.tar
guix-patches-a9a2fdaabcc78e7a54d9a6bcfa4ee3de308e9a90.tar.gz
mapped-devices: Add 'lvm-device-mapping'.
* gnu/system/mapped-devices.scm (lvm-device-mapping, open-lvm-device, close-lvm-device): New variables. * gnu/tests/install.scm (%lvm-separate-home-os, %lvm-separate-home-os-source, %lvm-separate-home-installation-script, %test-lvm-separate-home-os): New variables. * gnu/system/linux-initrd.scm (raw-initrd): Add (srfi srfi-1) to initrd expression. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'doc/guix.texi')
-rw-r--r--doc/guix.texi25
1 files changed, 23 insertions, 2 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 13fb4b1531..22102972a3 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -13758,7 +13758,6 @@ Guix extends this notion by considering any device or set of devices that
are @dfn{transformed} in some way to create a new device; for instance,
RAID devices are obtained by @dfn{assembling} several other devices, such
as hard disks or partitions, into a new one that behaves as one partition.
-Other examples, not yet implemented, are LVM logical volumes.
Mapped devices are declared using the @code{mapped-device} form,
defined as follows; for examples, see below.
@@ -13771,7 +13770,8 @@ the system boots up.
@item source
This is either a string specifying the name of the block device to be mapped,
such as @code{"/dev/sda3"}, or a list of such strings when several devices
-need to be assembled for creating a new one.
+need to be assembled for creating a new one. In case of LVM this is a
+string specifying name of the volume group to be mapped.
@item target
This string specifies the name of the resulting mapped device. For
@@ -13780,6 +13780,9 @@ specifying @code{"my-partition"} leads to the creation of
the @code{"/dev/mapper/my-partition"} device.
For RAID devices of type @code{raid-device-mapping}, the full device name
such as @code{"/dev/md0"} needs to be given.
+LVM logical volumes of type @code{lvm-device-mapping} need to
+be specified as @code{"VGNAME-LVNAME"}.
+
@item targets
This list of strings specifies names of the resulting mapped devices in case
there are several. The format is identical to @var{target}.
@@ -13803,6 +13806,11 @@ module for the appropriate RAID level to be loaded, such as @code{raid456}
for RAID-4, RAID-5 or RAID-6, or @code{raid10} for RAID-10.
@end defvr
+@defvr {Scheme Variable} lvm-device-mapping
+This defines LVM logical volume(s). Volume group is activated by
+@command{vgchange} command from the package @code{lvm2}.
+@end defvr
+
@cindex disk encryption
@cindex LUKS
The following example specifies a mapping from @file{/dev/sda3} to
@@ -13860,6 +13868,19 @@ Note that the RAID level need not be given; it is chosen during the
initial creation and formatting of the RAID device and is determined
automatically later.
+LVM logical volumes ``alpha'' and ``beta'' from volume group ``vg0'' can
+be declared as follows:
+
+@lisp
+(mapped-device
+ (source "vg0")
+ (target (list "vg0-alpha" "vg0-beta"))
+ (type lvm-device-mapping))
+@end lisp
+
+Devices @file{/dev/mapper/vg0-alpha} and @file{/dev/mapper/vg0-beta} can
+then be used as the @code{device} of a @code{file-system} declaration
+(@pxref{File Systems}).
@node User Accounts
@section User Accounts