automount with ivman


I need to be able to save files across to USB sticks and to back up /home with a portable hard drive. The ‘mount’ command could be used, possibly with scripts, to achieve this, but I’ve been spoiled by automount with icons on the desktop.

To add automount (although not the icons) to the minimal desktop, you

  • su
  • aptitude install ivman and pmount
  • the installer registers ivman daemon so it starts on boot, but you also need to run it under your user identity. As I don’t have a desktop manager, and because I sometimes use the terminal before starting Xorg, I added a line to my .bashrc file at the end. The line i’m using at the moment is
    ivman --nofork > /dev/null 2>&1 &
    and that seems to do the trick. The command line consists of the –nofork option flag for ivman, and then a redirection command that sends error messages and other interactive information to nowhere (dev/null) so the output does not suddenly emerge in a terminal window when you are doing something else. The trailing & tells ivman to carry on running in the background.
  • So now USB sticks and a small USB hard drive have been automatically mounted at the appropriate location under /media/device. Device names are typically usbdisk and sda2 for the hard drive, but can always be found by using the
    cat /media
    command. To unmount a device, just issue
    pumount device_name
    I still see no reason for a file manager, I’m quite happy with cp, mv and rm from the command line. I will probably install midnight commander at some point.
  • Of course, my t-mobile Web’n’walk modem is recognised as a mass storage device, because it is one! I’m working on ways I can make an exception so that I can continue to be able to dial up with the mobile Web. The device name appears as web’n’walk which is really useful on a command line where ‘ has significance. I used web* in commands. I might see if I can unmount the device and use the modem part in a bit.

Things learned on the way

Even though the default user is part of the ‘plugdev’ group and so can see, read and write to the floppy disc, cd-roms and USB sticks when ivman is run as root only, the default user can’t unmount the devices! To have user level unmount needs a user instance of ivman, and if you don’t the error message ‘you did not mount the device’ or similar appears.

I’ve also found out that Debian does not provide a local .xinitrc file in my home directory, and, apparently has not used such files for some time. I used .bashrc which does exist.

To find out which groups you belong to, type id at a terminal prompt. You should see a list like this…

uid=1000(keith) gid=1000(keith) groups=20(dialout),24(cdrom),25(floppy),29(audio),44(video),46(plugdev),1000(keith)

Debian still has a separate root log in with a different password. You can add yourself to the ‘sudoers’ group so you can use an Ubuntu style sudo command from your own user identity within a terminal window. I suspect I may have to do that to allow quick shutdown and automatic log into X.

Pages used include


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: