Execution of blockdev --rereadpt simply issues a call to
ioctl(BLKRRPART) which forces kernel to re-initialize its metadata.
Kernel adds information about newly created partition here:
http://lxr.linux.no/#linux+v3.19.1/block/partition-generic.c#L269 You
can see a call to kobject_uevent() which puts event to udev's queue. So
to me it looks like udev settle should have all the information
available. Only if blockdev succeeds though. We don't check its return
code if I got it correctly.

Another interesting point is that there are two popular ways to re-read
the partition table: BLKRRPAR ioctl (used by blockdev) and BLKPG ioctl
(used by partprobe). They are very different. While BLKRRPAR lets kernel
know that partition table needs to be re-read, BLKPG tells kernel the
exact partitioning layout (parted does this because it wants to have
ultimate control over things). BLKPG may be more udev-friendly because
parted-based tools are more popular. We may want to try partprobe
instead of blockdev and see if it solves the issue.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1443542

Title:
  curtin race on vivid when /dev/sda1 doesn't exist

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/curtin/+bug/1443542/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to