mirror of
https://github.com/TECHNOFAB11/disko.git
synced 2025-12-12 16:10:03 +01:00
zapCreateMount: stop mdraids
This commit is contained in:
parent
7a4c85b53e
commit
6bbdafce48
2 changed files with 8 additions and 1 deletions
|
|
@ -46,7 +46,7 @@ in {
|
||||||
${types.diskoLib.mount cfg.devices}
|
${types.diskoLib.mount cfg.devices}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
system.build.disko = pkgs.writers.writeDash "disko" ''
|
system.build.disko = pkgs.writers.writeBash "disko" ''
|
||||||
export PATH=${lib.makeBinPath (types.diskoLib.packages cfg.devices pkgs)}
|
export PATH=${lib.makeBinPath (types.diskoLib.packages cfg.devices pkgs)}
|
||||||
${types.diskoLib.zapCreateMount cfg.devices}
|
${types.diskoLib.zapCreateMount cfg.devices}
|
||||||
'';
|
'';
|
||||||
|
|
|
||||||
|
|
@ -152,6 +152,7 @@ rec {
|
||||||
*/
|
*/
|
||||||
zapCreateMount = devices: ''
|
zapCreateMount = devices: ''
|
||||||
set -efux
|
set -efux
|
||||||
|
shopt -s nullglob
|
||||||
# print existing disks
|
# print existing disks
|
||||||
lsblk
|
lsblk
|
||||||
|
|
||||||
|
|
@ -161,6 +162,12 @@ rec {
|
||||||
umount -Rlv /mnt
|
umount -Rlv /mnt
|
||||||
fi
|
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...'
|
echo 'creating partitions...'
|
||||||
${diskoLib.create devices}
|
${diskoLib.create devices}
|
||||||
echo 'mounting partitions...'
|
echo 'mounting partitions...'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue