cancel
Showing results for 
Search instead for 
Did you mean: 

Is there possibility we can auto mount a usb when connected to usb host ? Any leads will be appreciated since tricks for x86 based systems might not work to fullest for custom embedded ARM env due to missing packages.

NPal.2
Senior
 
This discussion is locked. Please start a new topic to ask your question.
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @VRoma.2​ ,

the package usbmount doesn't exist in OpenSTLinux distribution. However, could you make a try with the package udev-extraconf please? This package exists in 2.0.

root@stm32mp1:~# apt-get install udev-extraconf

I did a test with OpenSTLinux 3.1 and my USB key is auto-mounted under /run/media/sda1. This is the output I got :

root@stm32mp1:~# [  400.824653] usb 2-1.4: new high-speed USB device number 6 using ehci-platform
[  401.011458] usb-storage 2-1.4:1.0: USB Mass Storage device detected
[  401.022701] scsi host0: usb-storage 2-1.4:1.0
[  402.205025] scsi 0:0:0:0: Direct-Access     Kingston DataTraveler 3.0 PMAP PQ: 0 ANSI: 6
[  402.220259] sd 0:0:0:0: Attached scsi generic sg0 type 0
[  403.318695] sd 0:0:0:0: [sda] 30310400 512-byte logical blocks: (15.5 GB/14.5 GiB)
[  403.327412] sd 0:0:0:0: [sda] Write Protect is off
[  403.333210] sd 0:0:0:0: [sda] No Caching mode page found
[  403.337185] sd 0:0:0:0: [sda] Assuming drive cache: write through
[  403.490008]  sda: sda1
[  403.499969] sd 0:0:0:0: [sda] Attached SCSI removable disk
root@stm32mp1:~# cd /run/media/sda1/
root@stm32mp1:/run/media/sda1# ls
2016-01-09-10-PARIS-Ci     JM       ST                         ebooks
2016-01-09-10-PARIS-final  JM_Work  System Volume Information  photos
Generiques_TV              Papiers  deces_claude

When unplugging the usb key, the key is un-mounted:

root@stm32mp1:/run/media/sda1# cd
root@stm32mp1:~# umount /run/media/sda1
root@stm32mp1:~# [  706.654509] usb 2-1.4: USB disconnect, device number 6
root@stm32mp1:~# ls /run/media/
root@stm32mp1:~#

Best regards,

--JM

View solution in original post

6 REPLIES 6
OlivierK
ST Employee

Hi NPal.2 (Community Member) 

Have you tried already: sudo apt-get install usbmount

Regards,

Olivier

Thanks @OlivierK​ . Will try that.

VRoma.2
Associate II

Is there no usbmount package under 2.0 dunfell InRelease?

I cannot install it, due to not found error...

Hi @VRoma.2​ ,

the package usbmount doesn't exist in OpenSTLinux distribution. However, could you make a try with the package udev-extraconf please? This package exists in 2.0.

root@stm32mp1:~# apt-get install udev-extraconf

I did a test with OpenSTLinux 3.1 and my USB key is auto-mounted under /run/media/sda1. This is the output I got :

root@stm32mp1:~# [  400.824653] usb 2-1.4: new high-speed USB device number 6 using ehci-platform
[  401.011458] usb-storage 2-1.4:1.0: USB Mass Storage device detected
[  401.022701] scsi host0: usb-storage 2-1.4:1.0
[  402.205025] scsi 0:0:0:0: Direct-Access     Kingston DataTraveler 3.0 PMAP PQ: 0 ANSI: 6
[  402.220259] sd 0:0:0:0: Attached scsi generic sg0 type 0
[  403.318695] sd 0:0:0:0: [sda] 30310400 512-byte logical blocks: (15.5 GB/14.5 GiB)
[  403.327412] sd 0:0:0:0: [sda] Write Protect is off
[  403.333210] sd 0:0:0:0: [sda] No Caching mode page found
[  403.337185] sd 0:0:0:0: [sda] Assuming drive cache: write through
[  403.490008]  sda: sda1
[  403.499969] sd 0:0:0:0: [sda] Attached SCSI removable disk
root@stm32mp1:~# cd /run/media/sda1/
root@stm32mp1:/run/media/sda1# ls
2016-01-09-10-PARIS-Ci     JM       ST                         ebooks
2016-01-09-10-PARIS-final  JM_Work  System Volume Information  photos
Generiques_TV              Papiers  deces_claude

When unplugging the usb key, the key is un-mounted:

root@stm32mp1:/run/media/sda1# cd
root@stm32mp1:~# umount /run/media/sda1
root@stm32mp1:~# [  706.654509] usb 2-1.4: USB disconnect, device number 6
root@stm32mp1:~# ls /run/media/
root@stm32mp1:~#

Best regards,

--JM

Hi @Jean-Marc B (ST Employee)

Thank you very much, it worked!

Hello @VRoma.2​ 

That's great! Thank you for your feedback!

I think @NPal.2​  would be interested by this update too.

Best regards,

--JM