I want to be able to easily mount and unmount my pendrives, and I want them to be automounted as soon as they are plugged in.
However:
The plasmoid Device Notifier does not automount.
The plasmoid device notifier with automount is not being developed anymore (AFAIK) and I haven’t been able to install it.
Whenever I mount a pendrive with the Device Notifier and write sth to it with thunderbird, I can’t unmount it afterwards.
I don’t know how to get ivam working.
Halevt is not in the repositories.
Therefore, I tried with the following messed up alternative:
**1) **I placed the following script in the autostart folder:
#! /bin/bash
rm -f /tmp/de-mounted.txt
while :
do
PRESENT=$(hal-device | grep "/dev/sdd")
MOUNTED=$(mount | grep "/dev/sdd")
function III
{
if -f /tmp/de-mounted.txt ] ; then
echo "Demounted"
if -z "$PRESENT" ] ; then
rm -f /tmp/de-mounted.txt
echo "Demounted removed"
fi
fi
if -z "$PRESENT" ] ; then
echo "It is not there"
else
echo "It is there"
if ! -f /tmp/de-mounted.txt ] ; then
if "$MOUNTED" != "/dev/sdd on /media/pendrive type vfat (rw,iocharset=utf8)" ] ; then
echo "It is not mounted .. mounting"
sudo /bin/mount /dev/sdd /media/pendrive/ -o iocharset=utf8
konqueror /media/pendrive
fi
fi
fi
}
III
sleep 4
done
**2.) I created two icons in a panel:
** a) An icon to mount the pendrive on demand with the following command:
MOUNTED=$(mount | grep "/dev/sdd") ; if "$MOUNTED" != "/dev/sdd on /media/pendrive type vfat (rw,iocharset=utf8)" ] ; then sudo /bin/mount /dev/sdd /media/pendrive/ -o iocharset=utf8 ; konqueror /media/pendrive; else kdialog --passivepopup "El pendrive ya está montado." ; konqueror /media/pendrive; fi
** b)** An icon to unmount the pendrive and prevent the first script from remounting it endlessly:
sudo /bin/umount /dev/sdd ; touch /tmp/de-mounted.txt ; ISITMOUNTED=$(hal-device | grep "volume.mount_point = '/media/pendrive' (string)") ; if -z "$ISITMOUNTED" ] ; then kdialog --passivepopup "El pendrive está desmontado. Por favor extraigalo pa que no se derrita."; fi
All the sudo line have been added to sudoers.
As it is, everything works great. Or so I thought:
I can’t write to the pendrive!!!
Any help, please?
(I know that this method is a god **** mess, but it’s the only solution I could come up with.)