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

Enhance tracing to hunt for restore bug #155

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions disktools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,7 @@ def probePartitioningScheme(device):
if out == 'dos':
partitionType = constants.PARTITION_DOS

logger.debug("probePartitioningScheme(%r) => %r", device, partitionType)
return partitionType

def PartitionTool(device, partitionType=None):
Expand Down
4 changes: 4 additions & 0 deletions diskutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,12 @@ def probeDisk(device):
swap is a tuple of True or False and the partition device
"""

logger.debug("probeDisk(%r)", device)
disk = Disk(device)
possible_srs = []

tool = PartitionTool(device)
tool.dump()
for num, part in tool.items():
label = None
part_device = tool._partitionDevice(num)
Expand Down Expand Up @@ -510,6 +512,8 @@ def probeDisk(device):
disk.swap = (True, part_device)
elif part['id'] == GPTPartitionTool.ID_EFI_BOOT or part['id'] == GPTPartitionTool.ID_BIOS_BOOT:
disk.boot = (True, part_device)
else:
logger.info("part %s has unknown id: %s", num, part)

lv_tool = len(possible_srs) and LVMTool()
for num in possible_srs:
Expand Down
1 change: 1 addition & 0 deletions restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def restoreFromBackup(backup, progress=lambda x: ()):
try:
util.mkfs(constants.rootfs_type, restore_partition)
except Exception as e:
logger.critical("Failed to create root filesystem", exc_info=1)
raise RuntimeError("Failed to create root filesystem: %s" % e)

if efi_boot:
Expand Down