Stop execution after machine is booted
Shut down and rescue the machine
Shrinking the root disk with rescue
automatic e2fsck
sleep before partitioning, spare space with mv
Preserve first partition
Add delays
Do not halt rescue machine

It seems to put the instance to error state sometimes
Remove trailing space
Merge pull request #11 from matelakat/shrink-partition

Shrink and keep Ubuntu partition