WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Auto Mount USB  (Read 5395 times)

Offline Looper

  • Newbie
  • *
  • Posts: 47
Auto Mount USB
« on: September 22, 2019, 08:03:47 PM »
Hi guys;
I try to enable Auto Mount on Micro Core 10.x
And can’t find any related package in Tcz repository
Some thing like AutoFS or usb_mount in Debian
I search about this and found http://forum.tinycorelinux.net/index.php/topic,9622.0.html But not suitable
I need help for a practical solution
Notice : I need to auto mount UNKNOWN UUID USB , not just specifically UUIDs
Do have any solution ?

    [EDIT]: Fixed URL.  Rich
« Last Edit: September 22, 2019, 10:46:48 PM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11629
Re: Auto Mount USB
« Reply #1 on: September 22, 2019, 11:25:44 PM »
Hi Looper
Did you read Reply #11 by bmarkus:
http://forum.tinycorelinux.net/index.php/topic,9622.msg52676.html#msg52676
It does not require any UUIDs.

Offline Looper

  • Newbie
  • *
  • Posts: 47
Re: Auto Mount USB
« Reply #2 on: September 23, 2019, 12:08:08 PM »
Yes And , Exactly Doesn’t Work and that’s NOT a automatic USB mounting
No any Other Solution ? :(
« Last Edit: September 23, 2019, 12:13:16 PM by Looper »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: Auto Mount USB
« Reply #3 on: September 23, 2019, 01:07:24 PM »

Offline Looper

  • Newbie
  • *
  • Posts: 47
Re: Auto Mount USB
« Reply #4 on: September 23, 2019, 01:34:04 PM »
That’s mount USB but That’s empty

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: Auto Mount USB
« Reply #5 on: September 23, 2019, 01:55:57 PM »
What do you mean by “that’s empty”?

Offline Looper

  • Newbie
  • *
  • Posts: 47
Re: Auto Mount USB
« Reply #6 on: September 23, 2019, 06:30:39 PM »
sorry for my bad replay
my usb label is 'BAG' , when i plug my usb ; BAG directory created bud it's empty, without any content of my usb flash .
do you have any idea ?
finally i create simple python script to auto mount vFAT and NTFS (Read and Write) .
Code: [Select]
import pyudev

context = pyudev.Context()
monitor = pyudev.Monitor.from_netlink(context)
monitor.filter_by(subsystem='usb')

for device in iter(monitor.poll, None):
    if device.action == 'add':
        # mount with subprocess call mount command
        # if type of disk is NTFS you have to use mount -t ntfs-3g /dev/sdXy
    elif device.action == 'delete':
         # umount with subprocess call umount command

detect USB event pyudev and run that a service like openssh.
« Last Edit: September 23, 2019, 06:35:23 PM by Looper »