-
Committer:
Ryan Harper
-
Date:
2017-10-26 20:43:44 UTC
-
mfrom:
(535.2.6 trunk.fix-lp1718699)
-
Revision ID:
ryan.harper@canonical.com-20171026204344-m5bf3jeq4e11z6jv
block: handle wiping bcache parts
In some cases block devices may have bcache parts which are owned by the
block layer but are not assembled into a bcache device. The result is that
curtin fails to get exclusive opens when attempting to wipe the device.
Resolve this by testing if a volume has a 'bcache' directory under sysfs
and issuing the appropriate stop commands before wiping.
It's also possible for old "buried" metadata for bcache or lvm or raid
at particular partition offsets. Once curtin starts partitioning the
device the bcache kernel layer "finds" the parts and claims device
ownership and prevents wiping of the partition. We resolve this issue
by having curtin wipe 1M at the location of the partition before we
actually create it.
Fix 'curtin clear-holders' subcommand.
LP: #1718699