Paul, I pulled this.
There is actually lots of errors when requesting partition re-read.
I'm not sure on 14.04, but in newer releases of udev, it actually is watching
RW open on block devices, and whenever a close of such a file descriptor
occurs, it requests a reread.
The end result is if you do something like:
wipefs --all /dev/sdb
blockdev --reread-pt /dev/sdb
I just verified this on 16.04 kvm vm:
sudo sh -c 'dev=/dev/vdb; echo 2048, > sfdisk_in; while :; do sfdisk $dev
<sfdisk_in && blockdev --rereadpt $dev || break; done'
eventually you'll see:
blockdev: ioctl error on BLKRRPART: Device or resource busy
Your team cloud init development team is requested to review the proposed merge
of ~paul-meyer/cloud-init:fix-raw-ephemeral-disk into cloud-init:master.
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : email@example.com
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help : https://help.launchpad.net/ListHelp