The Chavers

Rob, Missy, Olivia, Genevieve, family and friends.

mythbuntu usb drive automount

E-mail Print PDF
I had an avi file from a vacation on a usb flash drive that I wanted to watch from my mythbuntu frontend machine tonight.  I thought I'd simply insert the usb drive in the frontend and mythtv would auto-mount and show me the contents... boy was I wrong.  First, I needed to navigate to Setup->Videos Settings->General Settings (1/7)->"Directories that hold videos:" and add :/media/usbstick1 ( note the colon ).  So, my complete string looks like this:  "/var/lib/mythtv/videos:/media/usbstick1"  Next, I needed to find a way to have mythbuntu ( or any ubuntu ) auto mount a usb drive.  Note, I've hard coded these locations, so this may need to be changed for your setup ( but I will prob. never have more than one usb drive in my frontend ).
 
 
 To get hal to auto-mount my usb drive when I insert it, and remove the mount when I remove the drive, there are a few steps that need to be completed.
 
 
First, you need to get hal to do a few tricks.
 
create a file in /etc/hal/fdi/policy/99-rac.fdi with something like this:
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
  <device>
    <match key="access_control.type" string="removable-block">
      <match key="volume.is_partition" bool="true">
        <append key="info.callouts.add" type="strlist">hal-rac-mount-usb.sh</append>
        <append key="info.callouts.remove" type="strlist">hal-rac-umount-usb.sh</append>
      </match>
    </match>
  </device>
</deviceinfo>
 
 Next, the scripts referenced about in the callouts sections *MUST* be placed in /usr/lib/hal , and prob. be executable( ie. chmod +x ...filename... )
 
In my case, /usr/lib/hal/hal-rac-mount-usb.sh contains:
#!/bin/sh
/bin/mount -t auto /dev/sdb1 /media/usbstick1
 
and /usr/lib/hal/hal-rac-umount-usb.sh contains:
#!/bin/sh
/bin/umount /dev/sdb1


Last Updated on Friday, 09 January 2009 03:36  

Random Image

Sea Life Park
 
 
Sea Life Park Date: 10/18/2007

Login Form