Hello!
I would like to create a Guix System bootable from a USB. I am trying to
configure an image record that will allow me to create this image with a
large enough root partition (my USB is 32GB) that I can also instantiate
my home configuration on it, whether manually or programatically later.
I have tried two different ways of creating an image with a large
root partition, but am having difficulty with both:
(define system
(operating-system
...)) ;; simplified
(define MiB (expt 2 20))
(define GiB (expt 2 30))
(image
(format 'disk-image)
(operating-system system)
(partitions
(list
(partition
(size (* 40 MiB))
(offset (* 1024 1024))
(label "GNU-ESP")
(file-system "vfat")
(flags '(esp))
(initializer (gexp initialize-efi-partition)))
(partition
(size (* 28 GiB))
(label root-label)
(file-system "ext4")
(flags '(boot))
(initializer (gexp initialize-root-partition))))))
;; the above image declaraction is in kvasir.scm
$ guix system -L ~/.config/guix/modules/ image ~/.config/guix/kvasir.scm
This generates correctly sized and offset partitions, but unfortunately
results in a broken grub configuration. The program packages are there,
but the /root directory is missing as well; so is my user (all part of the
shared 'system' declaration I use to configure the computer I write this
on) and the guixbuild user group...
I then tried to use a different image format (iso9660), which I based off of
the existing iso9660-image included in the existing images module (so
the same as the above but no ESP partition):
(image
(format 'iso9660)
(operating-system system)
(partitions
(list
(partition
(size (* 28 GiB))
(label root-label)
(file-system "ext4")
(flags '(boot))
(initializer (gexp initialize-root-partition))))))
This creates a full, working configuration, but also ignores my size and
offset specifications (the root partition is ~2GiB, and starts at block
0). I have tried to resize the partition manually using fdisk, but
because the boot partition starts after the root partition, this also
seems impossible (and more of a duct-tape solution).
So I am not sure how to get the image I want. If anyone were able to
help me fix my image record (or better solutions, or even a suggestion
as to why mine doesn't work) to generate a simple image that works on
most modern computers and has a large root partition, it would be very
helpful to me.
Thanks!
bd