Tiny Core Linux

Tiny Core Base => Micro Core => Topic started by: Looper on September 22, 2019, 05:03:47 PM

Title: Auto Mount USB
Post by: Looper 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
Title: Re: Auto Mount USB
Post by: Rich 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.
Title: Re: Auto Mount USB
Post by: Looper 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 ? :(
Title: Re: Auto Mount USB
Post by: Juanito on September 23, 2019, 10:07:24 AM
How about this:

http://forum.tinycorelinux.net/index.php/topic,22244.msg139208.html#msg139208
Title: Re: Auto Mount USB
Post by: Looper on September 23, 2019, 10:34:04 AM
That’s mount USB but That’s empty
Title: Re: Auto Mount USB
Post by: Juanito on September 23, 2019, 10:55:57 AM
What do you mean by “that’s empty”?
Title: Re: Auto Mount USB
Post by: Looper 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.