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



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 '18 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.


this tutorial sucks. 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.


New contributor
Fred_Leicht is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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