All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Matt Zagrabelny <mzagrabe@d.umn.edu>,
	Matthew Warren <matthewwarren101010@gmail.com>
Cc: Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: subvolumes as partitions and mount options
Date: Wed, 29 Mar 2023 07:04:57 +0300	[thread overview]
Message-ID: <65e86175-d73a-3c83-96a2-c38f9abbde8f@gmail.com> (raw)
In-Reply-To: <CAOLfK3Um8uwJyvyn9V4YLAXvv7JDAPF9t6KHDi-Q49XYoZf2Rg@mail.gmail.com>

On 28.03.2023 22:45, Matt Zagrabelny wrote:
> On Mon, Mar 27, 2023 at 8:42 PM Matthew Warren
> <matthewwarren101010@gmail.com> wrote:
>>
>> It looks like you already have it mostly set up correctly. You will
>> want to mount your filesystem somewhere without specifying a
>> subvolume.
> 
> Sure. Things are starting to make a little more sense.
> 
>   Then you can put all the subvolumes you want "hidden" in
>> there. This should be as simple as unomunting /subv_mnt, moving
>> subv_content to the btrfs root subvolume,
> 
> Right. My rootfs is mounted with a subvolume option, so I still can't
> get at the "root" subvolume:
> 
> # mount | grep btrfs
> /dev/nvme0n1p2 on / type btrfs
> (rw,relatime,ssd,space_cache=v2,subvolid=256,subvol=/@rootfs)
> 
> Thusly, I would need to unmount my root partition (presumably through

There is no need for this, multiple subvolumes can be mounted concurrently.

mount -o subvol=/ ...

> a live-cd or equivalent) and then mount:
> 
> mount /dev/nvme0n1p2 /mnt
> 

This depends on what default subvolume is and will not necessarily mount 
the top level of btrfs.

> and create my subvolume:
> 
> btrfs subvolume create /mnt/@foo
> 

"@" is just a convention, there is no magic in it, it is not *needed*.

> then boot back into my system with the regular root fs mount entry in
> /etc/fstab and then I can mount the subvolume as desired:
> 
> mount /dev/nvme0n1p2 /path/to/foo -o subvol=@foo
> 
> It looks like I can mount the root:
> 
> sudo -i
> mkdir /btrfs-fixer
> mount /dev/nvme0n1p2 /btrfs-fixer
> btrfs subvolume create /btrfs-fixer/@foo
> umount /dev/nvme0n1p2
> rm -rf /btrfs-fixer
> mount /dev/nvme0n1p2 /path/to/foo -o subvol=@foo
> 
> Not a bad work-around.
> 
> Thanks for all the help!
> 
> -m


      reply	other threads:[~2023-03-29  4:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27 18:48 subvolumes as partitions and mount options Matt Zagrabelny
2023-03-27 19:25 ` Andrei Borzenkov
2023-03-27 19:50   ` Matt Zagrabelny
2023-03-27 20:24     ` Graham Cobb
2023-03-27 20:31     ` Matthew Warren
2023-03-27 21:06       ` Matt Zagrabelny
2023-03-28  1:42         ` Matthew Warren
2023-03-28 19:45           ` Matt Zagrabelny
2023-03-29  4:04             ` Andrei Borzenkov [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

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

  git send-email \
    --in-reply-to=65e86175-d73a-3c83-96a2-c38f9abbde8f@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=matthewwarren101010@gmail.com \
    --cc=mzagrabe@d.umn.edu \
    /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 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.