From e866840a120976ad63882fa53fbddfd714cff93d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 28 Sep 2015 21:50:22 +0200 Subject: [PATCH] Wait for udev after resizing partitions Otherwise the EC2 boot may panic. --- nixos/modules/virtualisation/amazon-grow-partition.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nixos/modules/virtualisation/amazon-grow-partition.nix b/nixos/modules/virtualisation/amazon-grow-partition.nix index 31899fae6c02..44a9fa93e7ec 100644 --- a/nixos/modules/virtualisation/amazon-grow-partition.nix +++ b/nixos/modules/virtualisation/amazon-grow-partition.nix @@ -39,7 +39,10 @@ in ''; boot.initrd.postDeviceCommands = '' - [ -e /dev/xvda ] && [ -e /dev/xvda1 ] && TMPDIR=/run sh $(type -P growpart) /dev/xvda 1 + if [ -e /dev/xvda ] && [ -e /dev/xvda1 ]; then + TMPDIR=/run sh $(type -P growpart) /dev/xvda 1 + udevadm settle + fi ''; };