Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mount flash drives based on usb port #40

Open
johnnyman727 opened this issue Jan 29, 2016 · 2 comments
Open

Mount flash drives based on usb port #40

johnnyman727 opened this issue Jan 29, 2016 · 2 comments

Comments

@johnnyman727
Copy link
Contributor

Currently, flash drives are mounted to a path based on the order in which they are plugged in. The first one plugged in gets /mnt/sda1 and the second gets /mnt/sdb1 - it doesn't matter which port they are plugged into. However, when the Tessel is booted, it loads the top port first so if you initially plugged in the first flash drive into the bottom port and then plugged another drive into the top, they will have their paths switched and your fs.readFile will very wrong. We can get around this by assigning paths to usb ports.

@Frijol
Copy link
Member

Frijol commented Feb 3, 2016

Can we force it to be consistent?

@johnnyman727
Copy link
Contributor Author

I think there is probably a way to do it but I didn't have the time to implement it.

For anyone interested, my guess is that you would make a hotplug script that looks for new flash drives being plugged in. You should also be able to get data about the usb port being used and mount it on the proper path based on that. You will have a lot of info available to your script:

logger -t DEBUG "hotplug usb: action='$ACTION' devicename='$DEVICENAME' devname='$DEVNAME' devpath='$DEVPATH' product='$PRODUCT' type='$TYPE' interface='$INTERFACE'"

See https://wiki.openwrt.org/doc/techref/hotplug for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants