~smoser/curtin/trunk.lp1402042

Viewing all changes in revision 221.

  • Committer: Scott Moser
  • Date: 2015-06-23 16:14:30 UTC
  • Revision ID: smoser@ubuntu.com-20150623161430-dy6zy3fborll3fpb
detect_multipath: force rescan of block devices prior to blkid

Given /dev/sda and /dev/sdi point to the same block device, and:
  wipe-disk-and-partitions /dev/sda
  partition /dev/sda
  blockdev --rereadpt /dev/sda
  udevadm settle
  mkfs /dev/sda2

'blkid -c /dev/null' will only see /dev/sdi2 and read its filesystem UUID
if the device had the same partition table before the wipe operation.
Nothing would have caused the kernel to update its knowledge of partitions
on /dev/sdi.

blkid only reads data from devices (and partitions) the kernel provides
data about.  It does not open block devices and read partition table
information itself.

The change here is to re-scan all block devices (those unmounted and
readwrite) before running blkid.

The other change is to grow the list of cache files that are known to be
read by blkid.  Experimentation shows that 14.04 reads /dev/.blkid.tab
even though that is not documented.

The reason we're removing cache files rather than using 'blkid -c
/dev/null' is that this command would have no affect on the cache files.
If we're going to scan, we might as well cache.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: