<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://vic.gedris.org"  xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>vic.gedris.org - Linux</title>
 <link>http://vic.gedris.org/taxonomy/term/10/0</link>
 <description>Articles related to Linux</description>
 <language>en</language>
<item>
 <title>Hacker Bike Ride</title>
 <link>http://vic.gedris.org/HackerBikeRide2006</link>
 <description>&lt;p&gt;&lt;a href=&quot;http://vic.gedris.org/pics/2006-07-23/&quot;&gt;&lt;img class=&quot;left&quot; src=&quot;http://vic.gedris.org/pics/2006-07-23/SM-2006-07-23-010.jpg&quot; alt=&quot;Hacker Bike Ride&quot; width=&quot;160&quot; height=&quot;120&quot; /&gt;&lt;/a&gt;I was up in Ottawa for about a week recently.  I went there to attend the &lt;a href=&quot;http://www.linuxsymposium.org/&quot;&gt;Ottawa Linux Symposium&lt;/a&gt;, do some work at the Ottawa office, hang out with my &lt;a href=&quot;http://andrew.gedris.org/&quot;&gt;brother&#039;s family&lt;/a&gt;, and catch up with some of my Ottawa friends.&lt;/p&gt;
&lt;p&gt;Of course, no Linux Symposium is complete without the annual Hacker Bike Ride.  This ride has been happening for several years on the Sunday after the Symposium.  Basically, a whole bunch of Linux geeks gather up some bicycles and take a ride around the city.  It&#039;s an excellent social event, and the locals love to show off Ottawa&#039;s fantastic cycling and scenery to all the visitors from out of town.&lt;/p&gt;
&lt;p&gt;This year&#039;s ride started from the usual Col By Dr. meeting place, and went straight up Sussex Dr. towards the Ottawa River.  We followed Sussex Dr. past the Prime Minister&#039;s and Governor General&#039;s residences, and further east along the Rockliffe parkway.  We looped back down the Aviation Parkway and along Hemlock to the Rideau River.  Then we followed the Rideau River multi-use trail all the way up to Vincent Massey Park (near Hog&#039;s Back and Carleton University) for the annual &quot;Linux in the Wild&quot; BBQ hosted by the &lt;a href=&quot;http://oclug.on.ca/&quot;&gt;Ottawa Canada Linux Users Group&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;After hanging out in the park for a while, eating lots of BBQ food, etc., the hacker Bike Ride continued over Hog&#039;s Back Falls to the Rideau Canal, and back downtown to where we started.&lt;/p&gt;
&lt;p&gt;The evening continued with more bike geek goodness.  Of course, it was the usual weekly &lt;a href=&quot;http://hpv.tricolour.net&quot;&gt;HPVOoO&lt;/a&gt; gathering at the Vietnam Noodle House, followed by some bike swapping and a gelato run on Elgin St.  There was a huge turnout, especially with a few of the OLS people that came by as well.&lt;/p&gt;
&lt;p&gt;It&#039;s always fun to spend a day riding my bike around Ottawa.  I&#039;m also &lt;i&gt;very&lt;/i&gt; happy with the Bike Friday folding bike I bought earlier this year.  I love being able to take it with me whenever I travel.&lt;/p&gt;
&lt;p&gt;Here are my &lt;a href=&quot;http://vic.gedris.org/pics/2006-07-23/&quot;&gt;photos&lt;/a&gt; from Sunday.&lt;/p&gt;
&lt;!--break--&gt;&lt;!--break--&gt;</description>
 <category domain="http://vic.gedris.org/taxonomy/term/10">Linux</category>
 <category domain="http://vic.gedris.org/taxonomy/term/3">Bike Rides</category>
 <category domain="http://vic.gedris.org/taxonomy/term/5">HPVOoO</category>
 <category domain="http://vic.gedris.org/taxonomy/term/9">Geek Stuff</category>
 <category domain="http://vic.gedris.org/taxonomy/term/12">Ottawa</category>
 <pubDate>Thu, 27 Jul 2006 20:49:29 +0000</pubDate>
 <dc:creator>vic</dc:creator>
 <guid isPermaLink="false">63 at http://vic.gedris.org</guid>
</item>
<item>
 <title>USB Mass Storage Devices (Compact Flash Card Readers) in Linux</title>
 <link>http://vic.gedris.org/linux-UsbMassStorage</link>
 <description>&lt;p&gt;&lt;b&gt;Presented to &lt;A HREF=&quot;http://www.oclug.on.ca/&quot;&gt;Ottawa Canada Linux Users Group (OCLUG)&lt;/a&gt;, January 7, 2003.&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Last updated: 2003/05/22 18:26:14.  Please note that this document is several years old now.  With most modern Linux distributions, your USB Mass Storage Devices should probably work automatically.  Check your distribution&#039;s documentation.&lt;/p&gt;
&lt;p&gt;&lt;H2&gt;Introduction&lt;/h2&gt;&lt;/p&gt;
&lt;p&gt;This talk is based on my own experiences using the following hardware andsoftware:&lt;br /&gt;
&lt;UL&gt;&lt;br /&gt;
  &lt;LI&gt; SanDisk ImageMate SDDR-75 CF/SM Card Reader&lt;br /&gt;
  &lt;/li&gt;&lt;LI&gt; My parents&#039; PC with Redhat 7.2&lt;br /&gt;
  &lt;/li&gt;&lt;LI&gt; Home PC with Debian Unstable (my own kernel 2.4.18)&lt;br /&gt;
  &lt;/li&gt;&lt;LI&gt; Work PC with Redhat 8.0&lt;br /&gt;
  &lt;/li&gt;&lt;LI&gt; ....with a slant towards using it for reading digital pictures&lt;br /&gt;
&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;
&lt;!--break--&gt;&lt;!--break--&gt;&lt;p&gt;&lt;H2&gt;What is a USB Mass Storage Device?&lt;/h2&gt;&lt;/p&gt;
&lt;p&gt;&lt;UL&gt;&lt;br /&gt;
  &lt;LI&gt;&lt;I&gt;&quot;the driver is really an interface between the USB stack and the&lt;br /&gt;
         SCSI layer&quot;&lt;/i&gt;&lt;br /&gt;
      &lt;UL&gt;&lt;br /&gt;
          &lt;LI&gt;When you plug it in, a USB Mass Storage Device appears to be&lt;br /&gt;
              just another SCSI disk.&lt;br /&gt;
      &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
  &lt;/li&gt;&lt;LI&gt;Examples:&lt;br /&gt;
      &lt;UL&gt;&lt;br /&gt;
          &lt;LI&gt; Compact Flash card readers&lt;br /&gt;
          &lt;/li&gt;&lt;LI&gt; Certain digital cameras&lt;br /&gt;
          &lt;/li&gt;&lt;LI&gt; &quot;Keychain&quot; hard drives&lt;br /&gt;
          &lt;/li&gt;&lt;LI&gt; USB CD-ROMs/floppies, etc...etc..&lt;br /&gt;
      &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;
&lt;p&gt;&lt;H2&gt;Why would you want to use the USB Mass Storage Driver?&lt;/h2&gt;&lt;/p&gt;
&lt;p&gt;&lt;UL&gt;&lt;br /&gt;
  &lt;LI&gt; To access USB mass Storage devices (of course)&lt;br /&gt;
  &lt;/li&gt;&lt;LI&gt; Alternative way to access digital pictures (instead of gphoto2)&lt;br /&gt;
  &lt;/li&gt;&lt;LI&gt; For digital cameras not supported in Linux (or not well supported)&lt;br /&gt;
       &lt;UL&gt;&lt;br /&gt;
           &lt;LI&gt; E.g. I can now upload files to my CF cards, which I cannot do via the Canon Powershot S40 driver in gphoto2.&lt;br /&gt;
           &lt;/li&gt;&lt;LI&gt; Use this for sending firmware upgrades to my camera&lt;br /&gt;
       &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
  &lt;/li&gt;&lt;LI&gt; To conserve batteries in your digital camera&lt;br /&gt;
  &lt;/li&gt;&lt;LI&gt; For using CF or SmartMedia cards as portable storage:  Smaller and more convenient (if readers are available) than CDRW or Zip Disk&lt;br /&gt;
  &lt;/li&gt;&lt;LI&gt; They generally work very well in Linux!&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;H2&gt;HOWTO:&lt;/h2&gt;&lt;/p&gt;
&lt;p&gt;&lt;H3&gt;The Easy Way!&lt;/h3&gt;&lt;br /&gt;
If you have a relatively modern Linux distribution that is pre-configured to work with USB Mass Storage Devices (I&#039;ve tested with Redhat 7.2 and 8.0), there&#039;s &lt;I&gt;nothing you need to set up!&lt;/i&gt;.  It should be truly &quot;plug and play&quot;:&lt;br /&gt;
&lt;UL&gt;&lt;br /&gt;
    &lt;LI&gt;Plug your device in to the USB slot&lt;br /&gt;
    &lt;/li&gt;&lt;LI&gt;It will be automatically detected by the kernel, and an appropriate entry in &lt;TT&gt;/etc/fstab&lt;/tt&gt; will be added automatically.&lt;br /&gt;
    &lt;/li&gt;&lt;LI&gt;The device will be mounted under &lt;TT&gt;/mnt/flash&lt;/tt&gt;&lt;br /&gt;
    &lt;/li&gt;&lt;LI&gt;Use it, just like any other storage device&lt;br /&gt;
&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;
&lt;p&gt;&lt;H3&gt;Manual Setup&lt;/h3&gt;&lt;br /&gt;
If you&#039;re running a Linux distribution that doesn&#039;t set up USB Mass Storage devices automatically, here are the steps you need to follow:&lt;/p&gt;
&lt;p&gt;&lt;UL&gt;&lt;br /&gt;
    &lt;LI&gt;Configure the Linux Kernel:&lt;br /&gt;
       &lt;UL&gt;&lt;br /&gt;
            &lt;LI&gt;Add SCSI Support&lt;br /&gt;
                &lt;UL&gt;&lt;br /&gt;
                     &lt;LI&gt;SCSI Support (CONFIG_SCSI)&lt;br /&gt;
                     &lt;/li&gt;&lt;LI&gt;SCSI disk support (CONFIG_BLK_DEV_SD)&lt;br /&gt;
                     &lt;/li&gt;&lt;LI&gt;SCSI generic support (CONFIG_CHR_DEV_SG)&lt;br /&gt;
                &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
            &lt;/li&gt;&lt;LI&gt;Add USB Support&lt;br /&gt;
                &lt;UL&gt;&lt;br /&gt;
                    &lt;LI&gt;Support for USB (CONFIG_USB)&lt;br /&gt;
                    &lt;/li&gt;&lt;LI&gt;USB drivers.  One or more of: ECHI HCD (CONFIG_USB_EHCI_HCD), UHCI (CONFIG_USB_UHCI), OHCI (CONFIG_USB_OHCI)&lt;br /&gt;
                    &lt;/li&gt;&lt;LI&gt;Preliminary USB device file system (CONFIG_USB_DEVICEFS)&lt;br /&gt;
                    &lt;/li&gt;&lt;LI&gt;USB Mass Storage support (CONFIG_USB_STORAGE)&lt;br /&gt;
                &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
       &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
    &lt;/li&gt;&lt;LI&gt;Plug in your USB device.  You should see your device listed in &lt;TT&gt;/proc/bus/usb/devices&lt;/tt&gt;.  If not, you need to fix the kernel or check your cabling.&lt;br /&gt;
    &lt;/li&gt;&lt;LI&gt;Use the &lt;TT&gt;&lt;B&gt;sg3-utils&lt;/b&gt;&lt;/tt&gt; package to determine the device name of your USB Mass Storage Device:&lt;br /&gt;
        &lt;UL&gt;&lt;br /&gt;
            &lt;LI&gt;Install the sg3-utils package&lt;br /&gt;
                (e.g. &lt;TT&gt;apt-get install sg3-utils&lt;/tt&gt;)&lt;br /&gt;
            &lt;/li&gt;&lt;LI&gt;List your raw SCSI devices by running &lt;TT&gt;sg_scan -i&lt;/tt&gt;.  The output will look something like this:&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;
&lt;pre&gt;
/dev/sg0: scsi0 channel=0 id=0 lun=0 [em]  type=5
MATSHITA  CD-RW  CW-7585    1.01 [wide=0 sync=1 cmdq=0 sftre=0 pq=0x0A]
/dev/sg1: scsi1 channel=0 id=0 lun=0 [em]  type=0
SanDisk   ImageMate CF-SM   0100 [wide=0 sync=0 cmdq=0 sftre=0 pq=0x0]
/dev/sg2: scsi1 channel=0 id=0 lun=1 [em]  type=0
SanDisk   ImageMate CF-SM   0100 [wide=0 sync=0 cmdq=0 sftre=0 pq=0x0]
&lt;/pre&gt;&lt;p&gt;            &lt;LI&gt;This tells me that I have 3 SCSI devices on my system: My CD-RW drive, and two Sandisk ImageMate devices (it&#039;s a single hardware device, but the first slot is the CF card reader, and the second is the SM card reader)&lt;br /&gt;
            &lt;/li&gt;&lt;LI&gt;Determine the real SCSI device associated with your USB Mass Storage Device with &lt;TT&gt;sg_map&lt;/tt&gt;.  The output looks like:&lt;/li&gt;&lt;/p&gt;
&lt;pre&gt;
/dev/sg0  /dev/scd0
/dev/sg1  /dev/sda
/dev/sg2  /dev/sdb
&lt;/pre&gt;&lt;p&gt;            &lt;LI&gt;Now we can match the results of these last two steps.  For example my Compact Flash reader is on the &lt;TT&gt;/dev/sda&lt;/tt&gt; device.&lt;br /&gt;
            &lt;/li&gt;&lt;LI&gt;In most cases, USB Mass Storage Devices will only have one partition on them, so we can safely assume that the final, mountable device is &lt;TT&gt;/dev/sda1&lt;/tt&gt; (the first partition on /dev/sda).&lt;br /&gt;
        &lt;br /&gt;
    &lt;/li&gt;&lt;LI&gt;Create a mount point for your device: &lt;TT&gt;mkdir /mnt/flash&lt;/tt&gt;&lt;br /&gt;
    &lt;/li&gt;&lt;LI&gt;Add an entry to &lt;TT&gt;/etc/fstab&lt;/tt&gt; for this mount point:&lt;br /&gt;
        &lt;TT&gt;/dev/sda1 &amp;nbsp; /mnt/flash &amp;nbsp;  auto  &amp;nbsp; defaults,user,noauto &amp;nbsp; 0 0&lt;/tt&gt;&lt;br /&gt;
    &lt;/li&gt;&lt;LI&gt;Now it&#039;s ready to go.  Any user can mount the device:&lt;br /&gt;
        &lt;TT&gt;mount /mnt/flash&lt;/tt&gt;&lt;br /&gt;
    &lt;/li&gt;&lt;LI&gt;Make sure you unmount it before taking the card out or unplugging it:&lt;br /&gt;
        &lt;TT&gt;umount /mnt/flash&lt;/tt&gt;&lt;br /&gt;
&lt;/li&gt;&lt;/p&gt;
&lt;p&gt;&lt;H3&gt;Other Stuff&lt;/h3&gt;&lt;/p&gt;
&lt;p&gt;&lt;UL&gt;&lt;br /&gt;
    &lt;LI&gt;Like any other &quot;hard drive&quot; device, you can run &lt;TT&gt;fdisk&lt;/tt&gt; on it and play with the partitions:&lt;br /&gt;
      &lt;TT&gt;fdisk /dev/sda&lt;/tt&gt;&lt;br /&gt;
    &lt;/li&gt;&lt;LI&gt;Format the partition(s) on the device, usually with a DOS/FAT filesystem, e.g.:&lt;br /&gt;
        &lt;TT&gt;mkfs -t vfat /dev/sda1&lt;/tt&gt;&lt;br /&gt;
        ...or with a journalled Linux ext3 filesystem (probably not useful when used with cameras, etc!):&lt;br /&gt;
        &lt;TT&gt;mkfs -t ext3 /dev/sda1&lt;/tt&gt;&lt;br /&gt;
&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;
&lt;p&gt;&lt;H2&gt;Links:&lt;/h2&gt;&lt;/p&gt;
&lt;p&gt;&lt;UL&gt;&lt;br /&gt;
  &lt;LI&gt;&lt;A HREF=&quot;http://www.linux-usb.org/&quot;&gt;Linux USB Homepage&lt;/a&gt; - Everything about Linux USB support.&lt;br /&gt;
  &lt;/li&gt;&lt;LI&gt;&lt;A HREF=&quot;http://www.cs.sfu.ca/~ggbaker/personal/cf-linux&quot;&gt;Using a USB Compact Flash Reader in Linux&lt;/a&gt; - Many of the technical details were taken from this site.&lt;br /&gt;
  &lt;/li&gt;&lt;LI&gt;&lt;A HREF=&quot;http://www2.one-eyed-alien.net/~mdharm/linux-usb/&quot;&gt;USB Mass Storage Driver for Linux&lt;/a&gt; - The Mass Storage Driver project page.&lt;br /&gt;
&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;
</description>
 <category domain="http://vic.gedris.org/taxonomy/term/10">Linux</category>
 <category domain="http://vic.gedris.org/taxonomy/term/9">Geek Stuff</category>
 <pubDate>Wed, 27 Jul 2005 20:12:36 +0000</pubDate>
 <dc:creator>vic</dc:creator>
 <guid isPermaLink="false">16 at http://vic.gedris.org</guid>
</item>
</channel>
</rss>
