On 04/05/2023 18:09, Goffredo Baroncelli wrote: > [...] >> Is there any missing step from my side, or mounting both devices is >> really a limitation when using the forget option? >> > > From my limited BTRFS internal knowledge, I think that your patches > takes the correct approach: using the "metadata_uuid" code to allow > two filesystems with the same uuid to exist at the same time. > > [...] >> How btrfs would know it is a case for single-device filesystem? In other >> words: how would we distinguish between the cases we want to auto-forget >> before mounting, and the cases in which this behavior is undesired? > > If I remember correctly in the super-block there is the number of disks > that compose the filesystem. If the count is 1, it should be safe to > forget-before-mount the filesystem (or to not store in the cache > after a scan) Thanks Goffredo, for the clarifications =)