Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
You can use autofs. I'm using it with my usb stick and it works quite well. The only prob is that sometimes I have to run a command (like ls or cp) 2 times to be able to use the stick. I guess this happens cause the device for some reason is not ready the first time. Perhaps I have to use the ghost option so the mount point is always present.
I use rox-filer as my file manager and it reads my fstab and automaticaly attempts to mount the device if you go to open the mount point. so i imagine my automouter is rox-filer.
I primarily use WindowMaker, and have created menu items that mount the device, then start mc with the desired folders ready to go. On quitting mc the device umounts. For example, here's the menu entry for "mount camera":
Quote:
mount /mnt/dsc-p52 ; sleep 2 ; xterm -geometry 96x60 -e mc /mnt/dsc-p52/dcim/101msdcf /home/share/pictures ; umount /mnt/dsc-p52
I like it because it's quick and easy, and it works for me because I never have more than 1 USB device plugged in at a time. If I did have multiple devices connected in random order, I suppose I would have to write a small script to see which block device was being used for each.
I mount everything (except for the hdd-partitions that comprise my
slackware, of course) manually ... well, mostly. I did write a script
that mounts my usb key via usbmanager.
I primarily use WindowMaker, and have created menu items that mount the device, then start mc with the desired folders ready to go. On quitting mc the device umounts. For example, here's the menu entry for "mount camera":
mount /mnt/dsc-p52 ; sleep 2 ; xterm -geometry 96x60 -e mc /mnt/dsc-p52/dcim/101msdcf /home/share/pictures ; umount /mnt/dsc-p52
hi ciotog, i mount my dvd writer drive in much the same way, with a menu item to first mount the drive, then open emelfm2 filemanager to the dvd's directory. but i have looked at your commands above and cannot see how to unmount the drive once emelfm2 filemanager is closed. can you explain what i need to add to this code to do that? 'mount /mnt/dvd && emelfm2 --one=/mnt/dvd'
The semicolon instructs the shell to run the following command after the prior one has finished, so you should be able to simply put " ; umount /mnt/dvd" at the end. Of course this doesn't work if emelfm2 releases the shell upon running (like some programs do).
ciotog, i have just checked and emelfm2 does release the shell, so it wont work, which is a shame because it would have been great. oh well, ill try an automounter prog. thanks anyway
soldan, I just installed emelfm2 and in the man page it mentions that the "-n" switch keeps the program from detaching from the terminal, so you could use this in your menu item. emelfm2 looks rather nice, I think I'll try it out for a while.
Well i need more stuff about automounters. This isn't my n°1 priority so i have time to get feedback. Autofs seems to be the right choice as it's kernel-based...
IMHO, automounters are a lost cause. I suggest editing udev files to do it. With udev, you have more control where the device will be mounted because it can look up tons of information about the connected devie. Though I rather mount the device my self using the sudo command.
The semicolon does not verify that the command has succeded with out any errors. If you want to make sure it worked with out any errors, but do not want to resume to the next command sequence when there is an error, use &&.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.