MDStat parses an mdstat-file (/proc/mdstat) and returns a slice of structs containing the relevant info. More information available here: https://raid.wiki.kernel.org/index.php/Mdstat
()
| 87 | // structs containing the relevant info. More information available here: |
| 88 | // https://raid.wiki.kernel.org/index.php/Mdstat |
| 89 | func (fs FS) MDStat() ([]MDStat, error) { |
| 90 | data, err := os.ReadFile(fs.proc.Path("mdstat")) |
| 91 | if err != nil { |
| 92 | return nil, err |
| 93 | } |
| 94 | mdstat, err := parseMDStat(data) |
| 95 | if err != nil { |
| 96 | return nil, fmt.Errorf("%w: Cannot parse %v: %w", ErrFileParse, fs.proc.Path("mdstat"), err) |
| 97 | } |
| 98 | return mdstat, nil |
| 99 | } |
| 100 | |
| 101 | // parseMDStat parses data from mdstat file (/proc/mdstat) and returns a slice of |
| 102 | // structs containing the relevant info. |