Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[IMPROVEMENT] Check that block device is not in use before creating disk #12078

Description

@bachmanity1

Is your improvement request related to a feature? Please describe (👍 if you like this request)

When a bdev is created on a block device that’s already in use, existing data on it will be corrupted and lost. This can be dangerous if users accidentally specify the wrong device path.

This check is already handled implicitly for nvme, virtio-blk, and virtio-scsi drivers during device bind step using SPDK’s setup.sh script through the block_in_use function. However, this check is currently missing for the aio driver.

Describe the solution you'd like

Simply run blkid to check if the device has a partition table or filesystem, this is what the block_in_use function does. Reject the disk create request if the device is already in use.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Labels

area/node-disk-mgmtLonghorn node and disk managementarea/v2-data-enginev2 data engine (SPDK)kind/improvementRequest for improvement of existing functionpriority/1Highly recommended to implement or fix in this release (managed by PO)require/auto-e2e-testRequire adding/updating auto e2e test cases if they can be automatedrequire/docRequire updating the longhorn.io documentationrequire/important-noteUpgrade, Deprecation, Important notes
No fields configured for Improvement.

Projects

Status
Closed

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions