site  contact  subhomenews

Automounting fixed

May 16, 2012 — BarryK
Forum member bala4dj asked how to automount drives when they are plugged in:
http://murga-linux.com/puppy/viewtopic.php?t=78321

I replied that the Puppy Event Manager already supports that. Bala4dj replied that it only launches Pmount, doesn't automount.

The Event Manager is in the System menu, and the 'Icon Handler' tab has checkboxes labeled:

Tick box for auto-detection of target application
Tick box for auto-launch 'handler' when media plugged in


The first is ticked by default in Puppy. if the second one is ticked, if you plug in a DVD video then the default DVD player will automatically run. Similarly, plug in a music CD and the default music player will run.

The original intention was that this auto-launching of the 'handler' would also automount a drive if it is plugged in. However, at the time I constrained it to only launch Pmount.

I have now fixed it. If both of those boxes are ticked (and X restarted), if a USB drive is plugged in, all of it's partitions will automount and ROX-Filer windows will open.

Woof commit:
http://bkhome.org/fossil/woof2.cgi/info/c2d6e84dff

A note to developers about /usr/local/bin/drive_all. When a drive is plugged in, icons get created on the desktop, and corresponding directories get created in /root/.pup_event.
For example, for /dev/sda3, directory /root/.pup_event/drive_sda3 is created, with script 'AppRun' inside it -- that script is a copy of 'drive_all'.
When someone clicks on the 'sda3' icon, 'AppRun' will execute.
The script responsible for setting all this up is /sbin/pup_event_frontend_d, which is launched as a daemon when X starts.

Comments

Still a problem maybe?
Username: bigpup
From this post on forum: http://www.murga-linux.com/puppy/viewtopic.php?t=78321 Hi Barry, many thanks for that fix ! (running on slacko 5.3.1 k2.6.37.6) here installed the new drive_all script; The automount works OK when pluging in an USB flash drive, on an already running Puppy. But upon bootup it does not automount already pluged in USB drive. One has either to click on their icon, or to unplug and replug it, to get it mounted. Should it go that way , should'nt it? Cheers, Charlie

Still a problem maybe?
Username: charlie6
"Hi, Wondering if the drive_all script is compatible with some puppies flavours: here went to test drive_all on dpup-exprimo 5X3.2.14 - no difference ... even after reboot and check for executability. Best regards.

Syntax error in drive_all
Username: BarryK
"There was a syntax error in my Woof commit. A weird one, had to put in some quotes. This is for script 'drive_all': Woof commit: http://bkhome.org/fossil/woof2.cgi/info/8ecbca0fdd bigpup, That is right, the automounting only takes affect when a drive is plugged in. To automount at bootup, for already-plugged-in usb drives, you would need a little script. A script in /etc/rc.d/rc.local could do it.

re unplug usb
Username: K Godt
"bigpup, That is right, the automounting only takes affect when a drive is plugged in. Hmmm .. IDE boards with IDE kernels can distinguish external HDD from imternal HDD by the naming : hda for internal, sda for external because the usb-storage driver uses sda namings (too) . SATA enabled kernels lack this differentiation . rc.sysinit guesses by /proc/ide folder if SATA or IDE kernel is currently booting . External drives would be guessed as internals if plugged in at bootup with the current modern SATA kernels .


Tags: woof