Problems mounting a disk image or partitions

If you have more than one disk connected to your target platform, the disk partitions may not mount.

Hypervisor disk images have two partitions: a bootable partition with the hypervisor host, and a data partition with the guests and other components not required to boot the hypervisor (see Hypervisor disk image partitions in the Assembling a Hypervisor System and Its Components chapter).

If more than one removable disk is connected to your target, these partitions may not mount. If the boot partition doesn't mount, you won't be able to boot the hypervisor; it the data partition doesn't mount you may see no guests or too few guests under /guests, and other files, such as SSH files, may not appear, and services such as SSH may not work as required.

If you know that more than one removable disk will be connected to your board, you can set the value of the HV_DISK variable accordingly, and rebuild your disk image. This variable is used by the /scripts/mountHVPartitions.sh script to help it locate and mount the hypervisor disk image partitions.

The value of HV_DISK is set in the board-specific *.build files. For example, the images/host_bsp/hypervisor-intel-x86-64-APL-abl.build file used for building the Intel Gordon Ridge MRB reference image sets HV_DISK as follows:

HV_DISK=/dev/hd1

These buildfiles include useful comments that explain the build configuration values.

The /scripts/mountHVPartitions.sh script is defined in the HHBSP's images/hypervisor-common.build file (see The HHBSP in the Assembling a Hypervisor System and Its Components chapter). This script uses the value of HV_DISK at boot time to decide how to search for the bootable and data partitions in a disk image, and mount them. Set the value of HV_DISK according to what you know about your board.

If HV_DISK specifies a location, mountHVPartitions.sh mounts the partitions from this location. If no location is specified, the script searches the system for the first disk that has the two partitions it expects to find in a hypervisor system disk image: a type 11 bootable partition, and a type 177 data partition (see Hypervisor disk image partitions). When the script finds these partitions, it mounts them.

System disk appears under /dev/

If you know how the system disk will appear under /dev/, then you can set HV_DISK accordingly, and the mountHVPartitions.sh will mount the partitions to the correct place.

For example, on the Gordon Ridge MRB, the MMC driver is the first block driver to start, and so uses /dev/hd0. The SD card driver always starts right after the MMC driver and therefore appears as /dev/hd1. For this board, set HV_DISK to /dev/hd1, and the /scripts/mountHVPartitions.sh script will mount that SD card's disk partitions there.

How system disk will appear isn't known

If you don't know how the system disk will appear under /dev/, then you should set HV_DISK to /dev/hd (or whatever value the disk prefix will be). The /scripts/mountHVPartitions.sh script will search for a /dev/hd# that has the two required partitions, then mount them.

For example, use this strategy for the Intel Broadwell NUC 5i5, which may have any number of USB keys connected.