LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-11-2008, 10:34 PM   #1
tiberian
LQ Newbie
 
Registered: Jun 2008
Posts: 3

Rep: Reputation: 0
is Thunar the only solution?


hi guys, i'm a puzzled man. let me explain. i'm a fluxbox and thunar user and every time i insert a cd or usb, i only have to open thunar and the newly inserted device pops up automagically in the thunar menu. one click and i can access the files as a common user.

now, this makes me suspect that there is maybe a simple terminal command to have access to the new inserted devices without the help of thunar and without being root or modifying fstab, since i've been able to mount/umount everything as a common user, but with thunar, and thunar must be using some unknown command (for me). any thoughts wd be really appreciated
 
Old 06-11-2008, 11:10 PM   #2
elliott678
Member
 
Registered: Mar 2005
Location: North Carolina
Distribution: Arch
Posts: 977

Rep: Reputation: 72
Thunar uses the HAL daemon to mount and dismount removable media automatically. I don't know if there is a CLI way to control HAL, I haven't seen one yet.
 
Old 06-12-2008, 12:03 AM   #3
snowtigger
Member
 
Registered: Mar 2005
Location: england
Distribution: slackware, win2k
Posts: 364

Rep: Reputation: 34
This one intrigued me. So i thought i'd have a little look.

I think you are looking for exo-mount, exo-umount and exo-eject.

However when i had a little play with a usb stick which was mounted at /media/disk and done a quick "exo-umount /media/disk" it says "exo-unmount: Must specify HAL device UDI or device file." So the next thing would be to work out the UDI.

But for me that will be another day.


Last edited by snowtigger; 06-12-2008 at 12:05 AM. Reason: spelling
 
Old 06-12-2008, 07:56 PM   #4
tiberian
LQ Newbie
 
Registered: Jun 2008
Posts: 3

Original Poster
Rep: Reputation: 0
thanks my friend, that's new for me, and i just tested it and got the same answer from the sytem, so what's next? doesn't matter, for at least i have a clue right now, i'm going to investigate ex-mount/umount
 
Old 06-12-2008, 08:45 PM   #5
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,040

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Set udev rules.

http://www.reactivated.net/writing_udev_rules.html

For example, I have this on my /etc/udev/rules.d/99-usb-storage.rules file:

Code:
KERNEL=="sd*", SUBSYSTEMS=="scsi", ATTRS{model}=="DataTraveler 2.0", NAME+="kingston%n", GROUP="usb", MODE="0775"
ACTION=="add", NAME=="kingston[1-9]", RUN+="/bin/mkdir -p /mnt/kingston%n"
ACTION=="add", NAME=="kingston[1-9]", PROGRAM=="/lib/udev/vol_id -t %N", RESULT=="ext2", RUN+="/bin/mount -t ext2 -o rw,noauto,nodev,nosuid,noexec,noatime,users,group /dev/kingston%n /mnt/kingston%n"
ACTION=="add", NAME=="kingston[1-9]", PROGRAM=="/lib/udev/vol_id -t %N", RESULT=="ext3", RUN+="/bin/mount -t ext3 -o rw,noauto,nodev,nosuid,noexec,noatime,users,group /dev/kingston%n /mnt/kingston%n"
ACTION=="add", NAME=="kingston[1-9]", PROGRAM=="/lib/udev/vol_id -t %N", RESULT=="vfat", RUN+="/bin/mount -t vfat -o rw,noauto,flush,quiet,nodev,nosuid,noexec,noatime,users,group,umask=000 /dev/kingston%n /mnt/kingston%n"
ACTION=="add", NAME=="kingston[1-9]", RUN+="/bin/chmod 0775 /mnt/kingston%n"
ACTION=="add", NAME=="kingston[1-9]", RUN+="/bin/chown root:usb /mnt/kingston%n"
ACTION=="remove", NAME=="kingston[1-9]", RUN+="/bin/umount -l /mnt/kingston%n"
ACTION=="remove", NAME=="kingston[1-9]", RUN+="/bin/rmdir /mnt/kingston%n"
When the usb key is plugged, this automatically creates a mount point under /mnt, mount the device under it selectively, depending on the detected filesystem (I use many usb storage devices, with different filesystems), and when I plug it off, it forces the umount of the device (yeah, it's ugly, but as long as you use sane mount options you are not going to have a problem, in any case you can always make a manual sync before you unplug).

Other than that, you could very well use ivman as well, which is a dbus/hal based program that can automatically mount and umount removable devices.
 
Old 06-12-2008, 09:38 PM   #6
tiberian
LQ Newbie
 
Registered: Jun 2008
Posts: 3

Original Poster
Rep: Reputation: 0
thank you i92, i'm going to test both options, at first sight it seems the udev rules strategy is a little bit difficult, but, i know from experience that with some time i will become familiarized with it. i don't know about ivman, but then again, yet another clue to investigate, learn and possible solve the problem of automounting via CLI or something simple without gui help.
 
Old 06-12-2008, 09:42 PM   #7
elliott678
Member
 
Registered: Mar 2005
Location: North Carolina
Distribution: Arch
Posts: 977

Rep: Reputation: 72
The udev method is great for USB devices. It is actually very simple to add, assuming your distro already uses udev, which most do. The only drawback with it is the lack of support for CD/DVD automounting.
 
Old 06-12-2008, 09:51 PM   #8
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,040

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Quote:
Originally Posted by elliott678 View Post
The udev method is great for USB devices. It is actually very simple to add, assuming your distro already uses udev, which most do. The only drawback with it is the lack of support for CD/DVD automounting.
That's true as far as I know. In that case, ivman is what I'd use if I wanted to automount a cdrom. However, it failed for me in lots of colorful ways in the past, forcing me to umount -l the drives and confusing the system and lots of programs.
 
  


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
Slackware 11 + Fluxbox + Thunar?? juboba Linux - Software 5 10-20-2010 07:57 AM
thunar not showing icons galen MEPIS 2 08-24-2008 07:14 AM
Icon problem with thunar dissociative Slackware 2 09-14-2007 09:09 PM
Thunar slackware 11 millionknives Linux - Software 5 04-04-2007 10:30 PM
Thunar issue thelastknowngod Slackware 2 02-13-2007 10:34 AM


All times are GMT -5. The time now is 12:39 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration