mirror of
https://github.com/nix-community/disko.git
synced 2024-10-26 07:22:12 +03:00
deactivate: stop raid if disk is a member of it
this is useful in cases where the target machine has a pre-configured RAID setup, as otherwise disko would wipe the partition tables and create new ones but would not be able to inform the kernel about it, as the old raid was still in use.
This commit is contained in:
parent
11f4ed1041
commit
acd2cbdb31
@ -26,6 +26,9 @@ def remove:
|
||||
def deactivate:
|
||||
if .type == "disk" then
|
||||
[
|
||||
# If this disk is a member of raid, stop that raid
|
||||
"mdadm --stop $(lsblk \(.path) -l -p -o type,name | awk 'match($1,\"raid.*\") {print $2}')",
|
||||
# Remove all file-systems and other magic strings
|
||||
"wipefs --all -f \(.path)",
|
||||
# Remove the MBR bootstrap code
|
||||
"dd if=/dev/zero of=\(.path) bs=440 count=1"
|
||||
|
Loading…
Reference in New Issue
Block a user