如何从edison里访问那个OTG连的FAT分区-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 5240|回复: 1

如何从edison里访问那个OTG连的FAT分区

[复制链接]
发表于 2015-5-9 11:51 | 显示全部楼层 |阅读模式
标题没说太清楚 edison-fat.png


就是如何从edison linux中访问这个分区?
 楼主| 发表于 2015-5-9 12:02 | 显示全部楼层
群里WindnBike提供:
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.
需要切换状态,累觉不爱了
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-11-28 00:50 , Processed in 0.229599 second(s), 22 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表