all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* btrfs and subvolumes for root
@ 2017-08-06  3:46 Fredrik Salomonsson
  2017-09-02 11:26 ` maze
  0 siblings, 1 reply; 4+ messages in thread
From: Fredrik Salomonsson @ 2017-08-06  3:46 UTC (permalink / raw)
  To: help-guix


[-- Attachment #1.1: Type: text/plain, Size: 1214 bytes --]

Hello Guix,

I'm testing out setting up a dual boot between GuixSD and Arch. I've no
idea how much each one will take on disk. I decided to try out btrfs and
subvolumes for the layout.

But I'm having some issues booting the thing.

My disk layout right now is:
sda
  sda1      1MB BIOS boot
  sda2      4G  swap
  sda3 228.9GB  btrfs

then subvolumes:
sda3/
  __current/guixsd-root
  __current/arch-root
  __current/boot
  __current/home

section from my config.scm, which is based on my old config (old one is
attached).

(file-systems (cons* (file-system
   (device "root")
   (title 'label)
   (mount-point "/boot")
   (options
"defaults,discard,compress=lzo,space_cache,autodefrag,subvol=__current/boot")
   (dependecies mapped-devices))
;; repeat for guixsd-root and home but with correct value for subvol
)

guix system init worked fine but when booting it fails to locate the
bzImage. Which I assume is because it doesn't know that the root is in a
subvolume.

Long story short. How do I add rootflags to GuixSD's grub menu entry? Need
to add "rootflags=subvol=__current/guixsd-root" to the linux-arguments.
Might be an issue of having boot as a subvolume as well.

Thanks

-- 
s/Fred[re]+i[ck]+/Fredrik/g

[-- Attachment #1.2: Type: text/html, Size: 3057 bytes --]

[-- Attachment #2: config.scm --]
[-- Type: text/x-scheme, Size: 2980 bytes --]

;; 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)
	     (ice-9 rdelim))
(use-service-modules desktop networking ssh base xorg)
(use-package-modules wm certs suckless shells)

(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")))

(define keyboard-conf
  (call-with-input-file "/etc/config.d/00-keyboard.conf" read-string))

(operating-system
 (host-name "loke")
 (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 (device "/dev/sda")))

 ;; Specify a mapped device for the encrypted root partition.
 ;; The UUID is that returned by 'cryptsetup luksUUID'.
 (mapped-devices
  (list (mapped-device
	 (source (uuid "de52fa25-e7d0-4d63-8a35-91e561964043"))
	 (target "the-root-device")
	 (type luks-device-mapping))))

 (file-systems (cons* (file-system
		       (device "root")
		       (title 'label)
		       (mount-point "/")
		       (type "ext4")
		       (dependencies mapped-devices))
		      (file-system
		       (device "fafner:/srv/nfs4/Valhalla")
		       (title 'device)
		       (mount-point "/media/Valhalla")
		       (type "nfs4")
		       ;; (options "defaults")
		       (mount? #f)
		       (check? #f))
                      %base-file-systems))

 (users (cons plattfot %base-user-accounts))

 ;; Add a bunch of window managers; we can choose one at
 ;; the log-in screen with F1.
 (packages (cons* i3-wm i3status dmenu ;window managers
		  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 (cons* (service openssh-service-type
			   (openssh-configuration
			    (port-number 6060)))
		  (extra-special-file "/bin/env"
				      (file-append coreutils "/bin/env"))
		  ;;%desktop-services
		  (modify-services %desktop-services
		  		   (slim-service-type 
		  		    config => (slim-configuration
		  			       (inherit config)
		  			       (startx (xorg-start-command
		  					#:configuration-file
		  					(xorg-configuration-file
		  					 #:extra-config
		  					 (list keyboard-conf)))))))))

 ;; Allow resolution of '.local' host names with mDNS.
 (name-service-switch %mdns-host-lookup-nss))

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: btrfs and subvolumes for root
  2017-08-06  3:46 btrfs and subvolumes for root Fredrik Salomonsson
@ 2017-09-02 11:26 ` maze
  2017-09-02 11:34   ` Marius Bakke
  0 siblings, 1 reply; 4+ messages in thread
From: maze @ 2017-09-02 11:26 UTC (permalink / raw)
  To: Fredrik Salomonsson; +Cc: Help-Guix, help-guix

Am 2017-08-06 05:46, schrieb Fredrik Salomonsson:
> Hello Guix,
> 
> I'm testing out setting up a dual boot between GuixSD and Arch. I've
> no idea how much each one will take on disk. I decided to try out
> btrfs and subvolumes for the layout.
> 
> But I'm having some issues booting the thing.
> 
> My disk layout right now is:
> sda
>   sda1      1MB BIOS boot
>   sda2      4G  swap
>   sda3 228.9GB  btrfs
> 
> then subvolumes:
> sda3/
>   __current/guixsd-root
>   __current/arch-root
>   __current/boot
>   __current/home
> 
> section from my config.scm, which is based on my old config (old one
> is attached).
> 
> (file-systems (cons* (file-system
>    (device "root")
>    (title 'label)
>    (mount-point "/boot")
>    (options
> "defaults,discard,compress=lzo,space_cache,autodefrag,subvol=__current/boot")
>    (dependecies mapped-devices))
> ;; repeat for guixsd-root and home but with correct value for subvol
> )
> 
> guix system init worked fine but when booting it fails to locate the
> bzImage. Which I assume is because it doesn't know that the root is in
> a subvolume.
> 
> Long story short. How do I add rootflags to GuixSD's grub menu entry?
> Need to add "rootflags=subvol=__current/guixsd-root" to the
> linux-arguments. Might be an issue of having boot as a subvolume as
> well.
> 
> Thanks
> 
> --
> 
> s/Fred[re]+i[ck]+/Fredrik/g

Hello Fredrik,

I am having the same problem. Adjusting the kernel parameters for the 
GuixSD kernel seems currently not supported.  Looking at the source code 
though it looks like this could be achieved via manipulating the 
"bootloader-configuration-menu-entries" list. (Still a scheme noob!)

That said, it would generally make sense to make this configurable IMO.

Best
Martin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: btrfs and subvolumes for root
  2017-09-02 11:26 ` maze
@ 2017-09-02 11:34   ` Marius Bakke
  2017-09-06  4:13     ` Fredrik Salomonsson
  0 siblings, 1 reply; 4+ messages in thread
From: Marius Bakke @ 2017-09-02 11:34 UTC (permalink / raw)
  To: maze, Fredrik Salomonsson; +Cc: Help-Guix, help-guix

[-- Attachment #1: Type: text/plain, Size: 2000 bytes --]

maze@strahlungsfrei.de writes:

> Am 2017-08-06 05:46, schrieb Fredrik Salomonsson:
>> Hello Guix,
>> 
>> I'm testing out setting up a dual boot between GuixSD and Arch. I've
>> no idea how much each one will take on disk. I decided to try out
>> btrfs and subvolumes for the layout.
>> 
>> But I'm having some issues booting the thing.
>> 
>> My disk layout right now is:
>> sda
>>   sda1      1MB BIOS boot
>>   sda2      4G  swap
>>   sda3 228.9GB  btrfs
>> 
>> then subvolumes:
>> sda3/
>>   __current/guixsd-root
>>   __current/arch-root
>>   __current/boot
>>   __current/home
>> 
>> section from my config.scm, which is based on my old config (old one
>> is attached).
>> 
>> (file-systems (cons* (file-system
>>    (device "root")
>>    (title 'label)
>>    (mount-point "/boot")
>>    (options
>> "defaults,discard,compress=lzo,space_cache,autodefrag,subvol=__current/boot")
>>    (dependecies mapped-devices))
>> ;; repeat for guixsd-root and home but with correct value for subvol
>> )
>> 
>> guix system init worked fine but when booting it fails to locate the
>> bzImage. Which I assume is because it doesn't know that the root is in
>> a subvolume.
>> 
>> Long story short. How do I add rootflags to GuixSD's grub menu entry?
>> Need to add "rootflags=subvol=__current/guixsd-root" to the
>> linux-arguments. Might be an issue of having boot as a subvolume as
>> well.
>> 
>> Thanks
>> 
>> --
>> 
>> s/Fred[re]+i[ck]+/Fredrik/g
>
> Hello Fredrik,
>
> I am having the same problem. Adjusting the kernel parameters for the 
> GuixSD kernel seems currently not supported.  Looking at the source code 
> though it looks like this could be achieved via manipulating the 
> "bootloader-configuration-menu-entries" list. (Still a scheme noob!)

Hello!

Adjusting kernel parameters can be done with 'kernel-arguments'.

Example:

(operating-system
  [...]
  (kernel-arguments '("modprobe.blacklist=pcspkr,snd_pcsp")))

HTH!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: btrfs and subvolumes for root
  2017-09-02 11:34   ` Marius Bakke
@ 2017-09-06  4:13     ` Fredrik Salomonsson
  0 siblings, 0 replies; 4+ messages in thread
From: Fredrik Salomonsson @ 2017-09-06  4:13 UTC (permalink / raw)
  To: Marius Bakke; +Cc: Help-Guix, help-guix, maze


[-- Attachment #1.1: Type: text/plain, Size: 4608 bytes --]

>
> Adjusting kernel parameters can be done with 'kernel-arguments'.

Thanks, missed that option when looking through the manual.

Been messing around with it for a few days trying to get this to work but
so far no luck.

I've made a few changes to my disk layout since my last email. Inspired by
this thread
https://lists.gnu.org/archive/html/help-guix/2016-03/msg00090.html

Partion layout for /dev/sda3
under __current/
| subvol      | Mountpoint   | Comment            | Shared   |
|-------------+--------------+--------------------+----------|
| arch-root   | /            | root for Arch      | no       |
| guixsd-root | /            | root for GuixSD    | no       |
| grub        | /boot/grub   | grub config        | yes      |
| guix        | /var/guix    | guix stuff         | yes      |
| gnu         | /gnu         | Store etc          | yes      |
| home        | /home        | home partition     | yes      |

My plan is to share guix between guixsd and arch similar to
what Christopher Allan Webber does except instead of using bind-mount I'm
using btrfs subvolumes. Then let GuixSD handle the grub generation.

The error I'm getting now is that it cannot find the linux kernel when
booting. Which I assume is because the gnu subvolume isn't mounted? I'm a
bit of a noob when it comes to the boot process.

I tried adding (needed-for-boot? #t) to the filesystems I need at boot. For
example
(file-system
  (device "root")
  (title 'label)
  (mount-point "/gnu")
  (type "btrfs")
  (options
"defaults,discard,compress=lzo,space_cache,autodefrag,subvol=__current/gnu")
  (needed-for-boot? #t)
  (dependencies mapped-devices))

But when I have that set to true, guix complains about missing
mapped-devices for my swap-device and for /home if I comment out
(swap-devices ...).

The error I get is:

> guix system: error: service 'swap-/dev/mapper/the-swap-device' requires
> 'device-mapping-the-swap-device', which is not provided by any service

And if I comment out (swap-devices '("/dev/mapper/the-swap-device")) in my
config.scm I get:

> guix system: error: service 'file-system-/home' requires
> 'device-mapping-the-root-device', which is not provided by any service


If I remove the (needed-for-boot? #t) from the file-system entries the
error goes away.

I tested this using the 0.13.0 img with no guix pull before running guix
system init. But I'm getting the same error when running guix system init
from my Arch linux install.

2017-09-02 4:34 GMT-07:00 Marius Bakke <mbakke@fastmail.com>:

> maze@strahlungsfrei.de writes:
>
> > Am 2017-08-06 05:46, schrieb Fredrik Salomonsson:
> >> Hello Guix,
> >>
> >> I'm testing out setting up a dual boot between GuixSD and Arch. I've
> >> no idea how much each one will take on disk. I decided to try out
> >> btrfs and subvolumes for the layout.
> >>
> >> But I'm having some issues booting the thing.
> >>
> >> My disk layout right now is:
> >> sda
> >>   sda1      1MB BIOS boot
> >>   sda2      4G  swap
> >>   sda3 228.9GB  btrfs
> >>
> >> then subvolumes:
> >> sda3/
> >>   __current/guixsd-root
> >>   __current/arch-root
> >>   __current/boot
> >>   __current/home
> >>
> >> section from my config.scm, which is based on my old config (old one
> >> is attached).
> >>
> >> (file-systems (cons* (file-system
> >>    (device "root")
> >>    (title 'label)
> >>    (mount-point "/boot")
> >>    (options
> >> "defaults,discard,compress=lzo,space_cache,autodefrag,
> subvol=__current/boot")
> >>    (dependecies mapped-devices))
> >> ;; repeat for guixsd-root and home but with correct value for subvol
> >> )
> >>
> >> guix system init worked fine but when booting it fails to locate the
> >> bzImage. Which I assume is because it doesn't know that the root is in
> >> a subvolume.
> >>
> >> Long story short. How do I add rootflags to GuixSD's grub menu entry?
> >> Need to add "rootflags=subvol=__current/guixsd-root" to the
> >> linux-arguments. Might be an issue of having boot as a subvolume as
> >> well.
> >>
> >> Thanks
> >>
> >> --
> >>
> >> s/Fred[re]+i[ck]+/Fredrik/g
> >
> > Hello Fredrik,
> >
> > I am having the same problem. Adjusting the kernel parameters for the
> > GuixSD kernel seems currently not supported.  Looking at the source code
> > though it looks like this could be achieved via manipulating the
> > "bootloader-configuration-menu-entries" list. (Still a scheme noob!)
>
> Hello!
>
> Adjusting kernel parameters can be done with 'kernel-arguments'.
>
> Example:
>
> (operating-system
>   [...]
>   (kernel-arguments '("modprobe.blacklist=pcspkr,snd_pcsp")))
>
> HTH!
>



-- 
s/Fred[re]+i[ck]+/Fredrik/g

[-- Attachment #1.2: Type: text/html, Size: 7695 bytes --]

[-- Attachment #2: config.scm --]
[-- Type: text/x-scheme, Size: 5802 bytes --]

;; 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)
	     (ice-9 rdelim))
(use-service-modules desktop networking ssh base xorg)
(use-package-modules wm certs suckless shells)

(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")))

;;(define keyboard-conf
  ;;(call-with-input-file "/etc/config.d/00-keyboard.conf" read-string))

;; Partion layout for /dev/sda3
;; under __current/
;; | subvol      | Mountpoint   | Comment            | Shared   |
;; |-------------+--------------+--------------------+----------|
;; | arch-root   | /            | root for Arch      | no       |
;; | guixsd-root | /            | root for GuixSD    | no       |
;; | grub        | /boot/grub   | grub config        | yes      |
;; | guix        | /var/guix    | guix stuff         | yes      |
;; | gnu         | /gnu         | Store etc          | yes      |
;; | home        | /home        | home partition     | yes      |
;;    
(operating-system
 (host-name "loke")
 (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 (device "/dev/sda")
		      ;; Need to mount __current/arch-root
		      ;; (menu-entries 
		      ;;  (list 
		      ;; 	(menu-entry
		      ;; 	 (label "Arch Linux")
		      ;; 	 (linux "/boot/vmlinux")
		      ;; 	 (linux-arguments '("luks.uuid=ab43f8be-1a18-4999-836d-71dac382dfb5 luks.name=ab43f8be-1a18-4999-836d-71dac382dfb5=root luks.key=ab43f8be-1a18-4999-836d-71dac382dfb5=/boot/rootkey.bin luks.options=ab43f8be-1a18-4999-836d-71dac382dfb5=discard,luks luks.uuid=9f04f917-efd3-4036-b3f5-24705fee7ffa luks.name=9f04f917-efd3-4036-b3f5-24705fee7ffa=swap luks.key=9f04f917-efd3-4036-b3f5-24705fee7ffa=/boot/swapkey.bin luks.options=9f04f917-efd3-4036-b3f5-24705fee7ffa=swap,discard,luks root=LABEL=root resume=/dev/mapper/swap rootflags=compress=lzo,subvol=__current/arch-root"))
		      ;; 	 (initrd "/boot/initramfs-linux.img"))))
		      ))
 ;; Kernel arguments
 (kernel-arguments '("rootflags=compress=lzo,subvol=__current/guixsd-root"))
 ;; Specify a mapped device for the encrypted root partition.
 ;; The UUID is that returned by 'cryptsetup luksUUID'.
 (mapped-devices
  (list (mapped-device
	 (source (uuid "ab43f8be-1a18-4999-836d-71dac382dfb5"))
	 (target "the-root-device")
	 (type luks-device-mapping))
	(mapped-device
	 (source (uuid "9f04f917-efd3-4036-b3f5-24705fee7ffa"))
	 (target "the-swap-device")
	 (type luks-device-mapping))))

 (file-systems 
  (cons* (file-system
	  (device "root")
	  (title 'label)
	  (mount-point "/boot/grub")
	  (type "btrfs")
	  (options "defaults,discard,compress=lzo,space_cache,autodefrag,subvol=__current/grub")
	  (needed-for-boot? #t)
	  (dependencies mapped-devices))
	 (file-system
	  (device "root")
	  (title 'label)
	  (mount-point "/")
	  (type "btrfs")
	  (options "defaults,discard,compress=lzo,space_cache,autodefrag,subvol=__current/guixsd-root")
	  (needed-for-boot? #t)
	  (dependencies mapped-devices))
	 (file-system
	  (device "root")
	  (title 'label)
	  (mount-point "/gnu")
	  (type "btrfs")
	  (options "defaults,discard,compress=lzo,space_cache,autodefrag,subvol=__current/gnu")
	  (needed-for-boot? #t)
	  (dependencies mapped-devices))
	 (file-system
	  (device "root")
	  (title 'label)
	  (mount-point "/var/guix")
	  (type "btrfs")
	  (options "defaults,discard,compress=lzo,space_cache,autodefrag,subvol=__current/guix")
	  (needed-for-boot? #t)
	  (dependencies mapped-devices))
	 (file-system
	  (device "root")
	  (title 'label)
	  (mount-point "/home")
	  (type "btrfs")
	  (options "defaults,discard,compress=lzo,space_cache,autodefrag,subvol=__current/home")
	  (dependencies mapped-devices))
	 ;; (file-system
	 ;;  (device "swap")
	 ;;  (title 'label)
	 ;;  (mount-point "none")
	 ;;  (type "swap")
	 ;;  (dependencies mapped-devices))
	 (file-system
	  (device "fafner:/srv/nfs4/Valhalla")
	  (title 'device)
	  (mount-point "/media/Valhalla")
	  (type "nfs4")
	  ;; (options "defaults")
	  (mount? #f)
	  (check? #f))
	 %base-file-systems))
 (swap-devices '("/dev/mapper/the-swap-device"))
 (users (cons plattfot %base-user-accounts))

 ;; Add a bunch of window managers; we can choose one at
 ;; the log-in screen with F1.
 (packages (cons* i3-wm i3status dmenu ;window managers
		  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 (cons* (service openssh-service-type
			   (openssh-configuration
			    (port-number 6060)))
		  (extra-special-file "/bin/env"
				      (file-append coreutils "/bin/env"))
		  %desktop-services
		  ;; (modify-services %desktop-services
		  ;;	   (slim-service-type 
		  ;;    config => (slim-configuration
		  ;;       (inherit config)
		  ;;     (startx (xorg-start-command
		  ;;	#:configuration-file
		  ;;(xorg-configuration-file
		  ;;#:extra-config
		  ;;(list keyboard-conf)))))))
		  ))

 ;; Allow resolution of '.local' host names with mDNS.
 (name-service-switch %mdns-host-lookup-nss))

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-06  4:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-06  3:46 btrfs and subvolumes for root Fredrik Salomonsson
2017-09-02 11:26 ` maze
2017-09-02 11:34   ` Marius Bakke
2017-09-06  4:13     ` Fredrik Salomonsson

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.