mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-15 03:15:56 +03:00
Merge pull request #39164 from ngortheone/master
Fix root volume resizing on EC2 KVM instances (M5, C5, etc)
This commit is contained in:
commit
ec569fc482
@ -32,8 +32,15 @@ with lib;
|
||||
rootDevice="${config.fileSystems."/".device}"
|
||||
if [ -e "$rootDevice" ]; then
|
||||
rootDevice="$(readlink -f "$rootDevice")"
|
||||
parentDevice="$(lsblk -npo PKNAME "$rootDevice")"
|
||||
TMPDIR=/run sh $(type -P growpart) "$parentDevice" "''${rootDevice#$parentDevice}"
|
||||
parentDevice="$rootDevice"
|
||||
while [ "''${parentDevice%[0-9]}" != "''${parentDevice}" ]; do
|
||||
parentDevice="''${parentDevice%[0-9]}";
|
||||
done
|
||||
partNum="''${rootDevice#''${parentDevice}}"
|
||||
if [ "''${parentDevice%[0-9]p}" != "''${parentDevice}" ] && [ -b "''${parentDevice%p}" ]; then
|
||||
parentDevice="''${parentDevice%p}"
|
||||
fi
|
||||
TMPDIR=/run sh $(type -P growpart) "$parentDevice" "$partNum"
|
||||
udevadm settle
|
||||
fi
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user