README.md

March 27, 2026 ยท View on GitHub

๐Ÿ’พ USB Mass Storage

Turn Your Phone Into a USB Drive

Mount disk images as real USB storage devices. KernelSU / Magisk / APatch.

v3.1 Android 12+ Telegram

๐Ÿ‡บ๐Ÿ‡ธ ๐Ÿ‡ฟ๐Ÿ‡ฆ ๐Ÿ‡ธ๐Ÿ‡ฆ ๐Ÿ‡ช๐Ÿ‡ธ ๐Ÿ‡จ๐Ÿ‡ฟ ๐Ÿ‡ฉ๐Ÿ‡ฐ ๐Ÿ‡ฉ๐Ÿ‡ช ๐Ÿ‡ฌ๐Ÿ‡ท ๐Ÿ‡ฎ๐Ÿ‡ท ๐Ÿ‡ซ๐Ÿ‡ฎ ๐Ÿ‡ซ๐Ÿ‡ท ๐Ÿ‡ญ๐Ÿ‡บ ๐Ÿ‡ฎ๐Ÿ‡ฉ ๐Ÿ‡ฎ๐Ÿ‡น ๐Ÿ‡ฎ๐Ÿ‡ฑ ๐Ÿ‡ฏ๐Ÿ‡ต ๐Ÿ‡ฐ๐Ÿ‡ท ๐Ÿ‡ณ๐Ÿ‡ฑ ๐Ÿ‡ณ๐Ÿ‡ด ๐Ÿ‡ต๐Ÿ‡ฑ ๐Ÿ‡ง๐Ÿ‡ท ๐Ÿ‡ต๐Ÿ‡น ๐Ÿ‡ท๐Ÿ‡ด ๐Ÿ‡ท๐Ÿ‡บ ๐Ÿ‡ท๐Ÿ‡ธ ๐Ÿ‡ธ๐Ÿ‡ช ๐Ÿ‡น๐Ÿ‡ญ ๐Ÿ‡น๐Ÿ‡ท ๐Ÿ‡บ๐Ÿ‡ฆ ๐Ÿ‡ป๐Ÿ‡ณ ๐Ÿ‡จ๐Ÿ‡ณ ๐Ÿ‡น๐Ÿ‡ผ


๐Ÿงฌ What is USB Mass Storage?

When you connect your phone to a computer via USB cable, this module makes the computer see a real USB storage device, as if you plugged in a USB stick or CD drive. You pick a disk image file (.img or .iso) on your phone, and the computer can read and write to it directly.

No file transfer protocols, no MTP, no ADB. The computer sees a native block device.

This is not MTP or file transfer. USB Mass Storage exposes raw block devices to the host computer through the kernel's USB gadget ConfigFS interface. The computer sees a real disk, not a file-sharing protocol. You can boot from it, format it, or use it exactly like a physical USB drive.

Who benefits? The computer you plug into. Your phone acts as the hardware (like a USB stick), and any PC, Mac, or Linux machine sees a native USB disk. No drivers, no MTP, no special software needed on the computer side.


๐Ÿ”ฅ Why USB Mass Storage?

๐Ÿ”Œ Native Block Device โ€” The computer sees a real USB disk, not a file transfer protocol. Works with any OS, any file system, any tool that reads USB storage.

๐Ÿ’ฟ Boot From Your Phone โ€” Mount a bootable .iso as a CD-ROM drive. Install operating systems, run live CDs, or boot recovery tools directly from your phone.

๐Ÿ“ฑ Material 3 Companion App โ€” No terminal commands needed. Tap to mount, tap to eject. Full device management through a clean Compose UI with 32 language translations.

๐Ÿ›ก๏ธ SELinux Enforcing โ€” The daemon runs in its own msd_daemon security domain with a dedicated sepolicy. No permissive hacks, no blanket root access.

๐Ÿ”ง Multi-ABI Support โ€” arm64, armv7, and x86_64 binaries bundled. The installer detects your architecture and keeps only what's needed.


โœจ Features

USB Gadget

  • Mount .img files as USB drives โ€” read-write, read-only, or CD-ROM mode
  • Mount .iso files as CD-ROM drives โ€” boot from ISO, install OS, run live CDs
  • Multiple devices โ€” up to 8 simultaneously, each appears as a separate USB device on the computer
  • Clean eject โ€” computer sees proper device disconnection

