Edison: USB Gadget Mass Storage image location

USB Gadget Mass Storage image location

Questa domanda è ora Con risposta.

acamiloGreen Belt

When i plug the edison into my PC it mounts as a mass storage device. Where is the image that it mounts located in the edison’s file-system.

David_J_Hunt

Risposta esattada David_J_Hunt il 30-set-2014 6.31

Here’s how to get at the storage in the msdos partition.

 

log into your Edison board over serial console or Wifi. If you’re ssh-ing in over gadget rndis, you’ll lose the connection because you have to unload the multifunction gadget. Here’s the commands to make it available on your edison:

 

rmmod g_multi

mkdir /update

losetup -o 8192 /dev/loop0 /dev/disk/by-partlabel/update

mount /dev/loop0 /update

 

You  can now see the contents of the msdos partition in /update. And is writable, so you can put files in there.

 

To reverse this, and make it available on your host machine:

cd /

umount /update

modprobe g_multi

then pull the usb cable and re-insert it, at which stage the disk should re-appear on your host machine.

 

The reason for this is that you can’t have two machines being the ‘master’ of the same partition at the same time, so you need to switch the owner. If it was NFS or Samba, the NFS or Samba process would always be in control. This case is different, as the g_multi driver allows the remote PC become the master, and cannot allow the Edison to also be writing to the disk at the same time.

 

Rgds,

Dave.

Valutazione utenti media: 3.75 di 5 (4 Valutazioni)

Valutazione utenti media
Valutazione media utente: 3.75 di 5
(4 Valutazioni)
  • 1. Re: USB Gadget Mass Storage image location
    AnthonyWebbGreen Belt

    +1 for better documentation of this.  I put a file on my edison and dont know where to find it now.

  • Risposta esatta2. Re: USB Gadget Mass Storage image location
    David_J_HuntBrown Belt

    Here’s how to get at the storage in the msdos partition.

     

    log into your Edison board over serial console or Wifi. If you’re ssh-ing in over gadget rndis, you’ll lose the connection because you have to unload the multifunction gadget. Here’s the commands to make it available on your edison:

     

    rmmod g_multi

    mkdir /update

    losetup -o 8192 /dev/loop0 /dev/disk/by-partlabel/update

    mount /dev/loop0 /update

     

    You  can now see the contents of the msdos partition in /update. And is writable, so you can put files in there.

     

    To reverse this, and make it available on your host machine:

    cd /

    umount /update

    modprobe g_multi

    then pull the usb cable and re-insert it, at which stage the disk should re-appear on your host machine.

     

    The reason for this is that you can’t have two machines being the ‘master’ of the same partition at the same time, so you need to switch the owner. If it was NFS or Samba, the NFS or Samba process would always be in control. This case is different, as the g_multi driver allows the remote PC become the master, and cannot allow the Edison to also be writing to the disk at the same time.

     

    Rgds,

    Dave.

  • 3. Re: USB Gadget Mass Storage image location
    mikemoyGreen Belt

    The first part worked for me.

    rmmod g_multi

    mkdir /update

    losetup -o 8192 /dev/loop0 /dev/disk/by-partlabel/update

    mount /dev/loop0 /update

     

    But when i tried the second part i get an error using umount /update, which said

    root@edison:/# umount /update

    umount: can’t umount /update: Invalid argument

  • 4. Re: USB Gadget Mass Storage image location
    mhahnBrown Belt

    alternatively mount with an offset parameter of 8192

  • 5. Re: USB Gadget Mass Storage image location
    scottepetersonGreen Belt

    This solution looks good but there is a great summary here: Getting your code onto the Intel Edison · GitHub  .  (links back here – but I was successful with much simpler method listed in this Gist).

     

    just:

    root@edison:~#mkdir flash
    root@edison:~#mount -o offset=8192 /dev/mmcblk0p9 flash

  • 6. Re: USB Gadget Mass Storage image location
    partialdataGreen Belt

    Screen Shot 2015-10-13 at 12.04.25 PM.png

    I have tried a few times on OSX and I just tried on Ubuntu 14.04 to get these commands to work to mount the mass storage on the edison … All i want to do is update node js to the latest version.

Annunci