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

10.10.9 aborts in presence of a backup whose rootfs is on a "missing" disk #66

Open
ydirson opened this issue Oct 4, 2023 · 0 comments

Comments

@ydirson
Copy link
Contributor

ydirson commented Oct 4, 2023

My recently-merged "tui: show the disk on which an existing installation or backup is found" patch reveals an old issue.

In a nested BIOS install a backup detected as <XenServerBackup: XCP-ng 8.3 (8.3.0-cloud) on /dev/sda2>, where the PRIMARY_DISK is /dev/disk/by-id/nvme-QEMU_NVMe_Ctrl_nvme0 (denoting that backup was originally installed as UEFI), is presented to the user as a valid choice to restore from.

However, since 10.10.9 we now display more detailed entries, and this causes a exception, as:

  • getDiskDeviceSize("/dev/disk/by-id/nvme-QEMU_NVMe_Ctrl_nvme0") returns None because of a missing else: branch (dev = "disk!by-id!nvme-QEMU_NVMe_Ctrl_nvme0" founds nothing matching /sys/block/%s/device/block/size or /sys/block/%s/size)
  • getExtendedDiskInfo() attempts to divide None / 2048, which causes the installer to abort

No such problem when booting the installer from UEFI, the backup entry succeeds in getting formatted.

The disk!by-id!nvme-QEMU_NVMe_Ctrl_nvme0 string, where in UEFI boot /sys/block/ contains nvme0n1 makes me suspecting we're trying to find a non-existent device, do not catch the failure to get its realpath, and go on using the bad device path.

This issue is linked to #11, in that a UEFI backup should be considered invalid on a BIOS install, and not proposed.
Note that in theory any PRIMARY_DISK pointing to a "missing disk" would lead to this, this could e.g. also happen if in a future platform udev rules change the /disk/by-id/ link.

ydirson added a commit to xcp-ng/host-installer that referenced this issue Oct 4, 2023
ydirson added a commit to xcp-ng/host-installer that referenced this issue Oct 4, 2023
ydirson added a commit to xcp-ng/host-installer that referenced this issue Oct 4, 2023
ydirson added a commit to xcp-ng/host-installer that referenced this issue Oct 5, 2023
ydirson added a commit to xcp-ng/host-installer that referenced this issue Oct 5, 2023
ydirson added a commit to xcp-ng/host-installer that referenced this issue Oct 6, 2023
ydirson added a commit to xcp-ng/host-installer that referenced this issue Oct 6, 2023
ydirson added a commit to xcp-ng/host-installer that referenced this issue Jun 12, 2024
ydirson added a commit to xcp-ng/host-installer that referenced this issue Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant