WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Auto Mount USB  (Read 4786 times)

Offline Looper

  • Newbie
  • *
  • Posts: 47
Auto Mount USB
« on: September 22, 2019, 05: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, 07:46:48 PM by Rich »

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Auto Mount USB
« Reply #1 on: September 22, 2019, 08: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, 09:08:08 AM »
Yes And , Exactly Doesn’t Work and that’s NOT a automatic USB mounting
No any Other Solution ? :(
« Last Edit: September 23, 2019, 09:13:16 AM by Looper »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Auto Mount USB
« Reply #3 on: September 23, 2019, 10:07:24 AM »

Offline Looper

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

Offline Juanito

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

Offline Looper

  • Newbie
  • *
  • Posts: 47
Re: Auto Mount USB
« Reply #6 on: September 23, 2019, 03: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, 03:35:23 PM by Looper »