Disk Management

  • Create virtual disk images โ€” specify size in MB/GB/GiB, created instantly
  • Persistent configuration โ€” device mounts survive app restarts
  • File descriptor passing โ€” zero-copy file access over Unix socket

App & Module

  • Material 3 UI โ€” Jetpack Compose companion app with pull-to-refresh, bottom sheets, and snackbar alerts
  • 32 languages โ€” app and module installer auto-detect your device language
  • Accent themes โ€” system default, almost black, and white color schemes
  • In-app guide โ€” step-by-step usage tutorial accessible from the menu
  • SELinux enforcing โ€” daemon runs in its own msd_daemon domain
  • Multi-ABI โ€” arm64, armv7, x86_64 binaries included, installer picks the right one
  • Boot guard โ€” automatic daemon restart with exponential backoff

๐Ÿ“‹ Requirements

Important

Root access is required. The daemon interacts with kernel USB gadget ConfigFS, which is a privileged operation.

You need:

  1. Android 12 or above
  2. A supported root manager: KernelSU, Magisk, or APatch
  3. A USB cable connecting your phone to a computer

๐Ÿ“ฑ Compatibility

Root Managers

ManagerStatusNotes
KernelSUโœ… TestedFull support including lifecycle scripts
Magiskโœ… SupportedStandard module install
APatchโœ… SupportedStandard module install

Tested Devices

DeviceAndroidStatus
Redmi 14C (2409BRN2CA)14 (SDK 34)โœ… Daily driver

If you test on a different device, report your results in the Telegram group.


๐Ÿš€ Quick Start

  1. Download the latest release ZIP from Releases
  2. Flash via your root manager and reboot
  3. Open the USB Mass Storage app
  4. Grant root when prompted
  5. Tap + to mount a disk image or create a new one

The computer detects a new USB device within seconds.


โš™๏ธ Usage

Mounting a Disk Image

Tap + on the main screen, then Select disk image file and pick your .img or .iso.

Choose the device type:

TypeUse Case
Read-WriteRegular USB stick, computer can read and write freely
Read-OnlyWrite-protected USB, computer can only read
CD-ROMVirtual CD/DVD drive, use for .iso files, OS installers, bootable media

Tap Mount. Done.

Creating a New Image

Tap +, then Create new disk image. Set a filename and size (e.g., 512 MB, 2 GiB). The image is created instantly on your phone.

After mounting, format it from the computer (FAT32, exFAT, or NTFS).

Multiple Devices

Mount up to 8 devices at once. Each shows as a separate USB device on the computer. Tap a device card to change its type or eject it.

Ejecting

Tap the eject icon on the device card. The computer sees the device disconnected cleanly.


๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    Unix Socket     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    ConfigFS     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Android App โ”‚ โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ โ”‚  Rust Daemon  โ”‚ โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ โ”‚  Kernel  โ”‚
โ”‚  (Compose)   โ”‚    FD passing      โ”‚  (msd_daemon) โ”‚    USB gadget   โ”‚  USB UDC โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

App โ€” Material 3 Compose UI. Picks files, sends file descriptors to the daemon over a Unix socket. No root needed in the app itself.

Daemon โ€” Rust binary running as msd_daemon under SELinux. Receives file descriptors, writes USB gadget configuration to /sys/kernel/config/usb_gadget/. The kernel exposes the file as a USB mass storage LUN to the connected computer.

The app is a regular user app. The daemon handles all privileged operations.


๐Ÿ”จ Building from Source

Prerequisites: JDK 17, Android SDK (compile SDK 35), Rust toolchain with Android targets.

git clone https://github.com/Enginex0/UsbMassStorage.git
cd UsbMassStorage

# Build the app
./gradlew assembleRelease

# Package the module ZIP
bash scripts/package.sh --apk=app/build/outputs/apk/release/app-release.apk

Output ZIP lands in out/.


๐Ÿ”ง Common Issues

ProblemFix
Daemon not runningReboot, or open Settings in the app and tap Restart Daemon
Root not grantedOpen your root manager and grant USB Mass Storage root access
Computer doesn't detect USBReconnect the cable. Make sure USB debugging isn't overriding gadget mode
"AppFuse proxy" errorYour file picker is proxying the file. Use a different file manager (not Google Files)

For other issues, ask in the Telegram group.


๐Ÿ’ฌ Community

Telegram


๐Ÿ“„ License

This project is licensed under the GNU General Public License v3.0.


๐Ÿ’พ Because sometimes you just need a USB drive.