diff --git a/nixos/modules/virtualisation/amazon-image.nix b/nixos/modules/virtualisation/amazon-image.nix index 7ccc9df740e5..7cb37bbc4a76 100644 --- a/nixos/modules/virtualisation/amazon-image.nix +++ b/nixos/modules/virtualisation/amazon-image.nix @@ -68,7 +68,11 @@ let cfg = config.ec2; in diskNr=$((diskNr + 1)) echo "mounting $device on $mp..." if mountFS "$device" "$mp" "" ext3; then - if [ -z "$diskForUnionfs" ]; then diskForUnionfs="$mp"; fi + if [ -z "$diskForUnionfs" -a \ + $(lsblk -bno size $device) -gt $(lsblk -bno size /dev/xvda1) + ]; then + diskForUnionfs="$mp"; + fi fi else echo "skipping unknown device type $device"