How to disable BBB automount as drive

Hi,
Is there any way by which i can disable the auto mounting of Begalbone black as mass storage device .
I using debian .When i connect begalbone to my computer it shows as mass storage device i want to disable this.

Thank You
Swapnil

vim /opt/scripts/boot/am335x_evm.sh

You could comment out line shown below, but it would disable gadget serial, as well as RNDIS Ethernet.

#modprobe g_multi file=${gadget_partition} cdrom=0 stall=0 removable=1 nofua=1 iSerialNumber=${SERIAL_NUMBER} iManufacturer=Circuitco iProduct=BeagleBone${BLACK} host_addr=${cpsw_1_mac}

Thanks , after making this change i am not able to connect with begalbone. I want usb tethering on and
autmount disabled. is there any other solution

Yes, do you connect through gadget serial or ssh to 192.178.7.2?

If you just use gadget serial you can add the following line below the commented modprobe g_multi.

modprobe g_serial

– OR –

If you just use gadget Ethernet to ssh you can add the following line.

modprobe g_ether host_addr=${cpsw_1_mac}

Thank You,
I will try this. Yes i am using ssh to connect with my Gadget.

While doing some work i deleted some files and my beglbone crashed so that’s why i don’t want to give the access to user for this drive which automount

do u know how to create the 3 rd part-ion in begalbone and give the access of this folder for user it will keep that image safe.
I can create 3rd part-ions but don’t know how to give access of only third part-ion

Thanks you for you valuable response.

Swapnil