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 abmap
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 likedd
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, thehypercloud-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
frompython
(e.g.sudo ln -s python3 python
, wherepython3
is stored) or by some other way to define python environments.
- There needs to be a link to
-
-
Flash process
- Carefully remove the M.2 SSD from the SoftIron node.
-
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. -
Use
bmaptool
to flash the image to the M.2 working in the directory where the image and thebmap
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 adiskX
and anrdiskX
ID for devices, use therdiskX
version. -
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.