@@ -329,8 +329,7 @@ static struct opt_params dopts = {
},
.subopt_params = {
{ .index = D_AGCOUNT,
- .conflicts = { { &dopts, D_AGSIZE },
- { &dopts, D_CONCURRENCY },
+ .conflicts = { { &dopts, D_CONCURRENCY },
{ NULL, LAST_CONFLICT } },
.minval = 1,
.maxval = XFS_MAX_AGNUMBER,
@@ -372,8 +371,7 @@ static struct opt_params dopts = {
.defaultval = SUBOPT_NEEDS_VAL,
},
{ .index = D_AGSIZE,
- .conflicts = { { &dopts, D_AGCOUNT },
- { &dopts, D_CONCURRENCY },
+ .conflicts = { { &dopts, D_CONCURRENCY },
{ NULL, LAST_CONFLICT } },
.convert = true,
.minval = XFS_AG_MIN_BYTES,
@@ -1264,7 +1262,7 @@ validate_ag_geometry(
usage();
}
- if (agsize > dblocks) {
+ if (agsize > dblocks && agcount != 1) {
fprintf(stderr,
_("agsize (%lld blocks) too big, data area is %lld blocks\n"),
(long long)agsize, (long long)dblocks);
@@ -2812,12 +2810,20 @@ validate_supported(
/*
* Filesystems should not have fewer than two AGs, because we need to
- * have redundant superblocks.
+ * have redundant superblocks. The exception is filesystem image files
+ * that are intended to be grown on deployment before production use.
+ *
+ * A single AG provides more flexibility to grow the filesystem because
+ * the AG size can be grown until a second AG is added. This helps
+ * prevent tiny image filesystems being grown to unwieldy AG counts.
*/
if (mp->m_sb.sb_agcount < 2) {
fprintf(stderr,
- _("Filesystem must have at least 2 superblocks for redundancy!\n"));
- usage();
+ _("Filesystem must have at least 2 superblocks for redundancy.\n"));
+ if (!cli->xi->data.isfile)
+ usage();
+ fprintf(stderr,
+ _("Proceeding for image file, grow before use.\n"));
}
}