Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to get Btrfs volume UUID using libblockdev if UDev lookup fails #936

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions blivet/devices/btrfs.py
Expand Up @@ -430,6 +430,14 @@ def _post_create(self):
else:
self.format.vol_uuid = udev.device_get_uuid(info)

if not self.format.vol_uuid:
try:
bd_info = blockdev.btrfs.filesystem_info(self.parents[0].path)
except blockdev.BtrfsError as e:
log.error("failed to get filesystem info for new btrfs volume %s", e)
else:
self.format.vol_uuid = bd_info.uuid

self.format.exists = True
self.original_format.exists = True

Expand Down