all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How do I specify a btrfs subvolume?
@ 2021-03-15  1:33 Nathan Dehnel
  2021-03-17  1:44 ` raingloom
  0 siblings, 1 reply; 3+ messages in thread
From: Nathan Dehnel @ 2021-03-15  1:33 UTC (permalink / raw)
  To: help-guix

This is extremely confusing:
https://guix.gnu.org/manual/en/html_node/Btrfs-file-system.html

I made my best attempt at creating and mounting a subvolume at
/media/offsite-backup:

  (file-systems
    (cons* (file-system
             (mount-point "/")
             (device
               (uuid "b2e0f449-0583-46fd-8c23-ad2e6cd661a1"
                     'btrfs))
             (type "btrfs"))
           (file-system
             (mount-point "/media/offsite-backup")
             (device
               (uuid "b2e0f449-0583-46fd-8c23-ad2e6cd661a1"
                     'btrfs))
             (type "btrfs")
             (options "subvol=offsite-backup,compress=zlib:9"))

It gives this error:

building /gnu/store/mrs1qbg619qk4n2lv8k377arclgzwqjq-install-bootloader.scm.drv...
guix system: bootloader successfully installed on '/dev/sda'
guix system: warning: exception caught while executing 'start' on
service 'file-system-/media/offsite-backup':
In procedure mount: mount "/dev/sda2" on "///media/offsite-backup": No
such file or directory
guix system: warning: some services could not be upgraded

But /media/offsite-backup exists.


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

* Re: How do I specify a btrfs subvolume?
  2021-03-15  1:33 How do I specify a btrfs subvolume? Nathan Dehnel
@ 2021-03-17  1:44 ` raingloom
  2021-03-18  2:48   ` Maxim Cournoyer
  0 siblings, 1 reply; 3+ messages in thread
From: raingloom @ 2021-03-17  1:44 UTC (permalink / raw)
  To: help-guix

On Sun, 14 Mar 2021 20:33:06 -0500
Nathan Dehnel <ncdehnel@gmail.com> wrote:

> This is extremely confusing:
> https://guix.gnu.org/manual/en/html_node/Btrfs-file-system.html
> 
> I made my best attempt at creating and mounting a subvolume at
> /media/offsite-backup:
> 
>   (file-systems
>     (cons* (file-system
>              (mount-point "/")
>              (device
>                (uuid "b2e0f449-0583-46fd-8c23-ad2e6cd661a1"
>                      'btrfs))
>              (type "btrfs"))
>            (file-system
>              (mount-point "/media/offsite-backup")
>              (device
>                (uuid "b2e0f449-0583-46fd-8c23-ad2e6cd661a1"
>                      'btrfs))
>              (type "btrfs")
>              (options "subvol=offsite-backup,compress=zlib:9"))
> 
> It gives this error:
> 
> building
> /gnu/store/mrs1qbg619qk4n2lv8k377arclgzwqjq-install-bootloader.scm.drv...
> guix system: bootloader successfully installed on '/dev/sda' guix
> system: warning: exception caught while executing 'start' on service
> 'file-system-/media/offsite-backup': In procedure mount: mount
> "/dev/sda2" on "///media/offsite-backup": No such file or directory
> guix system: warning: some services could not be upgraded
> 
> But /media/offsite-backup exists.
> 

I'm looking at
https://wiki.archlinux.org/index.php/Btrfs#Mounting_subvolumes
and it seems like you either need a numberic ID or an absolute path,
not a relative one.
On my machine `findmnt` returns `subvol=/`.


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

* Re: How do I specify a btrfs subvolume?
  2021-03-17  1:44 ` raingloom
@ 2021-03-18  2:48   ` Maxim Cournoyer
  0 siblings, 0 replies; 3+ messages in thread
From: Maxim Cournoyer @ 2021-03-18  2:48 UTC (permalink / raw)
  To: raingloom; +Cc: help-guix

Hi,

raingloom <raingloom@riseup.net> writes:

> On Sun, 14 Mar 2021 20:33:06 -0500
> Nathan Dehnel <ncdehnel@gmail.com> wrote:
>
>> This is extremely confusing:
>> https://guix.gnu.org/manual/en/html_node/Btrfs-file-system.html

Hello!  Trying to explain it was a real challenge.  Would you mind
detailing what exactly got you confused?  Hopefully it can be improved.

>> I made my best attempt at creating and mounting a subvolume at
>> /media/offsite-backup:
>>
>>   (file-systems
>>     (cons* (file-system
>>              (mount-point "/")
>>              (device
>>                (uuid "b2e0f449-0583-46fd-8c23-ad2e6cd661a1"
>>                      'btrfs))
>>              (type "btrfs"))
>>            (file-system
>>              (mount-point "/media/offsite-backup")
>>              (device
>>                (uuid "b2e0f449-0583-46fd-8c23-ad2e6cd661a1"
>>                      'btrfs))
>>              (type "btrfs")
>>              (options "subvol=offsite-backup,compress=zlib:9"))
>>
>> It gives this error:
>>
>> building
>> /gnu/store/mrs1qbg619qk4n2lv8k377arclgzwqjq-install-bootloader.scm.drv...
>> guix system: bootloader successfully installed on '/dev/sda' guix
>> system: warning: exception caught while executing 'start' on service
>> 'file-system-/media/offsite-backup': In procedure mount: mount
>> "/dev/sda2" on "///media/offsite-backup": No such file or directory
>> guix system: warning: some services could not be upgraded
>>
>> But /media/offsite-backup exists.

Trying it on my end.

$ blkid
/dev/sda2: UUID="0792432c-78d8-4dcc-87c5-30200c3d02db" TYPE="crypto_LUKS" PARTUUID="b2284a29-5c96-4983-afae-daf1528bb1b2"
/dev/mapper/cryptroot: UUID="2e97fbbd-fa4e-4858-948b-b3a89278a39b" UUID_SUB="7cf6061d-a2d8-4c69-ad34-8d8e31b973cd" TYPE="btrfs"
/dev/sdc: UUID="7bb7e1dd-b0f9-45dc-bf2a-39c6d3a4ee42" TYPE="crypto_LUKS"
/dev/sdb2: UUID="a9aead40-9d01-4f7a-bb83-be70dd192b7b" TYPE="crypto_LUKS" PARTUUID="4bc8deb4-7ad9-524f-ada9-0ef0783c2704"

According to [0], on has to use the UUID rather than the UUID_SUB;
perhaps that's what is causing you problems if you used the UUID_SUB?  I
updated my (working) file system declaration from:

    (file-systems (cons* (file-system
                           (mount-point "/")
                           (device "/dev/mapper/cryptroot")
                           (type "btrfs")
			   (options "compress-force=zstd,space_cache=v2")
			   (dependencies mapped-devices))
                         %base-file-systems))

to

    (file-systems (cons* (file-system
                           (mount-point "/")
                           (device (uuid "2e97fbbd-fa4e-4858-948b-b3a89278a39b"
                                         'btrfs))
                           (type "btrfs")
			   (options "compress-force=zstd,space_cache=v2")
			   (dependencies mapped-devices))
                         %base-file-systems))

reconfigured and reboot.  Granted, I don't currently mount a subvolumes
on this machine.  I do on a second one, I could try it there too if
you're still blocked.

> I'm looking at
> https://wiki.archlinux.org/index.php/Btrfs#Mounting_subvolumes
> and it seems like you either need a numberic ID or an absolute path,
> not a relative one.
> On my machine `findmnt` returns `subvol=/`.

In Guix, you want to use the subvolume name (that's the 'subvol'
option), not the subvolume ID, as Guix relies on the subvolume name to
generate the GRUB configuration.  This is explained in the manual and an
error message with a hint should be displayed when attempting to use
subvolumes with an ID for the root file system.

HTH,

Maxim

[0]  https://www.linux.com/training-tutorials/how-manage-btrfs-storage-pools-subvolumes-and-snapshots-linux-part-1/


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

end of thread, other threads:[~2021-03-20  4:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-15  1:33 How do I specify a btrfs subvolume? Nathan Dehnel
2021-03-17  1:44 ` raingloom
2021-03-18  2:48   ` Maxim Cournoyer

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.