Skip to content

Commit

Permalink
fix: avoid external probing effects from other devices
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao authored and mergify[bot] committed Sep 15, 2023
1 parent 8aa6ec5 commit 0faae8a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/types/gpt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ in
--typecode=${toString partition._index}:${partition.type} \
${config.device}
# ensure /dev/disk/by-path/..-partN exists before continuing
partprobe
partprobe ${config.device}
udevadm trigger --subsystem-match=block
udevadm settle
${lib.optionalString (partition.content != null) partition.content._create}
Expand Down
2 changes: 1 addition & 1 deletion lib/types/mdadm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
--force \
--homehost=any \
"''${disk_devices[@]}"
partprobe
partprobe /dev/md/${config.name}
udevadm trigger --subsystem-match=block
udevadm settle
# for some reason mdadm devices spawn with an existing partition table, so we need to wipe it
Expand Down
4 changes: 2 additions & 2 deletions lib/types/table.nix
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
parted -s ${config.device} -- mkpart ${partition.part-type} ${diskoLib.maybeStr partition.fs-type} ${partition.start} ${partition.end}
''}
# ensure /dev/disk/by-path/..-partN exists before continuing
partprobe
partprobe ${config.device}
udevadm trigger --subsystem-match=block
udevadm settle
${lib.optionalString partition.bootable ''
Expand All @@ -101,7 +101,7 @@
parted -s ${config.device} -- set ${toString partition._index} ${flag} on
'') partition.flags}
# ensure further operations can detect new partitions
partprobe
partprobe ${config.device}
udevadm trigger --subsystem-match=block
udevadm settle
${lib.optionalString (partition.content != null) partition.content._create}
Expand Down
2 changes: 1 addition & 1 deletion lib/types/zfs_volume.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
zfs create ${config._parent.name}/${config.name} \
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-o ${n}=${v}") config.options)} \
-V ${config.size}
partprobe
partprobe /dev/zvol/${config._parent.name}/${config.name}
udevadm trigger --subsystem-match=block
udevadm settle
${lib.optionalString (config.content != null) config.content._create}
Expand Down

0 comments on commit 0faae8a

Please sign in to comment.