You are not logged in.
Pages: 1
Topic closed
I've trying to automount USB drives by the method suggested in Auto-mounting with udev.
When I insert a USB drive in, a terminal pops up that says "mounting ... to ...", and immediatly after it asks for my password. If I enter my password, the terminal will just disappear.
I tried to use the "ls" function with the directory path that the usb is mounted to, but it always shows nothing (both before and after I insert my password for the previously mentioned part).
So my question is:
Does the script actually work, or am I typing something in wrong?
Thanks for reading, and any replies are much appreciated.
Last edited by PPeter (2012-08-25 13:32:34)
Offline
use udisks & a helper like devmon
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
Perhaps...light device mounter....ldm in the aur..... is what you would like. It mounts all partitions and usb devices thru media directory.
Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit! X-ray confirms Iam spineless!
Offline
I'm using devmon to get it going and it's working pretty well now, so thanks for the suggestion. I'm also wondering about the deamon capabilities of it.
Being relatively new to deamons, I'm wondering if including just devmon in the rc.conf file would be enough to get it working. I read in the help file that even when it is run as a deamon, you have to add another command to it. So would I be able to write something like:
DEAMON= {... devmon --exec-on-drive /media ...}?
Offline
You don't put devmon into rc.conf. You put it into .xinitrc or what your DE/WM uses for startup items.
Offline
Alright. Thanks for the help everyone, I got it working.
Offline
I configured the Automount with Udev (https://wiki.archlinux.org/index.php/US … ge_Devices) from the wiki. However, when I insert any usb media, nothing happens. Any pointers?
Here is my domount file:
#!/bin/sh
#edit the following variables to suit your needs
MYUID=1000 # your user uid
MYGID=100 # your user gid
MYLOGIN=shantanu # your login
TERM=urxvt # your terminal emulator
MYSHELL=bash # your shell
export DISPLAY=:0 # your X display
TMPFILE=/run/automount.$RANDOM
DIR=`cat /etc/fstab | grep -v '#' | grep $* | awk '{print $2;}'`
if [ "x$DIR" = "x" ]; then
MYUUID=`blkid -o value -s UUID $*`
if [ "x$MYUUID" = "x" ]; then
MYUUID="unknown"
fi
DIR=/run/media/$MYUUID
fi
mkdir -p /run/media
mkdir -p $DIR
cat > $TMPFILE << EOF
#!/bin/sh
echo "$* will be mounted on $DIR. "
sudo /bin/mount -o uid=$MYUID,gid=$MYGID $* $DIR
cd $DIR
$MYSHELL
cd
sudo /bin/umount $DIR
EOF
chmod a+x $TMPFILE
su $MYLOGIN -c "$TERM -t 'Terminal - $* mounted on $DIR' -e $TMPFILE"
sleep 1; rm -f $TMPFILE Last edited by ravisghosh (2013-04-24 20:36:51)
Offline
Ravi, do not necrobump old -- especially solved threads. You have been here longer than many. You should know the forum rules.
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
Pages: 1
Topic closed