From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sLUXCtyo9mB4BAEAgWs5BA (envelope-from ) for ; Tue, 20 Jul 2021 12:43:40 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 8BnmBdyo9mDNWQAAbx9fmQ (envelope-from ) for ; Tue, 20 Jul 2021 10:43:40 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3FEB38725 for ; Tue, 20 Jul 2021 12:43:39 +0200 (CEST) Received: from localhost ([::1]:51556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5nDu-0002wy-6c for larch@yhetil.org; Tue, 20 Jul 2021 06:43:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5nDK-0002uw-NK for guix-patches@gnu.org; Tue, 20 Jul 2021 06:43:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49553) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m5nDK-0006p4-BD for guix-patches@gnu.org; Tue, 20 Jul 2021 06:43:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m5nDK-0004TM-5a for guix-patches@gnu.org; Tue, 20 Jul 2021 06:43:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49654] [PATCH] doc: Add full disc encryption guide to the cookbook Resent-From: Giovanni Biscuolo Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 20 Jul 2021 10:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49654 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Joshua Branson , 49654@debbugs.gnu.org Cc: rg@raghavgururajan.name Received: via spool by 49654-submit@debbugs.gnu.org id=B49654.162677775217145 (code B ref 49654); Tue, 20 Jul 2021 10:43:02 +0000 Received: (at 49654) by debbugs.gnu.org; 20 Jul 2021 10:42:32 +0000 Received: from localhost ([127.0.0.1]:32866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5nCq-0004ST-4x for submit@debbugs.gnu.org; Tue, 20 Jul 2021 06:42:32 -0400 Received: from ns13.heimat.it ([46.4.214.66]:46388) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5nCo-0004SE-B6 for 49654@debbugs.gnu.org; Tue, 20 Jul 2021 06:42:31 -0400 Received: from localhost (ip6-localhost [127.0.0.1]) by ns13.heimat.it (Postfix) with ESMTP id 5C2323021BA; Tue, 20 Jul 2021 10:42:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at ns13.heimat.it Received: from ns13.heimat.it ([127.0.0.1]) by localhost (ns13.heimat.it [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c0nQYWcj6Fx5; Tue, 20 Jul 2021 10:41:47 +0000 (UTC) Received: from bourrache.mug.xelera.it (unknown [93.56.171.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ns13.heimat.it (Postfix) with ESMTPSA id 002A83021B9; Tue, 20 Jul 2021 10:41:38 +0000 (UTC) Received: from roquette.mug.biscuolo.net (roquette [10.38.2.14]) by bourrache.mug.xelera.it (Postfix) with SMTP id 7F4EF10FD94A; Tue, 20 Jul 2021 12:41:38 +0200 (CEST) Received: (nullmailer pid 30492 invoked by uid 1000); Tue, 20 Jul 2021 10:41:38 -0000 From: Giovanni Biscuolo In-Reply-To: <20210720052229.15438-1-jbranso@dismail.de> Organization: Xelera.eu References: <20210720052229.15438-1-jbranso@dismail.de> Date: Tue, 20 Jul 2021 12:41:37 +0200 Message-ID: <87pmvdi7xa.fsf@xelera.eu> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626777819; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=Kd9FHbL8CHm40ZP58zO1SsADQ0SCdCuBqvOvStc9WC8=; b=UCAZRVPV/1ghvZNwXkAuqBtERa8vE1qeqW0dqn3+5eN98SIQ4bzOv0hsZegndE/VVGsWxf qw6c+9U/ulS6x4GiFi4cK3szAHVmAfpyiHGiZi41dRc52iPhyOAy5YKSpwRxvSST6cpBWD q3E7sQ2eppWYwQzB1MCPe6BH8SOfsH2rPB7Q1USxrl6dkQZRg0tVrFgkwECW7tM2c28xHW PwPPF0EceJZBqSAaDxBxdXoqE/YASkoFlH70CvtCsReIsbQwqXMIKQF6HdkQL4WxjGcWrT mdaTyP4RINNsD9kc0YA7KfYgyoWUk6a1vzH2u9yw9N3Fn70iVAX4iXCuwmgL2A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626777819; a=rsa-sha256; cv=none; b=JicFV6XNOS50TeLrM+DCvNAgejujCXtJgeRTaT0DGhPbyEokUtxX1nUpc6GhPBLuPtY9/t 3pfHyRiD6b4VHuEU5/DHZZFHCZLrmJ24OEFmxoxN5xgZMw15yL4jKWHNXVMF5IQodCRHs2 AOEIwKzMIjloUNpBoZYYQ5u7wF/T+WPfoE9R/MxWcnR50Jgdf6/uw1uDnFce7KRUbrArkh yJZFD6q4tdtRyQnuKyQhSEKqBrs/MjszolwHH/jlMPSwWTR2fnYfknyh+31+xrRUSb1j+S tUqntbWja37L9JHFGVWJmNY523qQRLXJCiUXwYg7gCrTiS/72CfD1gQ665xSIA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.02 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 3FEB38725 X-Spam-Score: -2.02 X-Migadu-Scanner: scn0.migadu.com X-TUID: WDinkpWrEur4 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hello Joshua and Raghav, thank you for your guide! I have just a couple of comments. Joshua Branson via Guix-patches via writes: > From: Joshua Branson > > The original guide was written by Raghav Gururajan > and edited by Joshua Branson . > > * doc/guix-cookbook.texi (System Configuration): New section of full disc > encryption via libreboot. > --- > doc/guix-cookbook.texi | 724 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 724 insertions(+) [...] > +* Guix System with Full Disk Encryption:: Guix System with Full Disk = Encryption AFAIU the steps, especially the partitioning that does not provide an UEFI dedicated partition, are specific to Libreboot systems: what about to make it more clear in the section title? ...or to adapt the section by separating Libreboot specific instructions from generic system instructions? [...] > +Create a physical volume in the partition. > + > +@example > +pvcreate /dev/mapper/partname --verbose > +@end example > + > +Create a volume group in the physical volume, where @code{vgname} is any > +desired name for volume group. > + > +@example > +vgcreate vgname /dev/mapper/partname --verbose > +@end example > + > +Create logical volumes in the volume group; where "num" is the number > +for space in GB, and @code{lvnameroot} and @code{lvnamehome} are any > +desired names for root and home volumes respectively. > + > +@example > +lvcreate --extents 25%VG vgname --name lvnameroot --verbose > +lvcreate --extents 100%FREE vgname --name lvnamehome --verbose > +@end example > + > +Create filesystems on the logical-volumes, where @code{fsnameroot} and > +@code{fsnamehome} are any desired names for root and home filesystems > +respectively. > + > +@example > +mkfs.btrfs --metadata dup --label fsnameroot /dev/vgname/lvnameroot > +mkfs.btrfs --metadata dup --label fsnamehome /dev/vgname/lvnamehome > +@end example Why using two BTRFS volumes on top of LVM and not directly using BTRFS (with subvolumes if you want) on top of /dev/mapper/partname? AFAIU the "double mapping" it's not needed, BTRFS have a very good (and now mature) built in volume manager. Furthermore, using BTRFS for volume management will allow users to switch to a multi-device system (e.g. RAID1) very easily. I'm still using LVM on some "legacy" systems but for new installations I'd strogly suggest starting using BTRFS on top of "physical" partitions. > +Mount the filesystems under the current system. > + > +@example > +mount --label fsnameroot --target /mnt --types btrfs --verbose > +mkdir --verbose /mnt/home && mount --label fsnamehome --target \ > +/mnt/home --types btrfs --verbose > +@end example > + > +Create a swap file. > + > +@example > +dd bs=3D1MiB count=3D1GiB if=3D/dev/zero of=3D/mnt/swapfile status=3Dpro= gress > +mkswap --verbose /mnt/swapfile > +@end example I know that since Linux 2.6 swapfile performance is not a big issue if the file is unfragmented (and it'll be for sure on newly partitioned filesystems) but AFAIU swap files are still a little bit problematic on BTRFS https://btrfs.wiki.kernel.org/index.php/FAQ#Does_Btrfs_support_swap_files.3= F: =2D-8<---------------cut here---------------start------------->8--- From=20kernel 5.0+ btrfs have native swap files support, but with some limitations. Swap file - must be fully allocated as NOCOW with no compression on one device. =2D-8<---------------cut here---------------end--------------->8--- I've never tested a system with swap file on BTRFS but I think that your instructions should add how to set NOCOW for the swap file. The above example could be: =2D-8<---------------cut here---------------start------------->8--- @example dd bs=3D1MiB count=3D1GiB if=3D/dev/zero of=3D/mnt/swapfile status=3Dprogre= ss mkswap --verbose /mnt/swapfile chattr +C /mnt/swapfile btrfs property set /mnt/swapfile compression none @end example =2D-8<---------------cut here---------------end--------------->8--- Final note: AFAIU BTRFS supports swap files ONLY in single device settings (that is: NO swap file support on multi device settings), so IMHO it's better to use a dedicated partition for the swap space so users are free to switch to a multi-device setting if they wish (and can). The problem with a fully encrypted dedicated swap partition is that it'll require a third passphrase prompt on boot (the one to unlock the swap partition), but that's a minor annoyance IMHO. What do you think? [...] Happy hacking! Gio' =2D-=20 Giovanni Biscuolo Xelera IT Infrastructures --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJABAEBCgAqFiEERcxjuFJYydVfNLI5030Op87MORIFAmD2qGEMHGdAeGVsZXJh LmV1AAoJENN9DqfOzDkSk2kP/1D7pOfC9mchHXvnTDi9mGvi8FdWayUO3LMOqt9L 198CBLezXNTGY/kPQwBHJRDB7u34EsZMGi4IrJVjAf25yXqslLHsiU5OHNgZ2xoV ngj1hKGKo8Uy84K+/B4uHyx3W5NUatjbfxTnb2JBjbxtWGU4SEqFyAtQ/qyrL6cc UNWEPQuiajcdDZxChLj0pT6SzD93Lf+PY6kSj7O0bB4BJHymoiDiZs1dyuazRti0 uYMhe9GvjIXEheDcrIkUBvJRgP9OW77ORMjf7UyHSNFelxxMVKOt4gqYvIqi9C/s QVTPB/SApqcZQEy3mFjhvKx31cQ7dyrm3yv2mi9O7D9n32foiQgEbhJhBVcb4xZa kcdq3c9Msbkd6V8k9tYDWhyXp0QD4pdHuB3vPFJ1GCXgaqdbkaUgqO3pnW4wW1DE 0qJjZhKDpD7MYO/OWEKPfGuI12F6aGM8GQ0HN5PY1StT6OAyALXUKq256ECo8pgI XirsMXMDtb5Pcmt/i1Whe19hCZWhJ5eK/NXlgJhGirjDU7HaqTIbW1aOWiBnb3HX taR3t0c+KLuPk+7h6+TWJQI2Ryzx9WQuWWMM7frZx5q/kOTKZ7aGRZ4xVtnK2moa j3Bj/i7ayqD78ZUAXva9PomPR41/fipYoVbuw/1zBgKS0Fe0xXgyZ7jnmNOIUtar syU5 =k+lZ -----END PGP SIGNATURE----- --=-=-=--