Topic: Michał Górny's uam - a simple, hal-free USB automounter

I ran into uam, Michał Górny's neat little USB automounter when working on a minimal Debian system this week. As near as I can tell, it hasn't been posted to the #! forums, so here you  go ...

Uam runs directly from udev triggers, so you don't have to marry into the whole fam-gamin-udisks-autofs-hal family to get USB automounting.  It works just fine in my hands.  Because it works directly from udev without spawning a runtime daemon,  you have to sync and/or unmount the USB devices manually.

Obviously uam is not needed on a Crunchbang system, but it's a nice lightweight way to get USB sticks mounted without a lot of typing and daemonic overhead.

If you're a trusting soul, and I hope you're not, you can run the script below at your own risk. I would recommend using the script as a guide and entering the commands from a terminal so that you can deal with errors as they occur.

#!/bin/sh

# uam install script
# tranche

# Installs Michal Gorny's uam hal-less usb automounter
# uam = usb automounter
# not Universal Access Method

# You can read the README file here to decide if uam is something you want
# https://github.com/mgorny/uam

# If you don't have the git and autoconf packages, uncomment the following line
# sudo aptitude install intltool git autoconf

# NOTE: The script assumes you have a source directory called "src" 
# below the current directory.  (Ordinarily your home directory)
# If you don't have "src" the script creates it
# It then creates a subdirectory "src/uam" and builds the project there

# Create the build directory and get positioned to run git
mkdir -p src/uam
cd src/uam

# Get the sources from github
git clone https://github.com/mgorny/uam .

# Generate aclocal.m4
aclocal

# Generate a configuration script from template
autoconf

# Supply missing directory and files to avoid automake errors
touch AUTHORS NEW Changelog
mkdir build-aux

# Generate makefile.in, supplying missing elements as needed
automake --add-missing

# It's a good time to make a backup of the project
# before you clutter up the directory by doing the build
# (Best to change the filename to reflect the current git commit date)
# Uncomment the next three lines if you want to do this
# cd ..
# tar czf uam-git-mgorny-2011-01-30.tgz ./uam
# cd uam

# Do the build 
./configure
make

# Uncomment the next line to install the program
# Best to leave it commented out until you're sure the build ran properly

# sudo make install

If anyone tries it out, I'd love to hear how it goes.

Last edited by tranche (2011-04-12 03:43:41)

Re: Michał Górny's uam - a simple, hal-free USB automounter

nice, thx.. will look into it more!!

Well, you gotta live no matter what happens.  -Dallas (John Ford's Stagecoach 1939 Public Domain)

Re: Michał Górny's uam - a simple, hal-free USB automounter

Worked for me.  Very nice as there are no build instructions on Michal Gorny's page.

One small detail that tripped me up for a while - there needs to be "plugdev" group otherwise uam will fail when it tries to mount a usb device.

Last edited by waterwingz (2012-02-05 19:19:23)

Re: Michał Górny's uam - a simple, hal-free USB automounter

before trying this out, let me ask one thing: how is this different from bashmount?

Re: Michał Górny's uam - a simple, hal-free USB automounter

rhowaldt wrote:

before trying this out, let me ask one thing: how is this different from bashmount?

I haven't used bashmount but a quick look at the link you provided tells me that it's a script for manually controlling the mounting & unmounting of USB devices.   It does not support automounting.  Automoutning is what uam is for.

Re: Michał Górny's uam - a simple, hal-free USB automounter

^ cool, thanks. might check it out later.

Re: Michał Górny's uam - a simple, hal-free USB automounter

It sounds similar to usbmount http://packages.debian.org/squeeze/usbmount

If not using a automagical file manager (or usbmount) then I usually use pmount, a simple pmount sdb1 will create the sdb1 mount point in /media and mount /dev/sdb1 and it works for my extra partitions as well as  usb devices and such.

Last edited by AnInkedSoul (2012-02-06 00:46:19)

refracta - a small bottle of debian magic