linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Austin S. Hemmelgarn" <ahferroin7@gmail.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: rsync -ax and subvolumes
Date: Fri, 11 Oct 2019 07:32:07 -0400	[thread overview]
Message-ID: <760c52db-34f4-3c84-c073-291a428ee475@gmail.com> (raw)
In-Reply-To: <20191010212133.GA3648@tik.uni-stuttgart.de>

On 2019-10-10 17:21, Ulli Horlacher wrote:
> On Thu 2019-10-10 (20:47), Kai Krakow wrote:
> 
>>> I run into the problem that "rsync -ax" sees btrfs subvolumes as "other
>>> filesystems" and ignores them.
>>
>> I worked around it by mounting the btrfs-pool at a special directory:
>>
>> mount -o subvolid=0 /dev/disk/by-label/rootfs /mnt/btrfs-pool
> 
> This is only possible by root, but not by regular users.
> Yes, there are true multi-user systems still out there :-)
And that is what `sudo` or capabilities are for.

`sudo` will even let you get as specific as command line arguments, so 
you can specify an exact mount command that can be run (including 
ensuring that it's read-only) and an exact unmount command that can be run.

If you want to go the capabilities route, you'll need CAP_MOUNT.  This 
is a lot riskier than using `sudo` though.

That said, if you really want _everything_, you're going to need to 
either be root anyway, or have the CAP_DAC_READ_SEARCH (or 
CAP_DAC_OVERRIDE) capability, because there are some files you just 
won't be able to read otherwise (at minimum the contents of `/root` and 
any properly secured authentication logs in `/var/log`, as well as 
possibly other things under `/var` and possibly some things under `/etc`).
> 
> 
>> Actually, you could also just bind-mount into /mnt/btrfs, bind-mounts
>> won't inherit other mounts but will still see pure subvolumes.
> 
> Again, only possible by root.
> 


  reply	other threads:[~2019-10-11 11:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10 17:20 rsync -ax and subvolumes Ulli Horlacher
2019-10-10 18:47 ` Kai Krakow
2019-10-10 21:21   ` Ulli Horlacher
2019-10-11 11:32     ` Austin S. Hemmelgarn [this message]
2019-10-11  6:15   ` Ulli Horlacher
2019-10-11 18:17     ` Andrei Borzenkov
2019-10-16 19:07     ` Kai Krakow

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=760c52db-34f4-3c84-c073-291a428ee475@gmail.com \
    --to=ahferroin7@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 NNTP newsgroup(s).