title: How to mount Android as CD-ROM?
body: <p>I have Galaxy S4 with custom ROM and kernel. I need to mount ISO image from sdcard to Windows/Linux PC as CD-ROM. <br>
  There's a "DriveDroid" app that works fine, but I need to do it manually (as a study). Windows 8 writes that "Device needs to be formatted".<br>
  code (bash script)</p>
  
  <pre><code># Disable USB
  echo 0 &gt; /sys/class/android_usb/android0/enable
  
  # Set Vendor and Product IDs
  echo 0x04e8 &gt; /sys/class/android_usb/android0/idVendor
  echo 0x6860 &gt; /sys/class/android_usb/android0/idProduct
  
  # Set mass_storage mode
  echo mass_storage &gt; /sys/class/android_usb/android0/functions
  
  # Enable CD-ROM and make read-only (ERROR HERE!)
  echo 1 &gt; /sys/class/android_usb/android0/f_mass_storage/lun0/cdrom
  echo 1 &gt; /sys/class/android_usb/android0/f_mass_storage/lun0/ro
  
  # Set path to ISO
  echo /mnt/shell/emulated/0/obraz.iso &gt; /sys/class/android_usb/android0/f_mass_storage/lun0/file
  
  # Enable USB
  echo 1 &gt; /sys/class/android_usb/android0/enable
  </code></pre>
  
  <p>However, both <code>cdrom</code> and <code>ro</code> files are still set to 0. What else should I do to make them "1" ?</p>