-
Committer:
Ryan Harper
-
Date:
2017-10-23 16:49:46 UTC
-
Revision ID:
ryan.harper@canonical.com-20171023164946-8p16fn90bf3ga2vf
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 of a volume has a 'bcache' directory under sysfs
and issuing the appropriate stop commands.
It's also possible for "buried" bcache devices where have metadata 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.
LP: #1718699