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

FS#2043 - mdadm files/mdadm.config should ship with an empty config array #6919

Open
openwrt-bot opened this issue Jan 3, 2019 · 7 comments
Labels

Comments

@openwrt-bot
Copy link

josephtingiris:

Supply the following if possible:

  • Device problem occurs on

specifically tested & confirmed on x86-64 and ipq806x

  • Software versions of OpenWrt/LEDE release, packages, etc.

18.06.1 and snapshot

  • Steps to reproduce

opkg install mdadm

@openwrt-bot
Copy link
Author

josephtingiris:

As seen, here: https://github.com/openwrt/openwrt/blob/openwrt-18.06/package/utils/mdadm/files/mdadm.config

If a new /dev/md0 is created then the first boot fails with the package as-is. Little documentation exists to point a user in the right direction to correct the issue.

The mdadm.config that's shipped in 18.06.01 (and current snapshot) gets installed as /etc/config/mdadm with a defunct /dev/md0 uuid. Newly created devices named /dev/md0 will not have that uuid and extra steps are required to achieve a functional boot. One could either update via uci set or remove it and add the correct uuid of the linux_raid_members.

@openwrt-bot
Copy link
Author

jow-:

Did you test whether simply commenting out the uuid works?

@openwrt-bot
Copy link
Author

josephtingiris:

Additionally, an /etc/mdadm/config as follows fails to start the 'correct' uuid if both arrays use the same device. In my case, the second uuid is valid but the first is not.

config mdadm option email 'root'

config array
option device '/dev/md0'
option uuid '991d8863-9158-46ab-aa4f-755e8c2d3219'

config array
option device '/dev/md0'
option uuid 'e0b635e1-3a4f-d2db-e9ff-1ae2052cd032'

I've written a workaround init script, that runs prior to the existing /etc/init.d/mdadm, that works for me. It corrects the config prior to mdadm starting. Attached for your consideration to include in future packages, or integrate similar logic in /etc/init.d/mdadm.

@openwrt-bot
Copy link
Author

josephtingiris:

@Jo-Philipp Wich; yes and no. Replacing the uuid with the correct one works as expected. However, commenting out the uuid triggers another warning and the device still fails to mount. The correct uuid must be known.

@openwrt-bot
Copy link
Author

jow-:

Uhm, so the config needs editing either way. I can simply comment out the array settings by default but that wouldn't really solve the issue you raised here, /etc/config/mdadm would still need editing and not work ootb.

@openwrt-bot
Copy link
Author

josephtingiris:

I've created a PR on github that addresses both issues (for me).

  1. config comments
  2. automatic detection & updating /etc/config/mdadm prior to starting mdadm

#1713

@openwrt-bot
Copy link
Author

jow-:

I will comment out the config by default but auto-setup is out of the scope of the package.

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

No branches or pull requests

1 participant