From: Tom Fitzhenry <tom@tom-fitzhenry.me.uk>
To: 51547@debbugs.gnu.org
Subject: bug#51547: Erase / on boot
Date: Mon, 1 Nov 2021 23:19:08 +1100 [thread overview]
Message-ID: <e2aeac72-fa72-bb55-4074-4605065630d7@tom-fitzhenry.me.uk> (raw)
In-Reply-To: <0eb0cb5f-2a76-08b6-1e24-ea1593b56c98@tom-fitzhenry.me.uk>
Adventures so far...
I've pasted a working system configuration at the bottom.
The idea is to boot / as tmpfs, and to mount the minimal set of
directories from persistent storage:
* /boot
* /gnu
* /home is not strictly required, but is useful!
* /var/guix
What's working:
* Booting to GNOME
* `guix system reconfigure`
* Booting previous generations
* /etc and /var are empty upon boot, woo!
A few issues:
* Bootstrapping all this is non-trivial. It requires fiddling with
partitions, and getting it wrong can easily make your system unbootable.
Suggestions? Maybe the user could set up bind-mounts to map to their
preferred partition scheme? A basic cookbook entry could bind-mount
directories from a single ext4 partition to the required directories.
* I tried setting up /gnu and /var/guix as bind-mounts per
<https://guix.gnu.org/cookbook/en/html_node/Setting-up-a-bind-mount.html>,
but this didn't seem to work from initrd: the kernel panic'd on boot. I
need to confirm this and raise a bug.
* Mounting / as tmpfs falsely requires a device, otherwise it waits
forever on boot. I need to confirm this and raise a bug.
* Activation-on-boot fails due to inexistence of /run and /var/run.
<https://issues.guix.gnu.org/51548> fixes this.
Here's the config:
(use-modules (gnu))
(use-service-modules desktop networking ssh xorg)
(operating-system
(timezone "Australia/Sydney")
(host-name "test")
(users (cons* (user-account
(name "tom")
(comment "Tom")
(group "users")
(home-directory "/home/tom")
;; Needed since /etc/passwd is not persisted.
(password (crypt "password" "foobar"))
(supplementary-groups
'("wheel" "netdev" "audio" "video")))
%base-user-accounts))
(packages
(append
(list
(specification->package "emacs-next"))
%base-packages))
(services
(append
(list (service gnome-desktop-service-type)
(set-xorg-configuration
(xorg-configuration
(keyboard-layout keyboard-layout))))
%desktop-services))
(bootloader
(bootloader-configuration
(bootloader grub-bootloader)
(target "/dev/sda")
(keyboard-layout keyboard-layout)))
(file-systems
(cons* (file-system
(mount-point "/")
(device
;; TODO: Raise bug that root-as-tmpfs falsely requires a partition.
(uuid "59457d60-2b08-4f5c-b1c7-e29cd5f7a3da"
'btrfs))
(options "size=1G")
(type "tmpfs"))
(file-system
(mount-point "/boot")
(device
(uuid "59457d60-2b08-4f5c-b1c7-e29cd5f7a3da"
'btrfs))
(options "subvol=boot")
(needed-for-boot? #t)
(type "btrfs"))
(file-system
(mount-point "/home")
(device
(uuid "59457d60-2b08-4f5c-b1c7-e29cd5f7a3da"
'btrfs))
(options "subvol=home")
(type "btrfs"))
(file-system
(mount-point "/var/guix")
(device
(uuid "59457d60-2b08-4f5c-b1c7-e29cd5f7a3da"
'btrfs))
(options "subvol=var/guix")
;; Needed to boot old generations, which needs /var/guix/profiles/
(needed-for-boot? #t)
(type "btrfs"))
(file-system
(mount-point "/gnu")
(device
(uuid "59457d60-2b08-4f5c-b1c7-e29cd5f7a3da"
'btrfs))
(options "subvol=gnu")
(needed-for-boot? #t)
(type "btrfs"))
%base-file-systems)))
next prev parent reply other threads:[~2021-11-02 21:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-01 11:13 bug#51547: Erase / on boot Tom Fitzhenry
2021-11-01 12:19 ` Tom Fitzhenry [this message]
2021-11-03 13:35 ` Tom Fitzhenry
2022-07-12 14:13 ` Maxim Cournoyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e2aeac72-fa72-bb55-4074-4605065630d7@tom-fitzhenry.me.uk \
--to=tom@tom-fitzhenry.me.uk \
--cc=51547@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.