Storage Gadget: Automount BBB on BBB

I’m trying to connect two BeagleboneBlack together, with the aim of seeing the two as a usb device on the other.

As a first step I colleagato the USB Host port of the one with the mini USB port of the other. At this point on the card that is attached to the USB host can see the other among the available devices, in this case / dev / sda.

If I mount the device: mount / dev / sda / media / USB_BBB I can see the contents without any problems.

The question is, how to make this process automatic?

Also, if I disconnect and reconnect I get the card that the device is no longer assigned to / dev / sda but / dev / sdb.

How to solve this problem?