On Thu, Apr 30, 2020 at 12:44 PM Saravanan Shanmugham (sarvi) <sarvi@xxxxxxxxx> wrote: > > I have a problem that needs solving and I am trying to understand if BTRFS can solve it. > > I have diskimage(currently using ext4). And I am considering btrfs for, > Lets call this filesystemA > This contains a software build tree done by userA and hence all files are owned by userA > > I want an almost instantaneous way to create or copy or clone or seed a new filesystem or directory tree filesystem B, with all the content in filesystem A but is owned by userB > > Question: > 1. if I created fileSystemA in btrfs and used it as a seed device in creating filesystem B, What file ownership does the filesystem B have? You mean unix owner and group? It will still be userA. The only thing that changes when making a sprout file system is the volume and device UUIDs. > 2. Can that be changed to userB with any option. Yes, you can use chown. The seed is not changed, just the sprout (the read write device). > 3. What happens when userB tries to modify a fileX on filesystemB that was seeded with filesystemA and has fileX owned by userA userB needs permission to make the change, unix owner or group or ACL, same as any file. > 3. I understand btrfs supports snapshots and clones. Does the cloned volume and all its files keep the original owners as in the original volume/snapshot, or can it be specified as part of the cloning process. It's unchanged, you can change it before or after removing the seed device. -- Chris Murphy
