Looking at the growpart command; it does two primary things. 1) issues commands to update the size of the partition (via sgdisk or sfdisk) 2) issues a "rereadpt" command.
I really suspect you're right in that the "rereadpt" may have been issued but not yet completed, including the uevent which would trigger udev events; Now, the partition already exists we really shouldn't see the the symlink go away; which is the _really_ strange part.
And then issue growpart commands on a disk whose partition can be grown.
You can launch and instance in azure with user-data to diable growpart; then issue the same growpart command after logging in; I'd also run growpart under bash -x for a trace so we can see what's happening.
Lastly, we can also use an inotify watch on /dev/disk/by-partuuid
% inotifywait -mr --timefmt "%s" --format "%T %w%f %e" /dev/disk/by-partuuid
Setting up watches. Beware: since -r was given, this may take a while!
Watches established.
1563987982 /dev/disk/by-partuuid/foo CREATE
1563987982 /dev/disk/by-partuuid/foo OPEN
1563987982 /dev/disk/by-partuuid/foo ATTRIB
1563987982 /dev/disk/by-partuuid/foo CLOSE_WRITE,CLOSE
1563987985 /dev/disk/by-partuuid/foo DELETE
Looking at the growpart command; it does two primary things. 1) issues commands to update the size of the partition (via sgdisk or sfdisk) 2) issues a "rereadpt" command.
I really suspect you're right in that the "rereadpt" may have been issued but not yet completed, including the uevent which would trigger udev events; Now, the partition already exists we really shouldn't see the the symlink go away; which is the _really_ strange part.
So, I think we should fire up udevadm monitor
sudo udevadm monitor --property --kernel --udev --subsystem- match=block
And then issue growpart commands on a disk whose partition can be grown.
You can launch and instance in azure with user-data to diable growpart; then issue the same growpart command after logging in; I'd also run growpart under bash -x for a trace so we can see what's happening.
Lastly, we can also use an inotify watch on /dev/disk/ by-partuuid
% inotifywait -mr --timefmt "%s" --format "%T %w%f %e" /dev/disk/ by-partuuid by-partuuid/ foo CREATE by-partuuid/ foo OPEN by-partuuid/ foo ATTRIB by-partuuid/ foo CLOSE_WRITE,CLOSE by-partuuid/ foo DELETE
Setting up watches. Beware: since -r was given, this may take a while!
Watches established.
1563987982 /dev/disk/
1563987982 /dev/disk/
1563987982 /dev/disk/
1563987982 /dev/disk/
1563987985 /dev/disk/