Skip to content

Flashing M.2 SSD for HyperCloud

If a HyperDrive node is to be reused in HyperCloud, the M.2 boot drive may need to be flashed to contain the HyperCloud OS.

Equipment required

  • Linux or macOS computer
  • USB to M.2 SSD adapter
    • Specifically, an adapter that can handle both SATA and NVMe M.2 drives, for example: Orico M.2 Enclosure.

Software required

  • Latest disk image of HyperCloud from HyperCloud Repo; for example, https://git.softiron.com/jenkins/cloud/v2.0.4/hypercloud-2.0.4-aarch64-diskimage.tar.gz

    • This will extract (tar zxvf <FILE>) into a full disk image (e.g. hypercloud-aarch64-diskimage) and a bmap file (e.g. hypercloud-aarch64-diskimage.bmap), which is a human readable description of the data in the image.

    • This is used with the bmaptool which is a disk image reader / writer that cleverly maps only the used data areas on a disk. A target disk only needs the used data areas to be written rather than simply writing the whole image including blocks of zeroes, such as a tool like dd would perform.

    • If a disk image only has 5% of its capacity used, only 5% of the disk needs to be written, which considerably speeds up the image copy compared with dd. For example, the hypercloud-aarch64-diskimage has ~1.5% usage when new.

    • Install bmap-tools, which may already be a part of the Linux distribution (e.g. apt install bmap-tools) or obtain from GitHub.

      • On macOS, download using curl -Lo bmaptool https://github.com/01org/bmap-tools/releases/download/v3.4/bmaptool; for example, version 3.4 has been tested and works (August 2023).

      • Python 3 is also needed and can be installed using Homebrew (e.g. brew install python).

        • There needs to be a link to python3 from python (e.g. sudo ln -s python3 python, where python3 is stored) or by some other way to define python environments.

Flash process

  1. Carefully remove the M.2 SSD from the SoftIron node.
  2. Plug in the M.2 SSD via the M.2 to USB adapter.

    Warning

    Be absolutely sure which disk ID the M.2 has been assigned so that the computer's OS disk is not corrupted.

    Tip

    Check dmesg, or on Linux: fdisk -l, or on macOS, diskutil list, to show storage devices. The size should help identify the M.2, or run utilities before and after inserting the SSD to see the new M.2 designation.

  3. Use bmaptool to flash the image to the M.2 working in the directory where the image and the bmap files; for example:

    Warning

    Confirm you know what your drive identities are to avoid writing over the wrong data. - Linux: sudo ./bmaptool copy hypercloud-aarch64-diskimage /dev/sdd - macOS: sudo ./bmaptool copy hypercloud-aarch64-diskimage /dev/rdisk64 - On macOS, there is a diskX and an rdiskX ID for devices, use the rdiskX version.

  4. When process is complete, carefully remove the M.2 SSD from the adapter and place it back in its original position within the SoftIron node.