Heyho, i have a tiny problem, i will use the rpi zero w as device to submit space on my nas as USB Stick, for test i used local file only.

I used this tutorial withouth the samba things https://www.raspberrypi.org/magpi/pi-zero-w-smart-usb-flash-drive/ and i added the option "removable=1"

the "Stick" works and i get access to files in this file but i always have the problem "its write protected" so i cant add files from windows explorer on it, not really good when u want is as Usb Stick

I use last raspian and did rpi-update


3 Answers 3


Try the following:

sudo modprobe g_mass_strorage file=/path/to/file removable=1 ro=0 stall=0

The important part is the ro flag which has to be set to 0.

  • strange, now its workingy thx, i was sure doing the same but in different param pos
    – StefanBD
    Feb 28, 2018 at 18:23

I was able to get it working adding some lines to the modprobe:

sudo modprobe g_mass_storage file=/piusb.bin stall=0 ro=0 removable=1\
  idVendor=0x0781 idProduct=0x5572 bcdDevice=0x0126 iManufacturer="SanDisk"\
  iProduct="Cruzer Switch" iSerialNumber="4C597515973308202393"

I am able to mount it and share it via SAMBA, But there are conflicts between the two owning the same file system. I was hoping to be able to use it a little like a shared drive, and delete files remotely via SAMBA, but that might be asking a lot.


I tried using following it, but it is missing steps. here is the one I used which works, aside from the issue I am having.


  • Please post the relevant information here. Answers consisting only of links are not very helpful and are likely to be deleted.
    – Chenmunka
    Jun 13, 2021 at 18:11
  • Please consider following Chenmunka's advice. Link-only answers may be deleted.
    – Ghanima
    Jun 14, 2021 at 7:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.