[clue] problems with Debian

Shawn Perry shawn at redmop.com
Tue May 31 09:46:07 MDT 2011


I have a udev script that will mount anything usb drive related to
/media/<label> or /media/<other drive ID>, in that order.

# Test rule for automounting a usb stick to either /media/{ID_FS_LABEL} if
it
# has a label or /media/usbhd-%k if it doesn't have one and then running a
# script on it (commented out below).

# udev rule by Shawn T Perry
# Contact Info: c:720-319-7627 e:shawn at redmop.com

# Skip rule if not a disk
KERNEL!="sd[a-z][0-9]", GOTO="media_by_label_auto_mount_end"

# Import FS infos
IMPORT{program}="/sbin/blkid -o udev -p %N"

# Get a label if present, otherwise specify one
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
ENV{ID_FS_LABEL}=="", ENV{dir_name}="usbhd-%k"

# Global mount options
ACTION=="add", ENV{mount_options}="relatime"
# Filesystem-specific mount options
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs",
ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"


# Make directory for automounting
ACTION=="add", RUN+="/bin/mkdir -p '/media/%E{dir_name}'"
# automount ntfs filesystems using ntfs-3g driver
ACTION=="add", ENV{ID_FS_TYPE}=="ntfs", RUN+="/bin/mount -t ntfs-3g -o
%E{mount_options} /dev/%k '/media/%E{dir_name}'"
# automount all other filesystems
ACTION=="add", ENV{ID_FS_TYPE}!="ntfs", RUN+="/bin/mount -t auto -o
%E{mount_options} /dev/%k '/media/%E{dir_name}'"


# Run Script
#ACTION=="add", RUN+="/root/bin/test.pl %k %E{ID_MODEL_ID}"


# Clean up after removal
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l
/media/%E{dir_name}", RUN+="/bin/rmdir /media/%E{dir_name}"

# Exit
LABEL="media_by_label_auto_mount_end"


Shawn T Perry
Red Mop Computing Services
email: shawn at redmop.com
office: 720-319-7627
cell: 303-881-2623
web: http://www.redmop.com
facebook:
http://www.facebook.com/pages/Red-Mop-Computing-Services/114352628589778
linkedin: http://www.linkedin.com/in/shawnperry


On Tue, May 31, 2011 at 9:32 AM, marcus hall <marcus at tuells.org> wrote:

> On Mon, May 30, 2011 at 4:57 PM, Louis Miller <veganguy at canadaseek.com>
> wrote:
>
> >       I'm trying to switch from Ubuntu to Debian. I plugged in my USB
> hard
> > drive into Ubuntu and it always recognizes it and puts the little icon on
> > the screen. With Debian, they don't make it quite so easy. My hard drive
> > didn't get mounted. I went
>
> Depending on which version of Debian you are using, there may be two paths
> to
> look into..  The 'hal' process is deprecated and distributions are going
> through the process of removing it.  You probably want to try to find out
> if
> the version of debian you are using has done this or not (Ubuntu 11.04 has
> removed hal).
>
> If hal has not been removed, then it plays a big part in automounting usb
> devices.  If it has been removed, then aparently the udev process
> cooperates
> with the volume manager to get things mounted.
>
> The whole strategy seems to be relatively undocumented, and I have a
> mythbuntu box that has been updated to 11.04 and is now no longer
> automounting
> usb devices.  I can see (via "udevadm monitor") that udev detects the
> device being plugged in, but I'm still searching for the next step in the
> chain.  I think that I need to be looking into the thunar volume manager
> next, but I haven't dug much into that yet.  (Not a huge priority at the
> moment, so I may not get around to it for some time yet...)
>
> marcus hall
> marcus at tuells.org
> _______________________________________________
> clue mailing list
> clue at cluedenver.org
> http://cluedenver.org/mailman/listinfo/clue
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cluedenver.org/pipermail/clue/attachments/20110531/e774b256/attachment.html 


More information about the clue mailing list