How-to auto-mount volume when clicking on it ?

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
lvds
Posts: 340
Joined: Tue 23 Jan 2007, 15:15
Location: Near the window

How-to auto-mount volume when clicking on it ?

#1 Post by lvds »

Hello,

I haven't found a document explaining simply how to implement auto mount feature so an average user can access volumes without wondering if they are mounted or not ... May someone point me to such a document if it exists or explain here the process to implement this feature ?

Thanks...

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#2 Post by sunburnt »

Hi lvds; Here's a image file mounter I wrote awhile back.
Clicking on certain file types will mount/unmount the file.
OR... right click on the file: [File 'file name'] [Open With..] [Un_Mount]
File types are: image.gz, image, initrd.gz, initrd, *.sfs, *.2fs, *.3fs, *.img

It's also a GUI app., run the file "xfilemount" & a file chooser dialog pops up.

Hope it helps you in your Linux journey, ask if you need more help...
Attachments
xFileMount.pup
Sorry about forgetting the file the first time I posted...
(2.91 KiB) Downloaded 256 times
Last edited by sunburnt on Mon 12 Feb 2007, 11:07, edited 1 time in total.

muggins
Posts: 6724
Joined: Fri 20 Jan 2006, 10:44
Location: hobart

#3 Post by muggins »

or did you want to automatically mount partitions?

if so, you could have a script to mount & open /dev/hda4 with:

Code: Select all

#!/bin/sh
mount /dev/hda4 /mnt/hda4
rox -d /mnt/hda4
if you made this executable by changing the permissions, dragged it to desktop, then clicking on this file will open up hda4. i'm not sure how you would allocate the rox hda4 icon to it though.

also it could be risky if you did something similar with a usbkey, as i thought you had to umount them before unplugging.

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#4 Post by rarsa »

Let's clarify:

You cannot click on a "volume" (partition) if it is not mounted.

The suggestion to create a script to mount it will create that illusion. Even better if you make that script a ROXapp.


A ROX app is no more than a folder with at least to "special" files, one describing the app and a script that does whatever you want.

In particular, I created a ROXapp that allows my sons to access a shared folder in another computer:

1. Checks if the other computer is turned on
1.1 if it is not, it shows a message saying so.
1.2 if it is, it mounts the share in the same location as the roxapp. masking the roxapp and opens that folder.

It gives a pretty good illusion as it looks just as any other folder.

The only issue is unmounting. You have to right click on the folder and select "unmount". If my sons turn of the other computer without unmounting the share, the computer slows down as rox keeps trying to access the mount.

Something may happen for USB devices or floppies. If the user plugs them out witout properly unmounting of flushing, the data they though they had saved, may actually not be on the device.

Search the forum for an "automounter" that some people were working on. That may be another solution.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#5 Post by GuestToo »

Rox will do that ... just add the appropriate entries in /etc/fstab

for example, Rox should automatically mount and unmount your cd drive if you put a line like this in fstab:

/dev/hdc /mnt/cdrom iso9660 ro

this is supposed to work:

/dev/hdc /mnt/cdrom iso9660,udf ro

this should mount the cd disk automatically whether it's a regular cd or a udf disc ... it doesn't work because mount is Busybox ... but it does work if you use the mount-FULL executable

one way to work around Busybox, if you don't want to use the real mount executable, is to have 2 entries in fstab, like this:

/dev/hdc /mnt/cdrom iso9660 ro
/dev/hdc /mnt/udf udf ro

and this works for hard drive partitions too ... for example, if you put entries like this in fstab, Rox will mount and unmount the partitions when you click on the mount points (for example, /mnt/hda5, /mnt/hda6 ...):

#
/dev/hda5 /mnt/hda5 vfat noauto,noexec
/dev/hda6 /mnt/hda6 vfat noauto,noexec
/dev/hda7 /mnt/hda7 vfat noauto,noexec
#
/dev/hda9 /mnt/hda9 reiserfs defaults,noauto
/dev/hda13 /mnt/hda13 ext3 defaults,noauto
/dev/hda15 /mnt/hda15 ext3 defaults,noauto
#

all Puppy needs to setup Rox to automatically mount and unmount partitions is a script to setup fstab when Puppy boots (like Knoppix does)

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#6 Post by sunburnt »

Yes, like if in addition to putting the partition info in /tmp/fsparts.txt, it put it in fstab also.

As MANY have suggested here... Default auto. mount ALL partitions at boot.
Loop devices aren't used for partitions, it seems very little resources are used.


I haven't tried it but... why not do: mount -t $TYPE -o sync (USB, floppy, etc) (MntPt)
If mounted synchronusly, all writes to the device should occur immediately.

I intend to use synchronus type mounting for a newer version of usb-auto,
this way the daemon's process loop which searches for devices won't have to
do a "sync" command every 4 seconds to insure that data is written.

User avatar
lvds
Posts: 340
Joined: Tue 23 Jan 2007, 15:15
Location: Near the window

#7 Post by lvds »

Many thanks

I discovered thunar from xfce does also auto-mount partitions ; i will experiment on this to try to determine what is best. thanks again.

Best regards,
Laurent

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#8 Post by rarsa »

GuestToo wrote:Rox will do that ... just add the appropriate entries in /etc/fstab
I always forget that the ephemeral fstab problem is long gone.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#9 Post by GuestToo »

well, for Puppy 1.x you could put a line like this in rc.local ... cat /etc/fstab.local >> /etc/fstab and put your configuration in fstab.local ... it wouldn't automount drives when Puppy boots, but Rox would be configured to automount your drives ... and maybe the init scripts could be modified to automount drives from fstab when Puppy boots

fstab can be editied in Puppy 2.x, but it might be a good idea to back up the changes somewhere ... Puppy sometimes writes over system files without asking

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#10 Post by sunburnt »

Just put a line in /etc/rc.d/rc.local to do the fstab copy over if it's needed,
& then the line "mount -a" which mounts all the partitions listed in fstab.

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#11 Post by Dougal »

GuestToo wrote:Rox will do that ... just add the appropriate entries in /etc/fstab
Doesn't it require that you click on the green "button" first, on the "mountpoint" icon?
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

Post Reply