unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: raingloom <raingloom@riseup.net>
Cc: help-guix@gnu.org
Subject: Re: How do I specify a btrfs subvolume?
Date: Wed, 17 Mar 2021 22:48:08 -0400	[thread overview]
Message-ID: <87tup6bfje.fsf@gmail.com> (raw)
In-Reply-To: 20210317024425.5b6cb1de@riseup.net

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/


      reply	other threads:[~2021-03-20  4:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tup6bfje.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=help-guix@gnu.org \
    --cc=raingloom@riseup.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).