NDCTL-CLEAR-ERRORS(1)

πŸ’– NDCTL-CLEAR-ERRORS πŸ’–

okay bestie, so this is a page from the ndctl manual, and it's about the ndctl clear-errors command. sit down, hydrate, and let's get into it 🫢


✨ NAME ✨

ndctl-clear-errors β€” clears, like, all the errors (a.k.a. badblocks) on the namespace you point at. every single one. periodt πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

ndctl clear-errors <namespace> [<options>]

🌸 DESCRIPTION 🌸

so a namespace can have one or more media errors, right? and those errors might be ones the kernel already knows about, or they might be lurking in a latent state like a little secret πŸ™ˆ. these error locations β€” we call them badblocks β€” can cause poison consumption events if something reads them in an unsafe manner. and no, that's not a vibe, that's a whole machine check situation πŸ’€

also, these badblocks are basically the universe telling you that due to media corruption, whatever data used to be in those locations is unrecoverably lost. gone gone. not coming back. 😭

normally, when errors show up, the admin is expected to recover the data from out-of-band means (think: backups, bestie), destroy the namespace, recreate it, and then restore the data. and the cute part is β€” once the data gets re-written, those writes will allow any errors to be cleared as they're encountered. so in that whole workflow, you should never need to use the clear-errors command at all. iconic of you for not needing it honestly πŸ‘‘

however β€” and this is the plot twist β€” there are special use cases where the data currently on the namespace just... doesn't matter. for example, if a devdax mode namespace is being prepped for use as system-ram. in cases like that, it may be desirable to clear any errors on the namespace before switching its mode, so you can prevent disruptive machine checks due to poison consumption. chef's kiss, prevention 🧚

Note Only use this command when the data on the namespace is immaterial. For any blocks that get cleared via this command, any data on the blocks in question will be lost, and replaced with content that is implementation (platform) defined, and unpredictable.
Warning This is a DANGEROUS command, and should only be used after fully understanding its implications and consequences. This WILL erase your data. like. fully. no takebacks. 🚨

so for namespaces in one of fsdax or devdax modes, this command will only consider the data area for error clearing. namespace metadata β€” stuff like info-blocks β€” will not be touched. untouched. protected. we respect it πŸ’œ

for namespaces in raw mode, the full available capacity of the namespace is considered for error clearing. and namespaces in sector mode? not supported, and they'll be skipped. sorry bestie, not every namespace gets an invite to this party πŸŽ€

Note It is expected that the command is run with the namespace enabled. A namespace in the disabled state will appear as, and will be treated as, a raw namespace, and error clearing will be performed for the full available capacity of the namespace, including any potential metadata areas. If there happen to be errors in the metadata area, clearing them may result in unpredictable outcomes. You have been warned! 😳

okay so let's talk known errors vs latent errors, because this is the lore πŸ“

Known errors are ones the kernel has encountered before β€” either via a previous scrub, or by an attempted read from those locations. you can list these by running ndctl list --media-errors for a given namespace.

Latent errors, as the name indicates (the name is very much indicating), are unknown to the kernel. you find these by running a scrub operation on the NVDIMMs in question.

by default, the ndctl-clear-errors command only clears known errors. this can be overridden using the --scrub option to clear all errors. slay, options πŸ”₯

Note If a scrub is in progress when the command is called, it will unconditionally wait for it to complete. no cutting the line, babe πŸ’…

🌈 EXAMPLES 🌈

Clear errors on namespace 0.0:

ndctl clear-errors namespace0.0

Clear errors on all namespaces belonging to region1, including scrubbing for latent errors:

ndctl clear-errors --scrub --region=region1 all

look at that. beautiful. clean. we love to see it ✨


πŸŽ€ OPTIONS πŸŽ€

  • -s, --scrub β€” Perform a scrub on the bus prior to clearing errors. This allows for the clearing of any latent media errors in addition to errors the kernel already knows about.
Note This will cause the command to start and wait for a full scrub, and this can potentially be a very long-running operation. like, go make a snack, bestie πŸ“
  • -v, --verbose β€” Emit debug messages. spill the tea, command β˜•
  • -r, --region= β€” A regionX device name, or a region id number. Restrict the operation to the specified region(s). The keyword all can be specified to indicate the lack of any restriction, however this is the same as not supplying a --region option at all.
  • -b, --bus= β€” A bus id number, or a provider string (e.g. "ACPI.NFIT"). Restrict the operation to the specified bus(es). The keyword all can be specified to indicate the lack of any restriction, however this is the same as not supplying a --bus option at all.

Copyright Β© 2016 - 2022, Intel Corporation. License GPLv2: GNU GPL version 2 http://gnu.org/licenses/gpl.html. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.


πŸ’œ SEE ALSO πŸ’œ

ndctl-start-scrub(1), ndctl-list(1)

go read those too, i'm obsessed with them fr fr 🌟


and that's the whole page, bestie! this one came from the ndctl manual, dated 2026-07-07, and the source line is just ndctl β€” that's the whole signature. mwah, go clear some errors responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from