(address . bug-guix@gnu.org)
When you have separate btrfs subvolumes for /gnu and /var/guix, you'll
encounter this error running `guix system init /mnt/etc/config.scm /mnt`
when it tries to copy things to /mnt. My guess is that guix is trying to
remove one of them but fails as they're mounted.
I encountered this issue while I tried installing guix system on my main
laptop. But I have encountered this before [1]. When I installed guix
system on my secondary laptop. I worked around it back then by using
guix-0.15.0.
For my secondary laptop I have this layout
| subvol | Mountpoint | Comment |
|-----------------------+------------+-----------------|
| __current/guixsd-root | / | root for GuixSD |
| __current/grub | /boot/grub | grub config |
| __current/guix | /var/guix | guix stuff |
| __current/gnu | /gnu | Store etc |
| __current/home | /home | home partition |
For my main laptop I tried:
| subvol | Mountpoint | Comment |
|--------+------------+----------------|
| @ | / | root for Guix |
| @grub | /boot/grub | grub config |
| @guix | /var/guix | guix stuff |
| @gnu | /gnu | Store etc |
| @home | /home | home partition |
Found another thread that also had this issue [2], and the same
workaround worked for me. I.e. simplified the layout:
| subvol | Mountpoint | Comment |
|-----------+------------+----------------|
| @ | / | root for Guix |
| @home | /home | home partition |
This seems to just be an issue when running guix system init, as I've
been using my secondary laptop with separate subvolumes for /gnu and
/var/guix without any issues since 0.15.
The guix version I used to install my main laptop with was
1.1.0-25.44c6e6f. I generated it with
guix system disk-image --file-system-type=iso9660 \
gnu/system/install.scm
As described in the manual.
Thanks
;; This is an operating system configuration template
;; for a "desktop" setup without full-blown desktop
;; environments.
(use-modules (gnu)
(gnu packages)
(gnu system nss)
(gnu system locale)
(gnu services nfs)
(gnu services sddm)
(ice-9 rdelim)
(ice-9 format)
(srfi srfi-1))
(use-service-modules desktop networking ssh base xorg)
(use-package-modules wm certs shells xdisorg display-managers)
(define plattfot
(user-account
(name "plattfot")
(group "users")
;; Define a G-Expr to find the path of the zsh binary:
;; https://gitlab.com/rain1/guix-wiki/wikis/FAQ#how-do-i-make-my-login-shell-zsh
;;(shell #~(string-append #$zsh "/bin/zsh"))
(supplementary-groups '("wheel" "netdev" "audio" "video"))
(home-directory "/home/plattfot")))
;; Specify a mapped device for the encrypted root partition.
;; The UUID is that returned by 'cryptsetup luksUUID'.
(define mapped-swap
(mapped-device
(source (uuid "3f1a433f-e3d5-46f1-8471-b0cfee72a659"))
(target "swap")
(type luks-device-mapping)))
(define mapped-root
(mapped-device
(source (uuid "0633603e-019c-4be0-b35e-abb055660909"))
(target "root")
(type luks-device-mapping)))
;; Partion layout for `root`
;; | subvol | Mountpoint | Comment | Shared |
;; |-----------+------------+--------------------+--------|
;; | @ | / | root for Guix | no |
;; | @home | /home | home partition | yes |
(define btrfs-common-options
'("discard" "compress=lzo" "space_cache" "autodefrag"))
(define (btrfs-mount-options subvol)
"Return the btrfs mount options I use.
Where SUBVOL is the subvolume to mount"
(string-join `(,@btrfs-common-options ,(format #f "subvol=~a" subvol)) ","))
(define fs-root
(file-system
(mount-point "/")
(type "btrfs")
(device (file-system-label "root"))
(options (btrfs-mount-options "@"))
(needed-for-boot? #t)
(dependencies `(,mapped-root))))
(define fs-home
(file-system
(mount-point "/home")
(type "btrfs")
(device (file-system-label "root"))
(options (btrfs-mount-options "@home"))
(needed-for-boot? #t)
(dependencies `(,fs-root))))
(define nfs-valhalla
(file-system
(device "fafner:/srv/nfs4/Valhalla")
(mount-point "/media/Valhalla")
(type "nfs4")
(mount? #f)
(check? #f)))
(operating-system
(host-name "heimdal")
(timezone "Canada/Pacific")
(locale "en_US.utf8")
(locale-definitions
(list
(locale-definition (name "en_US.utf8") (source "en_US") (charset "UTF-8"))
(locale-definition (name "sv_SE.utf8") (source "sv_SE") (charset "UTF-8"))))
;; Assuming /dev/sda is the target hard disk, and "root"
;; is the label of the target root file system.
(bootloader
(grub-configuration (target "/dev/sda")))
;; Kernel arguments
(kernel-arguments '("rootflags=compress=lzo,subvol=@"))
(mapped-devices (list mapped-root mapped-swap))
(file-systems
(cons*
fs-root
fs-home
nfs-valhalla
%base-file-systems))
(swap-devices '("/dev/mapper/swap"))
(users (cons plattfot %base-user-accounts))
(keyboard-layout (keyboard-layout "us" #:options '("ctrl:swapcaps")))
(packages (cons* sway waybar
rofi
guix-simplyblack-sddm-theme
;;zsh
nss-certs ;for HTTPS access
%base-packages))
;; Use the "desktop" services, which include the X11
;; log-in service, networking with Wicd, and more.
(services
;;%desktop-services
(cons* (service openssh-service-type
(openssh-configuration
(port-number 6060)
(password-authentication? #f)))
(extra-special-file "/bin/env" (file-append coreutils "/bin/env"))
(service sddm-service-type
(sddm-configuration
(display-server "wayland")
(theme "guix-simplyblack-sddm")))
(remove (lambda (service)
(member (service-kind service)
(list
gdm-service-type
)))
%desktop-services)))
;; Allow resolution of '.local' host names with mDNS.
(name-service-switch %mdns-host-lookup-nss))
--
s/Fred[re]+i[ck]+/Fredrik/g