{"record":{"id":"4952060592c052b4","repo":"containerd/containerd","slug":"s-does-not-support-d-type-if-the-backing-filesys","errorCode":null,"errorMessage":"%s does not support d_type. If the backing filesystem is xfs, please reformat with ftype=1 to enable d_type support","messagePattern":"(.+?) does not support d_type\\. If the backing filesystem is xfs, please reformat with ftype=1 to enable d_type support","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"plugins/snapshots/overlay/overlay.go","lineNumber":137,"sourceCode":"// diffs are stored under the provided root. A metadata file is stored under\n// the root.\nfunc NewSnapshotter(root string, opts ...Opt) (snapshots.Snapshotter, error) {\n\tvar config SnapshotterConfig\n\tfor _, opt := range opts {\n\t\tif err := opt(&config); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif err := os.MkdirAll(root, 0700); err != nil {\n\t\treturn nil, err\n\t}\n\tsupportsDType, err := fs.SupportsDType(root)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !supportsDType {\n\t\treturn nil, fmt.Errorf(\"%s does not support d_type. If the backing filesystem is xfs, please reformat with ftype=1 to enable d_type support\", root)\n\t}\n\tif config.ms == nil {\n\t\tconfig.ms, err = storage.NewMetaStore(filepath.Join(root, \"metadata.db\"))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif err := os.Mkdir(filepath.Join(root, \"snapshots\"), 0700); err != nil && !os.IsExist(err) {\n\t\treturn nil, err\n\t}\n\n\tif !hasOption(config.mountOptions, \"userxattr\") {\n\t\t// figure out whether \"userxattr\" option is recognized by the kernel && needed\n\t\tuserxattr, err := overlayutils.NeedsUserXAttr(root)\n\t\tif err != nil {\n\t\t\tlog.L.WithError(err).Warnf(\"cannot detect whether \\\"userxattr\\\" option needs to be used, assuming to be %v\", userxattr)\n\t\t}","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/containerd/containerd/blob/4246446a2bf7d03837b0244118d858799393bd80/plugins/snapshots/overlay/overlay.go#L119-L155","documentation":"NewSnapshotter refuses to start the overlayfs snapshotter when the backing filesystem of the given root does not support d_type in readdir results. overlayfs requires d_type; without it, overlay mounts will fail at runtime, so construction fails fast. The message specifically calls out xfs formatted without ftype=1.","triggerScenarios":"Calling overlay.NewSnapshotter(root) (plugins/snapshots/overlay/overlay.go:137) where root resides on xfs with ftype=0, or another filesystem lacking d_type (some older ext4/SD cards, certain tmpfs configurations). fs.SupportsDType returned false.","commonSituations":"Docker/containerd data-root placed on an xfs volume formatted with ftype=0 (common with old mkfs defaults or some RHEL hosts); running containers on /var/lib mounted from such a volume; ARM boards with d_type-less filesystems.","solutions":["Reformat the backing xfs filesystem with ftype=1: mkfs.xfs -n ftype=1 /dev/<dev> (requires unmounting and migrating data)","Move containerd/docker root (e.g. /var/lib/containerd) to a filesystem that supports d_type","Verify with 'xfs_info <mount> | grep ftype' — ftype=0 confirms the diagnosis","As a fallback use a different snapshotter (e.g. native) which does not require d_type"],"exampleFix":"// before\nmkfs.xfs /dev/sdb1\n// after\nmkfs.xfs -n ftype=1 /dev/sdb1","handlingStrategy":"validation","validationCode":"// Go: check d_type support before constructing the snapshotter\nsupportsDType, err := fs.SupportsDType(root)\nif err != nil || !supportsDType {\n    return errors.New(\"backing filesystem does not support d_type; reformat xfs with ftype=1\")\n}\nsn, err := overlay.NewSnapshotter(root)","typeGuard":null,"tryCatchPattern":"sn, err := overlay.NewSnapshotter(root)\nif err != nil {\n    if strings.Contains(err.Error(), \"does not support d_type\") {\n        return fmt.Errorf(\"reformat %s with ftype=1 or use another FS/snapshotter: %w\", root, err)\n    }\n    return err\n}","preventionTips":["Format xfs volumes with mkfs.xfs -n ftype=1","Verify with 'xfs_info <mount> | grep ftype' before pointing the data-root at it","Place /var/lib/containerd on ext4 or d_type-capable xfs","Provisioning scripts should test fs.SupportsDType on the target root at setup time"],"tags":["overlayfs","filesystem","xfs","dtype","containerd"],"backgroundTag":"filesystem-no-dtype-support","analyzedSha":"4246446a2bf7d03837b0244118d858799393bd80","analyzedAt":"2026-09-02T00:14:43.053Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}