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

fix(mdraid): try to assemble the missing raid device (bsc#1226412) #344

Merged
merged 2 commits into from
Jun 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions modules.d/90mdraid/mdraid_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ _md_force_run() {
local _md
local _UUID
local _MD_UUID
local _LEFT_UUID
local _uuid

_MD_UUID=$(getargs rd.md.uuid -d rd_MD_UUID=)
[ -n "$_MD_UUID" ] || getargbool 0 rd.auto || return

if [ -n "$_MD_UUID" ]; then
_LEFT_UUID=$(str_replace "$_MD_UUID" "-" ":")
_MD_UUID=$(str_replace "$_MD_UUID" "-" "")
_MD_UUID=$(str_replace "$_MD_UUID" ":" "")

Expand All @@ -51,6 +54,9 @@ _md_force_run() {
)

[ -z "$_UUID" ] && continue
# remove the UUID already assembled from the list
_LEFT_UUID=$(str_replace "$_LEFT_UUID" "$_UUID" "")

_UUID=$(str_replace "$_UUID" ":" "")

# check if we should handle this device
Expand All @@ -65,6 +71,14 @@ _md_force_run() {
_md_start "${_md}"
done
fi

# try to assemble all the left md devices that should be assembled
# probably failed because of timing issue in the first beginning
if [ -n "$_LEFT_UUID" ]; then
for _uuid in ${_LEFT_UUID}; do
mdadm --assemble --scan --uuid="$_uuid"
done
fi
}

_md_force_run
Loading