{"record":{"id":"35a74d390ec96239","repo":"kubernetes/kops","slug":"error-doing-mount-options-q-v-s","errorCode":null,"errorMessage":"error doing mount options %q: %v: %s","messagePattern":"error doing mount options %q: (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/nodeup/nodetasks/bindmount.go","lineNumber":234,"sourceCode":"\t\t\targs = append(args, \"--bind\")\n\t\t}\n\t\tif len(simpleOptions) != 0 {\n\t\t\targs = append(args, \"-o\", strings.Join(simpleOptions, \",\"))\n\t\t}\n\t\targs = append(args, e.Source, e.Mountpoint)\n\n\t\tklog.Infof(\"running mount command %s\", args)\n\t\tif output, err := t.CombinedOutput(args); err != nil {\n\t\t\treturn fmt.Errorf(\"error doing mount %q: %v: %s\", strings.Join(args, \" \"), err, string(output))\n\t\t}\n\t}\n\n\tif len(remountOptions) != 0 {\n\t\targs := []string{\"mount\", \"-o\", \"remount,\" + strings.Join(remountOptions, \",\"), e.Mountpoint}\n\n\t\tklog.Infof(\"running mount command %s\", args)\n\t\tif output, err := t.CombinedOutput(args); err != nil {\n\t\t\treturn fmt.Errorf(\"error doing mount options %q: %v: %s\", strings.Join(args, \" \"), err, string(output))\n\t\t}\n\t}\n\n\tif len(makeOptions) != 0 {\n\t\targs := []string{\"mount\"}\n\t\targs = append(args, makeOptions...)\n\t\targs = append(args, e.Mountpoint)\n\n\t\tklog.Infof(\"running mount command %s\", args)\n\t\tif output, err := t.CombinedOutput(args); err != nil {\n\t\t\treturn fmt.Errorf(\"error doing mount operation %q: %v: %s\", strings.Join(args, \" \"), err, string(output))\n\t\t}\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":216,"sourceCodeEnd":251,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/nodeup/nodetasks/bindmount.go#L216-L251","documentation":"After the initial mount succeeds, execute runs a second `mount -o remount,<options> <mountpoint>` for options requiring remount (exec/noexec/suid/nosuid/dev/nodev). If the remount fails, the args, error and output are wrapped with this message. The initial mount succeeded but its restrictive/fluid options could not be applied.","triggerScenarios":"`mount -o remount,...` returns non-zero — remounting a read-only filesystem with new options, mountpoint vanished, or kernel rejecting the option combination (e.g. nodev on certain fuse/network filesystems).","commonSituations":"Remount options unsupported by the underlying filesystem (e.g. noexec/nosuid on tmpfs variants); racing with another process unmounting the target; container without privileges to remount.","solutions":["Inspect the wrapped output for the specific kernel rejection and drop incompatible options from BindMount.Options","Verify the filesystem type supports the remount options (check `man mount` per-filesystem notes)","Ensure nodeup retains root/CAP_SYS_ADMIN through both mount phases","Check for concurrent processes (kubelet, other nodeup runs) racing on the same mountpoint"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// verify the filesystem supports the remount options\nfstype := detectFsType(mountpoint)\nunsupported := incompatibleRemountOptions(fstype, remountOptions) // e.g. nosuid on some fs\nif len(unsupported) > 0 { return fmt.Errorf(\"options %v unsupported on %s\", unsupported, fstype) }","typeGuard":null,"tryCatchPattern":"out, err := t.CombinedOutput(args)\nif err != nil {\n  return fmt.Errorf(\"error doing mount options %q: %v: %s\", strings.Join(args, \" \"), err, string(out))\n}\n// treat kernel rejection output as the source of truth for which option to drop","preventionTips":["Only include remount options the target filesystem supports","Avoid concurrent mount/unmount of the same mountpoint during bootstrap","Keep nodeup privileged for the full mount+remount sequence","Test mount options on your node image before rolling cluster-wide"],"tags":["mount","linux","nodeup"],"backgroundTag":"remount-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}