Hooking up my Verbatim external hard drive

logo

Just today I bought a new Verbatim external hard drive for my Linux machine. It’s a nice, small 160GB USB 2.0 hard drive. Getting it set up on ArchLinux with autofs was super simple. When you access the drive, it automatically mounts, and unmounts after a couple seconds of no activity. It works great. Here’s how to do it.

Setting up udev

The first order of business is getting udev to recognize the device and assign it the same device file everytime. I wanted it to show up as /dev/verbatim. First of all, I needed to see how it’s identified by Linux. So I plugged in the device, ran dmesg, and determined the USB address:

scsi 6:0:0:0: Direct-Access     TOSHIBA  MK1637GSX             PQ: 0 ANSI: 2

Now I went into the sys filesystem to get the vendor and model information to help udev identify this device in the future. Using the USB address above — 6:0:0:0, I descended into the directory:

cd /sys/bus/scsi/devices/6:0:0:0
cat vendor
cat model

That gave me the values of “TOSHIBA” and “MK1637GSX”. Ok, so I could have gotten that from the dmesg output, but I wanted to make sure I was looking at the right fields.

Now I was ready to create my udev rule. I put the following in /etc/udev/rules.d/60-verbatim.rules:

BUS=="scsi", SYSFS{vendor}=="TOSHIBA", SYSFS{model}=="MK1637GSX", NAME="verbatim", GROUP="storage", MODE="0660"

Since my user wasn’t in the storage group I had to add him:

sudo gpasswd -a username storage

Alright! Now we have a stable device everytime we plug in the drive.

Setting up autofs

This part is simple. We just want the autofs daemon to pay attention every time the /dev/verbatim device shows up on the system, and handle auto-mounting and unmounting it as it is accessed.

I made sure the following line is in /etc/autofs/auto.master:

/media /etc/autofs/auto.media --timeout 2

Then I added the following line to /etc/autofs/auto.media (where 95 is the storage group id) to automount the device onto /media/verbatim:

verbatim -fstype=vfat,async,rw,gid=95,umask=002 :/dev/verbatim

Now, just restart the autofs daemon:

/etc/rc.d/autofs restart

All done!

That’s all it takes. Make sure the drive is unmounted, unplug it, plug it back in and take a look at your /media/verbatim directory. As you access it, you’ll see it’s automatically mounted (run mount). After a couple seconds of no activity, the drive will auto-unmount.

Was this helpful? Please let me know!


Related Posts

Tags:
Posted in solutions on April 11th, 2008 | No Comments »


iPod Shuffle without a GUI

logo

The autofs solution for the iPod Shuffle that I discussed last month has been working out great. But what about a command-line approach to managing your music on the iPod Shuffle? You can use the iPod shuffle Database Builder.

» Read the rest of this entry


Related Posts

Tags:
Posted in solutions on December 4th, 2007 | No Comments »

iPod Shuffle and Linux

logo

The iPod Shuffle is about as minimalistic as a music player can get. It’s small, has 1GB of space on it, no batteries and no moving parts. The power jack is the earphone jack is the USB connector. I love it. Especially since I didn’t pay anything for it.

The problem was getting it hooked up to Linux. Here is what I was looking for. I wanted a setup where I plug the iPod into the computer and it automounts it. I want a simple GUI that allows me to easily manage the files on the iPod. It should be able to convert other formats into mp3 files. It should have playlist support to make it easy to swap preset music selections in and out. And when I’m all done, the iPod should automatically unmount so that I can unplug it. Basically, I need this to be a no-hassle, quick-and-easy, GUI solution.

Here’s how I did it. » Read the rest of this entry


Related Posts

Tags:
Posted in solutions on November 27th, 2007 | 2 Comments »