viveris / uMTP-Responder

Lightweight USB Media Transfer Protocol (MTP) responder daemon for GNU/Linux
GNU General Public License v3.0
188 stars 51 forks source link

File instead of folder #105

Open GustaWinnipeg opened 2 weeks ago

GustaWinnipeg commented 2 weeks ago

How would I go around using a file to emulate a USB-stick instead of a folder?

For example if I wanted to use my raspberry to store multiple OS boot disks, I could just change the file and use it to boot another PC (doesn't need to be necessarily a file, could be a folder too, as long it is mapped to the / of the USB stick and is capable of booting from it). Is that possible in any way? I've done this using an Android device before.

jfdelnero commented 2 weeks ago

USB-sticks don't use MTP protocol. And you can already emulate mass storage / usb stick with the current kernels. You can use the "g_mass_storage" module for this :

modprobe g_mass_storage file=/root/stick_image.img stall=0 removable=y iSerialNumber=1234567890