{"record":{"id":"8e0dfde5dfa40430","repo":"juicedata/juicefs","slug":"the-target-volume-will-be-permanently-destroyed-i","errorCode":null,"errorMessage":"The target volume will be permanently destroyed, including:","messagePattern":"The target volume will be permanently destroyed, including:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/destroy.go","lineNumber":153,"sourceCode":"\t\tif err != nil {\n\t\t\tlogger.Fatalf(\"list sessions: %s\", err)\n\t\t}\n\t\tif num := len(sessions); num > 0 {\n\t\t\tss := make([][3]string, num)\n\t\t\tfor i, s := range sessions {\n\t\t\t\tss[i] = [3]string{strconv.FormatUint(s.Sid, 10), s.HostName, s.MountPoint}\n\t\t\t}\n\t\t\tlogger.Fatalf(\"%d sessions are active, please disconnect them first:\\n%s\", num, printSessions(ss))\n\t\t}\n\t\tvar totalSpace, availSpace, iused, iavail uint64\n\t\t_ = m.StatFS(meta.Background(), meta.RootInode, &totalSpace, &availSpace, &iused, &iavail)\n\n\t\tfmt.Printf(\" volume name: %s\\n\", format.Name)\n\t\tfmt.Printf(\" volume UUID: %s\\n\", format.UUID)\n\t\tfmt.Printf(\"data storage: %s\\n\", blob)\n\t\tfmt.Printf(\"  used bytes: %d\\n\", totalSpace-availSpace)\n\t\tfmt.Printf(\" used inodes: %d\\n\", iused)\n\t\twarn(\"The target volume will be permanently destroyed, including:\")\n\t\twarn(\"1. ALL objects in the data storage: %s\", blob)\n\t\twarn(\"2. ALL entries in the metadata engine: %s\", utils.RemovePassword(uri))\n\t\tif !ctx.Bool(\"yes\") && !userConfirmed() {\n\t\t\tlogger.Fatalln(\"Aborted.\")\n\t\t}\n\t}\n\n\tobjs, err := object.ListAll(ctx.Context, blob, \"\", \"\", true, false)\n\tif err != nil && strings.Contains(err.Error(), \"NoSuchBucket\") {\n\t\tif !ctx.Bool(\"force\") {\n\t\t\tlogger.Fatalf(\"data storage %s does not exist (error: %v); retry with \\\"--force\\\" to skip object deletion\", blob, err)\n\t\t}\n\t\tlogger.Warnf(\"data storage %s does not exist (error: %v); will skip object deletion\", blob, err)\n\t} else {\n\t\tif err != nil {\n\t\t\tlogger.Fatalf(\"list all objects: %s\", err)\n\t\t}\n\t\tprogress := utils.NewProgress(false)","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/cmd/destroy.go#L135-L171","documentation":"The 'juicefs destroy' command prints a final warning that the target volume will be permanently destroyed before asking for confirmation. Destruction removes all objects in the object storage and all metadata records; it cannot be undone.","triggerScenarios":"Running 'juicefs destroy META UUID' for a volume; the warning appears after printing volume name/UUID/storage/usage and before userConfirmed() unless --yes is passed.","commonSituations":"Decommissioning test volumes; cleaning up abandoned volumes after failed experiments; accidentally targeting a production volume by copying the wrong UUID or metadata URL.","solutions":["Verify the volume name, UUID, and metadata URI shown before confirming","Use --yes only in scripted, verified teardown flows","Ensure all clients are unmounted ('juicefs status META' to list sessions) before destroying","Back up metadata ('juicefs dump') if any chance of recovery is desired"],"exampleFix":"// before\njuicefs destroy sqlite3://test.db e59df596-....\n// after (explicit confirmation, no interactive prompt)\njuicefs destroy --yes sqlite3://test.db e59df596-....  # only after verifying UUID","handlingStrategy":"validation","validationCode":"st, _ := juicefsStatus(metaURI)\nif st.Name != expectedName || st.UUID != expectedUUID { abort() }","typeGuard":null,"tryCatchPattern":"cmd := exec.Command(\"juicefs\", \"destroy\", meta, uuid)\nout, err := cmd.CombinedOutput()\nif err != nil || strings.Contains(string(out), \"Aborted\") { /* not destroyed */ }","preventionTips":["Always verify volume UUID/name before destroying","Use --yes only in verified automation","Dump metadata as a backup before destruction","Unmount all clients first"],"tags":["cli","destructive","data-loss"],"backgroundTag":"destructive-operation-confirmation","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"}