mirror of
https://github.com/nix-community/disko.git
synced 2026-12-01 05:23:28 +01:00
zapCreateMount: stop mdraids
This commit is contained in:
1 parent
7a4c85b53e
commit
6bbdafce48
2 files changed
+8
-1
No files matched your search
@@ -152,6 +152,7 @@ rec {
|
||||
*/
|
||||
zapCreateMount = devices: ''
|
||||
set -efux
|
||||
shopt -s nullglob
|
||||
# print existing disks
|
||||
lsblk
|
||||
|
||||
@@ -161,6 +162,12 @@ rec {
|
||||
umount -Rlv /mnt
|
||||
fi
|
||||
|
||||
# stop all existing raids
|
||||
for r in /dev/md/* /dev/md[0-9]*; do
|
||||
# might fail if the device was already closed in the loop
|
||||
mdadm --stop "$r" || true
|
||||
done
|
||||
|
||||
echo 'creating partitions...'
|
||||
${diskoLib.create devices}
|
||||
echo 'mounting partitions...'
|
||||
|
||||
Reference in new issue
Block a user