After using a USB drive to install a system, the drive often gets divided into multiple partitions. Below are instructions for merging it back into a single partition and formatting it on both MacOS and Windows.

MacOS

For detailed instructions, see: Setting up OpenWrt as a Bypass Router Using Raspberry Pi 4B+ | Kunyang’s Blog

Windows

  • Open Command Prompt:

    diskpart
    
  • List disks:

    list disk
    Disk ###  Status         Size     Free     Dyn  Gpt
      --------  -------------  -------  -------  ---  ---
      Disk 0    Online          931 GB  1024 KB        *
      Disk 1    Online          931 GB  1024 KB        *
      Disk 2    Online         7696 MB  5050 MB        *
    
  • Select the disk (be careful not to select the wrong one):

    sel disk 2
    
  • Clean:

    clean
    
  • List disks again to verify:

      Disk ###  Status         Size     Free     Dyn  Gpt
      --------  -------------  -------  -------  ---  ---
      Disk 0    Online          931 GB  1024 KB        *
      Disk 1    Online          931 GB  1024 KB        *
    * Disk 2    Online         7696 MB  7695 MB        *
    
  • Press Win + X to open Disk Management, find the USB drive, create a new simple volume, and follow the default steps: