~powersj/curtin/pycodestyle

Viewing all changes in revision 444.

  • Committer: Ryan Harper
  • Date: 2017-02-01 17:46:35 UTC
  • mfrom: (441.1.8 trunk.debug-mdadm)
  • Revision ID: ryan.harper@canonical.com-20170201174635-4orku019lmsvaj47
Add clear_holders checks to disk and partition handlers

In some cases disks may contain block device metadata outside of the
current partition table. Due to Linux udev rules and behaviors;
creating or modifying a disks partition table may trigger udev rules
which may start up mdadm, bcache or lvm services which will obtain
exclusive access to the disk preventing installation from completing.

This branch addresses this issue with the following

- block.wipe_volume now uses os.O_EXCL flag to obtain exclusive access
  to a device; this fails when something else (like mdadm) obtains
  a file handle on the device with O_EXCL flag

- Upon failure to obtain exclusive access, we dump information about
  a devices block holders

- During disk handling, after creating a partition table we check for
  holders and then clear them if present.

- During partition handling, after creating a new partition we check
  for holders and then clear them if present.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: