doc: Give an example with an encrypted root partition.
* gnu/system/examples/desktop.tmpl: Add 'mapped-devices' field. Use it in 'file-systems'. * doc/guix.texi (System Installation): Suggest encrypted partitions. Give an example of a command sequence.
This commit is contained in:
parent
b8d2eda4a3
commit
6d6e628119
|
@ -5237,14 +5237,24 @@ Setting up network access is almost always a requirement because the
|
||||||
image does not contain all the software and tools that may be needed.
|
image does not contain all the software and tools that may be needed.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
Unless this has already been done, you must partition and format the
|
Unless this has already been done, you must partition, optionally
|
||||||
target partitions.
|
encrypt, and then format the target partitions.
|
||||||
|
|
||||||
Preferably, assign partitions a label so that you can easily and
|
Preferably, assign partitions a label so that you can easily and
|
||||||
reliably refer to them in @code{file-system} declarations (@pxref{File
|
reliably refer to them in @code{file-system} declarations (@pxref{File
|
||||||
Systems}). This is typically done using the @code{-L} option of
|
Systems}). This is typically done using the @code{-L} option of
|
||||||
@command{mkfs.ext4} and related commands.
|
@command{mkfs.ext4} and related commands.
|
||||||
|
|
||||||
|
A typical command sequence may be:
|
||||||
|
|
||||||
|
@example
|
||||||
|
# fdisk /dev/sdX
|
||||||
|
@dots{} Create partitions etc.@dots{}
|
||||||
|
# cryptsetup luksFormat /dev/sdX1
|
||||||
|
# cryptsetup open --type luks /dev/sdX1 my-partition
|
||||||
|
# mkfs.ext4 -L my-root /dev/mapper/my-partition
|
||||||
|
@end example
|
||||||
|
|
||||||
The installation image includes Parted (@pxref{Overview,,, parted, GNU
|
The installation image includes Parted (@pxref{Overview,,, parted, GNU
|
||||||
Parted User Manual}), @command{fdisk}, Cryptsetup/LUKS for disk
|
Parted User Manual}), @command{fdisk}, Cryptsetup/LUKS for disk
|
||||||
encryption, and e2fsprogs, the suite of tools to manipulate
|
encryption, and e2fsprogs, the suite of tools to manipulate
|
||||||
|
|
|
@ -13,9 +13,17 @@
|
||||||
;; Assuming /dev/sdX is the target hard disk, and "root" is
|
;; Assuming /dev/sdX is the target hard disk, and "root" is
|
||||||
;; the label of the target root file system.
|
;; the label of the target root file system.
|
||||||
(bootloader (grub-configuration (device "/dev/sdX")))
|
(bootloader (grub-configuration (device "/dev/sdX")))
|
||||||
|
|
||||||
|
;; Here we assume that /dev/sdX1 contains a LUKS-encrypted
|
||||||
|
;; root partition created with 'cryptsetup luksFormat'.
|
||||||
|
(mapped-devices (list (mapped-device
|
||||||
|
(source "/dev/sdX1")
|
||||||
|
(target "root-partition")
|
||||||
|
(type luks-device-mapping))))
|
||||||
|
|
||||||
|
;; Mount said encrypted partition.
|
||||||
(file-systems (cons (file-system
|
(file-systems (cons (file-system
|
||||||
(device "root")
|
(device "/dev/mapper/root-partition")
|
||||||
(title 'label)
|
|
||||||
(mount-point "/")
|
(mount-point "/")
|
||||||
(type "ext4"))
|
(type "ext4"))
|
||||||
%base-file-systems))
|
%base-file-systems))
|
||||||
|
|
Loading…
Reference in New Issue