LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-24-2017, 05:27 PM   #1
usr345
Member
 
Registered: Jan 2012
Posts: 125
Blog Entries: 1

Rep: Reputation: Disabled
Slackware 14.2 KDE: flash drive auto mount


I am using Linux Slackware 14.2, KDE. Every time when I plug in the usb stick, I get a pop in the bottom right corner, allowing me to mount the device and open it's contents.

Click image for larger version

Name:	1.png
Views:	26
Size:	4.1 KB
ID:	24324

It is being mounted into /run/media/<device dependent name>. I use only one flash stick at a time and would like to auto-mount any flash drive into /mnt/flash as soon as it's inserted. And to disable KDE automount feature, so no popups are shown.

Anybody knows, how to do it?
 
Old 02-24-2017, 06:32 PM   #2
Mill J
Senior Member
 
Registered: Feb 2017
Location: 127.0.0.1 Sweet 127.0.0.1
Distribution: Void, MX, Haiku, Icaros, Puppy and many others
Posts: 1,079
Blog Entries: 2

Rep: Reputation: 456Reputation: 456Reputation: 456Reputation: 456Reputation: 456
Check this out https://www.axllent.org/docs/view/au...g-usb-storage/
 
Old 02-25-2017, 09:31 AM   #3
usr345
Member
 
Registered: Jan 2012
Posts: 125

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by Mill J View Post
Created the file /etc/udev/rules.d/auto-mount.rules:

Code:
KERNEL!="sd[a-z][0-9]", GOTO="auto_mount_end"
# Import FS infos
IMPORT{program}="/sbin/blkid -o udev -p %N"
# Get a label if present, otherwise specify one
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
ENV{ID_FS_LABEL}=="", ENV{dir_name}="usbhd-%k"
# Global mount options
ACTION=="add", ENV{mount_options}="relatime"
# Filesystem-specific mount options
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"
# Mount the device
ACTION=="add", RUN+="/bin/mount -o $env{mount_options} /dev/%k /mnt/floppy"
# Clean up after removal
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l /mnt/floppy"
# Exit
LABEL="auto_mount_end"
Then ran:

Code:
udevadm control --reload-rules
Doesn't work - I inserted the stick, nothing was mounted to /mnt/floppy.
 
Old 02-25-2017, 10:47 AM   #4
Mill J
Senior Member
 
Registered: Feb 2017
Location: 127.0.0.1 Sweet 127.0.0.1
Distribution: Void, MX, Haiku, Icaros, Puppy and many others
Posts: 1,079
Blog Entries: 2

Rep: Reputation: 456Reputation: 456Reputation: 456Reputation: 456Reputation: 456
See if the original works then tweak to your liking. it might not be possible.

You might want to check into fstab
https://help.ubuntu.com/community/Fstab
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Flash disk auto mount on KDE4.2.4 and slackware -current Ravendark Slackware 3 06-20-2009 03:39 AM
Auto-mount usb flash without any DE TweeKane Debian 8 12-04-2008 10:22 AM
got my ntfs sata drive to mount but cat get to auto mount Jack Daniels Linux - Hardware 3 04-15-2007 10:42 AM
SuSE 9.3 USB Flash Drive Auto Mount Stopped Working nuro305 Linux - Hardware 11 04-15-2007 05:21 AM
How to mount a usb flash drive on Slackware Slackware user Linux - Software 3 03-02-2006 07:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration