Skip to content

Repository files navigation

phone-usb-iso

CI License: MIT

Turn a rooted old Android phone into a read-only emergency boot drive.

phone-usb-iso copies ISO or raw disk images to a compatible Android phone, verifies them on-device, and exposes one image through the Linux USB mass-storage gadget. With a Ventoy image, one phone can boot Windows installers, Linux distributions, recovery tools, and diagnostics from a single menu.

ISO files on Linux ──ADB + SHA-256──> Android storage
                                           │
                                    read-only configfs LUN
                                           │
                                           ▼
                                PC firmware / Ventoy menu

This is not MTP emulation. The target computer sees a real, firmware-bootable USB block device.

Important compatibility requirement

The phone must be rooted and its kernel must provide the USB configfs mass_storage gadget function. Many custom Android kernels include it; many stock kernels do not. Root alone cannot add a missing kernel feature.

Known working starting point:

  • Rooted Android with KernelSU or Magisk
  • A custom ROM/kernel exposing a path such as /config/usb_gadget/g1/functions/mass_storage.0/lun.0
  • USB device/gadget mode over the phone's data-capable USB cable
  • A Linux computer with ADB

Run phone-usb-iso doctor before copying large images. See compatibility for the full checklist.

Safety model

  • Images are always exposed read-only (ro=1).
  • The tool never exposes an Android block device or the phone's data partition.
  • Only simple .iso and .img files under the dedicated ISO directory are accepted.
  • Interrupted transfers resume in 1 GiB chunks and keep completed chunks.
  • A completed transfer is SHA-256 verified on the phone before it becomes attachable.
  • The Ventoy builder writes only to a newly created loop-backed image and verifies the backing path before formatting.

The project intentionally has no writable USB mode.

Install

Install host dependencies.

Arch Linux:

sudo pacman -S android-tools coreutils util-linux dosfstools exfatprogs parted

Ubuntu/Debian:

sudo apt install adb coreutils util-linux dosfstools exfatprogs parted

Clone and install for your user:

git clone https://github.com/mobashirrahman/phone-usb-iso.git
cd phone-usb-iso
./install.sh

Ensure $HOME/.local/bin is in PATH, then connect the phone with USB debugging enabled and grant the ADB shell root access in KernelSU/Magisk.

phone-usb-iso doctor

Boot one ISO

For a Linux hybrid ISO presented as a USB disk:

phone-usb-iso attach ~/Downloads/Fedora-Workstation-Live.iso --disk

For an ISO presented as a read-only USB CD-ROM:

phone-usb-iso attach ~/Downloads/rescue.iso

The first run copies the image resumably and verifies its SHA-256 on the phone. Repeated runs verify and reuse the existing image. Use --trust-size only when intentionally skipping that repeat checksum.

Reboot the target computer, open its firmware boot menu, and select the USB mass-storage device. Common boot-menu keys are F12, F11, F9, Esc, and Del.

When finished:

phone-usb-iso detach

Build a multiboot Ventoy image

Download and extract the current Linux release from the official Ventoy releases. Download the ISOs you want from their publishers and verify their checksums.

Create a new 32 GiB image containing any number of ISOs:

sudo phone-usb-iso-make-ventoy \
  --output "$HOME/Downloads/Ventoy-Multiboot-32G.img" \
  --size 32G \
  --ventoy-dir "$HOME/Downloads/ventoy-1.x.xx" \
  "$HOME/Downloads/Win11.iso" \
  "$HOME/Downloads/kali-linux-live-amd64.iso" \
  "$HOME/Downloads/archlinux-x86_64.iso"

The output path must not exist. The image must be large enough for all selected ISOs plus at least 256 MiB of overhead.

Copy, verify, and attach it:

phone-usb-iso attach "$HOME/Downloads/Ventoy-Multiboot-32G.img" --disk

At boot, Ventoy displays every ISO in its ISO directory. See the multiboot guide for Secure Boot notes, updating the image, and storage sizing.

Commands

phone-usb-iso doctor
phone-usb-iso list
phone-usb-iso sync IMAGE [--restart] [--trust-size]
phone-usb-iso attach IMAGE [--disk] [--no-sync] [--restart] [--trust-size]
phone-usb-iso detach
phone-usb-iso status
  • sync copies without changing the phone's current USB mode.
  • --restart discards only an incomplete hidden .part transfer and starts it again.
  • --no-sync attaches an already stored image after checking its size against the local file.
  • Raw .img files require --disk.
  • detach does not delete images; it restores MTP + ADB.

Limitations

  • Linux host only for now.
  • Rooted Android only; iPhones and unrooted Android devices are not supported.
  • Kernel support varies by phone and ROM.
  • The phone exposes one backing image at a time. Use Ventoy to select among multiple ISOs.
  • Some firmware may require USB boot to be enabled or Fast Boot to be disabled.
  • Long transfers need a reliable data cable and adequate battery. The resumable protocol handles ordinary ADB interruptions.

Documentation

License

MIT © 2026 Mobashir Rahman

About

Turn a rooted old Android phone into a read-only bootable USB disk with resumable transfers and Ventoy multiboot.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages