mirror of
https://github.com/nix-community/disko.git
synced 2024-10-26 07:22:12 +03:00
umount md device before stopping the raid
This commit is contained in:
parent
12d0c39ed3
commit
be305848c6
@ -27,7 +27,8 @@ def deactivate:
|
|||||||
if .type == "disk" then
|
if .type == "disk" then
|
||||||
[
|
[
|
||||||
# If this disk is a member of raid, stop that raid
|
# If this disk is a member of raid, stop that raid
|
||||||
"lsblk \(.path) -l -p -o type,name | awk 'match($1,\"raid.*\") {print $2}' | xargs -r mdadm --stop",
|
"md_dev=$(lsblk \(.path) -l -p -o type,name | awk 'match($1,\"raid.*\") {print $2}')",
|
||||||
|
"if [[ -n \"${md_dev}\" ]]; then umount \"$md_dev\"; mdadm --stop \"$md_dev\"; fi",
|
||||||
# Remove all file-systems and other magic strings
|
# Remove all file-systems and other magic strings
|
||||||
"wipefs --all -f \(.path)",
|
"wipefs --all -f \(.path)",
|
||||||
# Remove the MBR bootstrap code
|
# Remove the MBR bootstrap code
|
||||||
|
Loading…
Reference in New Issue
Block a user