[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#51547: Erase / on boot

From: Tom Fitzhenry
Subject: bug#51547: Erase / on boot
Date: Mon, 1 Nov 2021 23:19:08 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2

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)

 (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"))
                 '("wheel" "netdev" "audio" "video")))
    (specification->package "emacs-next"))
   (list (service gnome-desktop-service-type)
           (keyboard-layout keyboard-layout))))
   (bootloader grub-bootloader)
   (target "/dev/sda")
   (keyboard-layout keyboard-layout)))
  (cons* (file-system
          (mount-point "/")
           ;; TODO: Raise bug that root-as-tmpfs falsely requires a partition.
           (uuid "59457d60-2b08-4f5c-b1c7-e29cd5f7a3da"
          (options "size=1G")
          (type "tmpfs"))
          (mount-point "/boot")
           (uuid "59457d60-2b08-4f5c-b1c7-e29cd5f7a3da"
          (options "subvol=boot")
          (needed-for-boot? #t)
          (type "btrfs"))     
          (mount-point "/home")
           (uuid "59457d60-2b08-4f5c-b1c7-e29cd5f7a3da"
          (options "subvol=home")
          (type "btrfs"))
          (mount-point "/var/guix")
           (uuid "59457d60-2b08-4f5c-b1c7-e29cd5f7a3da"
          (options "subvol=var/guix")
          ;; Needed to boot old generations, which needs /var/guix/profiles/
          (needed-for-boot? #t)
          (type "btrfs"))
          (mount-point "/gnu")
           (uuid "59457d60-2b08-4f5c-b1c7-e29cd5f7a3da"
          (options "subvol=gnu")
          (needed-for-boot? #t)
          (type "btrfs"))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]