← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] ~paul-meyer/cloud-init:fix-raw-ephemeral-disk into cloud-init:master


Actually, the example above was bogus, because i didn't udevadm settle after sfdisk would have called rereadpt.  However, this one shows the problem:

sudo sh -c 'dev=/dev/vdb;
  while :; do 
    dd if=/dev/null of=$dev bs=1 count=0 &&
    blockdev --rereadpt $dev || break; 
    udevadm settle; done'

There, we open /dev/vdb for RW via 'dd', close it, and then call blockdev --rereadpt.
After calling blockdev --rereadpt we do 'udevadm settle' so that any events that blockdev's reread are fully processed.  Then, we do it all again (and again).

Eventually you'll see blockdev complain:
 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.