diff --git a/src/repart/repart.c b/src/repart/repart.c index dbf261bb26..456aed41bd 100644 --- a/src/repart/repart.c +++ b/src/repart/repart.c @@ -6785,7 +6785,8 @@ static int context_mkfs(Context *context) { * have to populate using the filesystem's mkfs's --root= (or equivalent) option. To do that, * we need to set up the final directory tree beforehand. */ - if (partition_needs_populate(p) && (!t->loop || fstype_is_ro(p->format))) { + if (partition_needs_populate(p) && + (!t->loop || fstype_is_ro(p->format) || (streq_ptr(p->format, "btrfs") && p->compression))) { if (!mkfs_supports_root_option(p->format)) return log_error_errno(SYNTHETIC_ERRNO(ENODEV), "Loop device access is required to populate %s filesystems.", @@ -8533,7 +8534,7 @@ static int context_minimize(Context *context) { return r; } - if (!d || fstype_is_ro(p->format)) { + if (!d || fstype_is_ro(p->format) || (streq_ptr(p->format, "btrfs") && p->compression)) { if (!mkfs_supports_root_option(p->format)) return log_error_errno(SYNTHETIC_ERRNO(ENODEV), "Loop device access is required to populate %s filesystems.",