Storage overwrite/delete policy

Jan Safranek jsafrane at redhat.com
Wed Apr 3 11:03:35 UTC 2013


Hi,

I'm polishing my storage provider and I want to discuss policy when the
provider deletes or overwrites something.

I propose:

A block device can *not* be deleted or overwritten (added to MD RAID,
formatted with a filesystem, formatted as physical volume etc) if and
only if:
- There is a filesystem on the device and the filesystem is mounted.
- Or, any other block device depends on it (Blivet knows this):
  - The device is member of a running MD RAID.
  - The device is member of a running volume groups.
  - The device is formatted as LUKS and the LUKS is opened.
  - (I haven't tested, but I suppose) The device is path of running
multipath device.

In these cases OpenLMI storage provider returns an exception
(ERR_FAILED), with description that 'Device %s is still used.'

All other devices can be deleted or overwritten. That includes (but is
not limited to):
- Device with unknown filesystem.
- Device with MD RAID metadata, which is not running.
- Device with physical volume metadata, but not part of any running VG.
- Device with a filesystem, which is not mounted.

Does this make sense?

Jan


More information about the openlmi-devel mailing list