{"record":{"id":"9eddc02abf2698df","repo":"juicedata/juicefs","slug":"new-quota-is-too-small-used-quota-d-d-byt","errorCode":null,"errorMessage":"New quota is too small (used / quota): %d / %d bytes, %d / %d inodes.","messagePattern":"New quota is too small \\(used / quota\\): (.+?) / (.+?) bytes, (.+?) / (.+?) inodes\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/config.go","lineNumber":465,"sourceCode":"\n\tif !ctx.Bool(\"force\") {\n\t\tyes := ctx.Bool(\"yes\")\n\t\tif storage || tier {\n\t\t\tblob, err := createStorage(*format)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err = test(context.WithValue(context.Background(), object.TierKey{}, targetTierID), blob); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif quota {\n\t\t\tvar totalSpace, availSpace, iused, iavail uint64\n\t\t\t_ = m.StatFS(meta.Background(), meta.RootInode, &totalSpace, &availSpace, &iused, &iavail)\n\t\t\tusedSpace := totalSpace - availSpace\n\t\t\tif format.Capacity > 0 && usedSpace >= format.Capacity ||\n\t\t\t\tformat.Inodes > 0 && iused >= format.Inodes {\n\t\t\t\twarn(\"New quota is too small (used / quota): %d / %d bytes, %d / %d inodes.\",\n\t\t\t\t\tusedSpace, format.Capacity, iused, format.Inodes)\n\t\t\t\tif !yes && !userConfirmed() {\n\t\t\t\t\treturn fmt.Errorf(\"Aborted.\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif trash && format.TrashDays == 0 {\n\t\t\twarn(\"The current trash will be emptied and future removed files will purged immediately.\")\n\t\t\tif !yes && !userConfirmed() {\n\t\t\t\treturn fmt.Errorf(\"Aborted.\")\n\t\t\t}\n\t\t}\n\t\tif originDirStats && !format.DirStats {\n\t\t\tqs := make(map[string]*meta.Quota)\n\t\t\terr := m.HandleQuota(meta.Background(), meta.QuotaList, \"\", meta.DirQuotaType, qs, false, false, false)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"list quotas\")\n\t\t\t}","sourceCodeStart":447,"sourceCodeEnd":483,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/cmd/config.go#L447-L483","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Increase --capacity/--inodes to a value above current usage (run 'juicefs info' or check metrics for used space/inodes)","Free space or delete files before shrinking the quota","If intentional, re-run with --yes to confirm the smaller quota"],"exampleFix":"// before\njuicefs config sqlite3://test.db --capacity 1\n// after (value above used space)\njuicefs config sqlite3://test.db --capacity 107374182400","handlingStrategy":"validation","validationCode":"used, iused := statVolume(meta) // via StatFS\nif capacity > 0 && used >= capacity || inodes > 0 && iused >= inodes {\n\t// grow quota or free space before running juicefs config\n}","typeGuard":null,"tryCatchPattern":"err := configCmd.Run()\nif err != nil && strings.Contains(err.Error(), \"Aborted\") { /* prompt declined: adjust values */ }","preventionTips":["Check current usage with 'juicefs info' or StatFS before resizing quotas","Never set capacity/inodes below current used values","Scripted changes should pass --yes only after computing usage programmatically"],"tags":["cli","quota","config"],"backgroundTag":"invalid-config-value","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}