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.

107 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. (Important - do not modify!)
  11. ```
  12. The MH-USB partition of the USB disk is formatted with [exFAT](https://en.wikipedia.org/wiki/ExFAT).
  13. This enables universal access to the data on any operating system that supports exFAT.
  14. ## Booting on physical computer
  15. You boot the USB disk on a physical computer (dekstop, laptop, single-board
  16. computer or laptop) by simply plugging it in and choosing it as a boot device.
  17. The MH-USB runs the [GRUB2](https://www.gnu.org/software/grub/) boot
  18. loader and will boot just fine with a "legacy" BIOS or UEFI BIOS.
  19. The USB make would show up as a USB disk called "Generic Flash Drive":
  20. <figure>
  21. <img src="/images/usb/boot-device.jpg" width="600">
  22. </figure>
  23. Just choose it as the boot device and you will be greeted by the MH-USB
  24. boot screen.
  25. ## Booting on a virtual machine
  26. You can also boot the USB using a virtual machine. On a GNU/Linux
  27. system, one can use QEMU to boot the USB.
  28. First check the device name assigned to the USB disk. A quick way to
  29. check it out would be to use the `lsblk` command like this:
  30. ``` shell-session
  31. $ lsblk -o NAME,SIZE,HOTPLUG -P -d | grep "HOTPLUG=\"1\"" | cut -d" " -f1
  32. NAME="sdb"
  33. ```
  34. The command above will list out all the USB disks attached to your
  35. computer. (Actually, all "HOTPLUG" storage devices - which includes USB
  36. storage.)
  37. ### Booting a virtual machine with SeaBIOS
  38. To boot the USB disk using QEMU + SeaBIOS, install the `qemu` package
  39. from your GNU/Linux OS repository and then run:
  40. ``` shell-session
  41. $ DEVICE=`lsblk -o NAME,SIZE,HOTPLUG -P -d | grep "HOTPLUG=\"1\"" | cut -d"\"" -f2`
  42. $ sudo qemu-system-x86_64 \
  43. -enable-kvm -rtc base=localtime -m 2G -vga std \
  44. -drive file=/dev/$DEVICE,readonly=on,cache=none,format=raw,if=virtio
  45. ```
  46. This will boot the USB via QEMU and show you the boot screen in a popup window.
  47. ### Booting a virtual machine with a UEFI BIOS
  48. If you want to try booting the USB with QEMU with the `tianocore` UEFI BIOS, first install the OVMF
  49. (Open Virtual Machine Firmware) packages. 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]*