Auto open folder when usb plug in

hi teams,

where i can find the app for usb seetings becuase i want set up the usb auto open folder when i plug in the usb, or may be you have suggesting some command or some rules to open directory in terminal


pcmanfm-qt > Edit > Preferences > Volume >
Mount removable media automatically when they are inserted

1 Like

I’ve done what you suggested and it still doesn’t work, but i have a commands “qterminal -w /xxx/xxx/123” because my file in usb working when i open the usb folder manually in terminal but when i make .sh file or add the command in crontab the command not working
any suggest to make the commmand working in crontab or .sh file? @humpty

1 Like

There is also another item under that;
“Show available options for removable media when they are inserted.”
You should try that. (you must eject the drive from within pcmanfm-qt for it to work).
When you insert the usb, a dialog should pop up and you can open the file-manager.

1 Like

when i inserted or ejected the usb its showing the dialog pop up and no have any problem with that
my application working when i open the folder with manually commands by terminal,
please read my reply above ,thasnk @humpty

I feel I have missed something. When you say “auto open folder” do you mean you want to open a directory of the usb ‘inside a terminal’ ?

sorry, i think this is mount problem, i try this :

  1. sudo umount -t vfat /dev/ABC /media/amg/XXX
  2. sudo mount -t vfat /dev/ABC /media/amg/XXX
  3. eject & plugi in the usb
    and its working, my questions is :
  4. how to fix the mount problem permanently?
  5. how to fix the label/name ABC & XXX permanently for all usb?
    so when i the OS start I don’t need to run umount/mount manually


1 Like

Rather than bore you with why your problem is not trivial,
let me just recommend the easiest route;

The file manager I use, (an old GTK fork of PcManFM) is called
SpaceFM. (apt-cache search spacefm).

With spacefm I would just do this;

Devices > Settings > Auto Mount> Mount Removable
Devices > Settings > Auto Run > On Insert > qterminal -w %m

(also make sure pcmanfm-qt auto-mount is off)

and that’s it.

(You don’t really want to know the alternative way, but you can
google around, just search for horrendous, mount udev systemd …etc. Basically, systemd/udev does not let you unless you use it’s methods)


This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.