User documentation and guides for products sold on the Libre Tech Shop. https://docs.libretech.shop
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
3.5 KiB

  1. # Using the MH-USB Disk
  2. ## Organisation of the MH-USB Disk
  3. The files on the MH-USB disk are arranged as follows:
  4. ```
  5. MH-USB/
  6. /OS/ <-- Contains OS Images
  7. /Tools/ <-- Contains some tools and software
  8. /RPi/ <-- OS Images for the Raspberry Pi
  9. /ventoy/ <-- Config files for the Ventoy/Grub2 bootloader
  10. ```
  11. The MH-USB partition of the USB disk is formatted with [exFAT](https://en.wikipedia.org/wiki/ExFAT).
  12. This enables universal access to the data on any operating system that supports exFAT.
  13. ## Booting on physical computer
  14. You boot the USB disk on a physical computer (dekstop, laptop, single-board
  15. computer or laptop) by simply plugging it in and choosing it as a boot device.
  16. The MH-USB runs the [GRUB2](https://www.gnu.org/software/grub/) boot
  17. loader and will boot just fine with a "legacy" BIOS or UEFI BIOS.
  18. The USB make would show up as a USB disk called "Generic Flash Drive":
  19. <figure>
  20. <img src="/images/usb/boot-device.jpg" width="600">
  21. </figure>
  22. Just choose it as the boot device and you will be greeted by the MH-USB
  23. boot screen.
  24. ## Booting on a virtual machine
  25. You can also boot the USB using a virtual machine. On a GNU/Linux
  26. system, one can use QEMU to boot the USB.
  27. First check the device name assigned to the USB disk. A quick way to
  28. check it out would be to use the `lsblk` command like this:
  29. ``` shell-session
  30. $ lsblk -o NAME,SIZE,HOTPLUG -P -d | grep "HOTPLUG=\"1\"" | cut -d" " -f1
  31. NAME="sdb"
  32. ```
  33. The command above will list out all the USB disks attached to your
  34. computer. (Actually, all "HOTPLUG" storage devices - which includes USB
  35. storage.)
  36. ### Booting a virtual machine with SeaBIOS
  37. To boot the USB disk using QEMU + SeaBIOS, install the `qemu` package
  38. from your GNU/Linux OS repository and then run:
  39. ``` shell-session
  40. $ DEVICE=`lsblk -o NAME,SIZE,HOTPLUG -P -d | grep "HOTPLUG=\"1\"" | cut -d"\"" -f2`
  41. $ sudo qemu-system-x86_64 \
  42. -enable-kvm -rtc base=localtime -m 2G -vga std \
  43. -drive file=/dev/$DEVICE,readonly=on,cache=none,format=raw,if=virtio
  44. ```
  45. This will boot the USB via QEMU and show you the boot screen in a popup window.
  46. ### Booting a virtual machine with a UEFI BIOS
  47. If you want to try booting the USB with QEMU with the `tianocore` UEFI BIOS, first install the OVMF
  48. (Open Virtual Machine Firmware) packages.
  49. On Debian and Debian-based distributions run:
  50. ``` shell-session
  51. # apt-get install ovmf
  52. $ BIOS="/usr/share/qemu/OVMF.fd"
  53. ```
  54. On Archlinux-based distributions run:
  55. ``` shell-session
  56. # pacman -S edk2-ovmf
  57. $ BIOS="/usr/share/edk2-ovmf/x64/OVMF.fd"
  58. ```
  59. ```bash
  60. $ DEVICE=`lsblk -o NAME,SIZE,HOTPLUG -P -d | grep "HOTPLUG=\"1\"" | cut -d"\"" -f2`
  61. $ sudo qemu-system-x86_64 \
  62. -bios $BIOS \
  63. -enable-kvm -rtc base=localtime -m 2G -vga std \
  64. -drive file=/dev/$DEVICE,readonly=on,cache=none,format=raw,if=virtio
  65. ```
  66. ## Writing an image to another USB drive
  67. While a multi-boot USB is nice, there might be times when you want to write an OS image to another
  68. USB disk. The MH-USB includes the "RaspberryPi Imager" (`rpi-imager`) tool to help you write an OS
  69. image to a USB disk safely and quickly.
  70. You can run the the `rpi-imager` directly from the USB. Insert the MH-USB into a GNU/Linux (or
  71. Windows) computer and mount it. In the `Tools/` directory on the USB, you will see binaries for the
  72. Raspberry Pi imager. You can use it to write any of the bootable operating system images to another
  73. USB.
  74. *[TODO: Include more details and screenshots!]*
  75. ## Working with Raspberry Pi images
  76. *[TODO: Include details with screenshots]*