Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[linux-md] vfs.md.level breaks when auto-read-only comes up #11

Open
charlesgoyard opened this issue Aug 29, 2019 · 0 comments
Open

[linux-md] vfs.md.level breaks when auto-read-only comes up #11

charlesgoyard opened this issue Aug 29, 2019 · 0 comments

Comments

@charlesgoyard
Copy link

Hi,
when /proc/mdstat contains the following the (auto-read-only) flag, the vfs.md.level item breaks.

Personalities : [raid1] [raid6] [raid5] [raid4]
md0 : active (auto-read-only) raid1 sdb1[0] sdc1[1]
      9767424 blocks [2/2] [UU]

md1 : active raid5 sda6[0] sdf6[5] sde6[4] sdd6[3] sdc6[2] sdb6[1]
      1357371520 blocks level 5, 64k chunk, algorithm 2 [6/6] [UUUUUU]

unused devices: <none>

These expressions work:

UserParameter=vfs.md.level[*], sed -n -r -e "s/^$1 *:.* raid([[:digit:]]+).*$/\1/p" /proc/mdstat
UserParameter=vfs.md.level[*], grep "^$1 *:" /proc/mdstat | grep -o 'raid[0-9][0-9]*' | grep -o '[0-9]'

Thanks,
Charles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant