juicedata/juicefs · warning

New quota is too small (used / quota): %d / %d bytes, %d / %

Error message

New quota is too small (used / quota): %d / %d bytes, %d / %d inodes.

What it means

During 'juicefs config' with a capacity/inodes quota change, the CLI warns that the new quota is smaller than the space or inodes currently used. It compares usedSpace (from StatFS) against format.Capacity and iused against format.Inodes, and prompts for confirmation before applying, since the volume will immediately appear full.

Source

Thrown at cmd/config.go:465

	if !ctx.Bool("force") {
		yes := ctx.Bool("yes")
		if storage || tier {
			blob, err := createStorage(*format)
			if err != nil {
				return err
			}
			if err = test(context.WithValue(context.Background(), object.TierKey{}, targetTierID), blob); err != nil {
				return err
			}
		}
		if quota {
			var totalSpace, availSpace, iused, iavail uint64
			_ = m.StatFS(meta.Background(), meta.RootInode, &totalSpace, &availSpace, &iused, &iavail)
			usedSpace := totalSpace - availSpace
			if format.Capacity > 0 && usedSpace >= format.Capacity ||
				format.Inodes > 0 && iused >= format.Inodes {
				warn("New quota is too small (used / quota): %d / %d bytes, %d / %d inodes.",
					usedSpace, format.Capacity, iused, format.Inodes)
				if !yes && !userConfirmed() {
					return fmt.Errorf("Aborted.")
				}
			}
		}
		if trash && format.TrashDays == 0 {
			warn("The current trash will be emptied and future removed files will purged immediately.")
			if !yes && !userConfirmed() {
				return fmt.Errorf("Aborted.")
			}
		}
		if originDirStats && !format.DirStats {
			qs := make(map[string]*meta.Quota)
			err := m.HandleQuota(meta.Background(), meta.QuotaList, "", meta.DirQuotaType, qs, false, false, false)
			if err != nil {
				return errors.Wrap(err, "list quotas")
			}

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Increase --capacity/--inodes to a value above current usage (run 'juicefs info' or check metrics for used space/inodes)
  2. Free space or delete files before shrinking the quota
  3. If intentional, re-run with --yes to confirm the smaller quota

Example fix

// before
juicefs config sqlite3://test.db --capacity 1
// after (value above used space)
juicefs config sqlite3://test.db --capacity 107374182400
Defensive patterns

Strategy: validation

Validate before calling

used, iused := statVolume(meta) // via StatFS
if capacity > 0 && used >= capacity || inodes > 0 && iused >= inodes {
	// grow quota or free space before running juicefs config
}

Try / catch

err := configCmd.Run()
if err != nil && strings.Contains(err.Error(), "Aborted") { /* prompt declined: adjust values */ }

Prevention

When it happens

Trigger: Running 'juicefs config META --capacity <smaller>' or '--inodes <smaller>' where used bytes >= new capacity or used inodes >= new inodes, and the --yes flag is not set.

Common situations: Shrinking a volume after data growth; typo in the capacity value (e.g. setting 1 TiB instead of 10 TiB); cleaning up quotas on a nearly full volume.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of juicedata/juicefs@c9a67b23e8 (2026-09-06). Data as JSON: /api/errors/9eddc02abf2698df. Report an issue: GitHub.