adam900710 / btrfs-fuse

A read-only, license friendly, FUSE based btrfs implementation
Other
26 stars 4 forks source link

Support for btrfs stream files #9

Closed kyak closed 1 year ago

kyak commented 1 year ago

Hi,

Thanks for this project!

btrfs-fuse works fine with BTRFS filesystem images. However, what I have is a "BTRFS stream file" (from btrfs send).

What I usually do is create BTRFS filesystem as a file, mount this file (as root) and do btrfs receive (as root) from BTRFS stream file.

What I try to do now with btrfs-fuse is I mount BTRFS filesystem file using FUSE, but I still have to be root to do btrfs receive, since mount point is owned by root.

Would it be possible to support mounting BTRFS stream files directly?

adam900710 commented 1 year ago

Unfortunately btrfs-send stream is not following btrfs on-disk format.

Furthermore, such stream can be incremental, meaning without the source subvolume, we can not build the destination subvolume.

So in short, it's impossible to support btrfs-send stream in this project.

kyak commented 1 year ago

Thanks for you answer.

Do you know why I cannot specify user ownership on the mount point (it always belongs to root)?

I do this:

btrfs-fuse -o uid=1000 btrfs-image-file.img mount_dir

It says: ERROR: failed to scan device uid=1000: -2

I think if I were able to specify uid for the mountpoint, then btrfs receive without root would work.

adam900710 commented 1 year ago

-o option is not supported thus it treats "uid=1000" as a file name.

btrfs receive won't work, because this project only implements a read-only FUSE. btrfs receive needs to write which is not supported.