1NDCTL-CLEAR-ERRORS(1) ndctl Manual NDCTL-CLEAR-ERRORS(1)
2
3
4
6 ndctl-clear-errors - clear all errors (badblocks) on the given
7 namespace
8
10 ndctl clear-errors <namespace> [<options>]
11
13 A namespace may have one or more media errors, either known to the
14 kernel or in a latent state. These error locations, or badblocks can
15 cause poison consumption events if read in an unsafe manner.
16
17 Moreover, these badblocks also indicate that due to media corruption,
18 any data that may have been in these locations has been unrecoverably
19 lost.
20
21 Normally, in the presence of such errors, the administrator is expected
22 to recover the data from out of band means (such as backups), destroy
23 the namespace, recreate it, and then restore the data. When the data is
24 re-written, the writes will allow any errors to be cleared as they are
25 encountered. In such a workflow, one should never need to use the
26 clear-errors command.
27
28 However, there may be special use cases, where the data currently on
29 the namespace does not matter - for example, if a devdax mode namespace
30 is being prepared for use as system-ram. In such cases, it may be
31 desirable to clear any errors on the namespace prior to switching its
32 mode to prevent disruptive machine checks due to poison consumption.
33
34 Note
35 Only use this command when the data on the namespace is immaterial.
36 For any blocks that are cleared via this command, any data on the
37 blocks in question will be lost, and replaced with content that is
38 implementation (platform) defined, and unpredictable.
39
40 Warning
41 This is a DANGEROUS command, and should only be used after fully
42 understanding its implications and consequences. This WILL erase
43 your data.
44
45 For namespaces in one of fsdax or devdax modes, this command will only
46 consider the data area for error clearing. Namespace metadata, such as
47 info-blocks, will not be touched. For namespaces in raw mode, the full
48 available capacity of the namespace is considered for error clearing.
49 Namespaces that are in sector mode are not supported, and will be
50 skipped.
51
52 Note
53 It is expected that the command is run with the namespace enabled.
54 A namespace in the disabled state will appear as, and will be
55 treated as a raw namespace, and error clearing will be performed
56 for the full available capacity of the namespace, including any
57 potential metadata areas. If there happen to be errors in the
58 metadata area, clearing them may result in unpredictable outcomes.
59 You have been warned!
60
61 Known errors are ones that the kernel has encountered before, either
62 via a previous scrub, or by an attempted read from those locations.
63 These can be listed by running ndctl list --media-errors for a given
64 namespace. Latent errors, as the name indicates, are unknown to the
65 kernel. These can be found by running a scrub operation on the NVDIMMs
66 in question. By default, the ndctl-clear-errors command only clears
67 known errors. This can be overridden using the --scrub option to clear
68 all errors.
69
70 Note
71 If a scrub is in progress when the command is called, it will
72 unconditionally wait for it to complete.
73
75 Clear errors on namespace 0.0
76
77
78 ndctl clear-errors namespace0.0
79
80 Clear errors on all namespaces belonging to region1, including
81 scrubbing for latent errors
82
83
84 ndctl clear-errors --scrub --region=region1 all
85
87 -s, --scrub
88 Perform a scrub on the bus prior to clearing errors. This allows
89 for the clearing of any latent media errors in addition to errors
90 the kernel already knows about.
91
92 Note
93 This will cause the command to start and wait for a full scrub, and
94 this can potentially be a very long-running operation.
95
96 -v, --verbose
97 Emit debug messages.
98
99 -r, --region=
100 A regionX device name, or a region id number. Restrict the
101 operation to the specified region(s). The keyword all can be
102 specified to indicate the lack of any restriction, however this is
103 the same as not supplying a --region option at all.
104
105 -b, --bus=
106 A bus id number, or a provider string (e.g. "ACPI.NFIT"). Restrict
107 the operation to the specified bus(es). The keyword all can be
108 specified to indicate the lack of any restriction, however this is
109 the same as not supplying a --bus option at all.
110
112 Copyright (c) 2016 - 2019, Intel Corporation. License GPLv2: GNU GPL
113 version 2 http://gnu.org/licenses/gpl.html. This is free software: you
114 are free to change and redistribute it. There is NO WARRANTY, to the
115 extent permitted by law.
116
118 ndctl-start-scrub(1), ndctl-list(1)
119
120
121
122ndctl 2020-03-24 NDCTL-CLEAR-ERRORS(1)