Com1 = ttyS0 and com2 = ttyS1 <br>
for your serial ports <br>
<br>
For the USB read this <br>
<br>
<div class="ARTICLE"><div class="TITLEPAGE"><h1 class="title"><a name="AEN2"></a>USB Flash Memory HOWTO</h1><h3 class="author"><a name="AEN4"> Niko  Sauer</a></h3><div class="affiliation"><span class="orgname"> Unit of Advanced Study
<br></span><span class="orgdiv"> University of Pretoria, South Africa<br></span><div class="address"><p class="address"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt class="email">&lt;<a href="mailto:%20nikos@friedrichs.up.ac.za"> nikos@friedrichs.up.ac.za</a>&gt;</tt><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p></div></div><div class="revhistory"><table border="0" width="100%"><tbody><tr><th colspan="3" align="left" valign="top"><b>Revision History</b></th></tr><tr><td align="left">Revision 0.06</td><td align="left">
2004-03-10</td><td align="left">Revised by: ns</td></tr><tr><td colspan="3" align="left">Added section on Linux-2.6.</td></tr><tr><td align="left">Revision 0.05</td><td align="left">2003-12-26</td><td align="left">Revised by: ejh
</td></tr><tr><td colspan="3" align="left">Technical review.</td></tr><tr><td align="left">Revision 0.04</td><td align="left">2003-12-11</td><td align="left">Revised by: ns</td></tr><tr><td colspan="3" align="left"><br>
</td></tr><tr><td align="left">Revision 0.03</td><td align="left">2003-12-02</td><td align="left">Revised by: ejh</td></tr><tr><td colspan="3" align="left">Technical review.</td></tr><tr><td align="left">Revision 0.02</td>
<td align="left">2003-10-30</td><td align="left">Revised by: ns</td></tr><tr><td colspan="3" align="left">Changed 2003-11-20</td></tr></tbody></table></div><div><div class="abstract"><a name="AEN37"></a><p>
     This document describes procedures for installing USB Flash
     Memory devices and the way of formatting them for various file
     systems such as vfat (the way they usually come) and ext2 (the
     way they fit in better with Linux). It is also described how to
     partition the device in two sections with different file types.
    </p></div></div><hr></div><div class="TOC"><dl><dt><b>Table of Contents</b></dt><dt>1. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#purpose">Purpose</a></dt><dt>2. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#physical">
Physical devices</a></dt><dt>3. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#buying">Buying a memory stick</a></dt><dt>4. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#reading">Reading
</a></dt><dt>5. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#hardware">Hardware and kernel</a></dt><dd><dl><dt>5.1. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#setup">Setup</a>
</dt><dt>5.2. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#kernel">Kernel options</a></dt><dt>5.3. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#notes">Notes</a></dt></dl></dd><dt>
6. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#basics">Some basic concepts</a></dt><dd><dl><dt>6.1. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#proc">The /proc filesystem</a></dt>
<dt>6.2. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#scsidev">SCSI devices</a></dt><dt>6.3. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#usbfs">The USB device filesystem</a></dt>
<dt>6.4. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#ext2fs">The ext2 filesystem</a></dt><dt>6.5. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#vfatfs">The vfat filesystem</a></dt>
<dt>6.6. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#options">Explanation of command options</a></dt></dl></dd><dt>7. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#verifications">
Basic verifications</a></dt><dd><dl><dt>7.1. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#quick">A quick check</a></dt><dt>7.2. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#proc-probe">
Probing the /proc filesystem</a></dt><dt>7.3. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#mounting">Mounting the USB filesystem</a></dt><dt>7.4. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#tests">
Tests -- vfat</a></dt></dl></dd><dt>8. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#ext2">Setting up an Ext2 filesystem</a></dt><dd><dl><dt>8.1. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#partition">
Partitioning</a></dt><dt>8.2. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#making-ext2">Making an ext2 device</a></dt><dt>8.3. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#tests4">
Tests -- ext2</a></dt></dl></dd><dt>9. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#mixed">Setting up a dual partition</a></dt><dd><dl><dt>9.1. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#double-partition">
Partitioning</a></dt><dt>9.2. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#both">Making a dual ext2/vfat system</a></dt><dt>9.3. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#mixed-tests">
Tests -- ext2 and vfat</a></dt><dt>9.4. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#config-linux">Configuring Linux for the dual partition</a></dt></dl></dd><dt>10. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#users">
Making the memory stick accessible to users</a></dt><dt>11. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#maintain">Maintenance</a></dt><dd><dl><dt>11.1. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#fs-inspect">
Filesystem inspection</a></dt><dt>11.2. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#and-then">And then?</a></dt></dl></dd><dt>12. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#linux-2.6">
The Linux-2.6 kernel</a></dt><dd><dl><dt>12.1. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#What-is-new">What is new?</a></dt><dt>12.2. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#kernel-options">
Kernel options</a></dt><dt>12.3. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#notes-2.6">Notes</a></dt><dt>12.4. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#hotplug">Hotplugging and Naming
</a></dt></dl></dd><dt>13. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#formal">Formalities</a></dt><dd><dl><dt>13.1. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#copyright">Copyright Information
</a></dt><dt>13.2. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#disclaimer">Disclaimer</a></dt><dt>13.3. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#credits">Credits</a></dt><dt>
13.4. <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#feedback">Feedback</a></dt></dl></dd></dl></div><div class="sect1"><h1 class="sect1"><a name="purpose"></a>1. Purpose</h1><p>
    The purpose of this document is to describe procedures for
    implementing USB flash memory devices (memory sticks) on
    Linux. This entails the following:
   </p><ul><li><p>
         making over-the-counter devices, pre-formatted for the MS
         Windows system, work on Linux;
         </p></li><li><p>
         formatting the device in the ext2 filesystem on a single
         partition and making it work. This is intended for situations
         where the device will be used exclusively on Linux machines;
         </p></li><li><p>
         formatting the device on a dual partition in the ext2 and
         vfat filesystems and making it work. The purpose of this
         is for situations where Linux + Linux and Linux + Windows are
         possible;
         </p></li><li><p>
         making the device more user friendly;
         </p></li><li><p>
         maintaining the filesystem of the device;
         </p></li><li><p>
         using additional features of Linux-2.6.x.
         </p></li></ul><p>
    The procedures described in this document should work on
    any USB memory stick device which can be operated as a read-write
    device. Read-only devices do not fall in this category. The
    procedures will not work if the write facility of the device is
    disabled (i.e. if the write protect switch is on).
   </p><p>
    The procedures described for formatting and maintenance in
    particular filesystems may (in principle) be adapted for other
    filesystems such as ext3 and reiserfs. These have not been tried
    and tested. Neither has any attention been paid to adaptation of
    the procedures to other related operating systems.
   </p><div class="warning"><table class="warning" border="0" width="100%"><tbody><tr><td align="center" valign="top" width="25"><img src="http://www.tldp.org/HOWTO/html_single/images/warning.gif" alt="Warning" hspace="5">
</td><td align="left" valign="top"><p>
    It may be dangerous to re-format the flash memory
    intended for a digital camera. The camera may then be unable to
    understand it. Use the camera's built-in menu system to do this
         reformatting for you.
         
   </p></td></tr></tbody></table></div></div><div class="sect1"><hr><h1 class="sect1"><a name="physical"></a>2. Physical devices</h1><p>
    Flash memory devices come mainly in the form of small, portable
    devices often referred to as <em>memory sticks</em> or
    <em>keychains</em>, and as part of digital
    cameras. They are <em>non-volatile devices</em> which
    operate on the principle that electric charges are used to
    represent data in binary format. These charges can remain
    unchanged almost indefinitely, but changes (such as writing to the
    device) limit the life span of the device (100000 writes of 8MB
    each).
   </p><p> 
    Memory sticks plug directly into a USB-port at the back of your
    computer. The power it needs is supplied by the USB-port. It is
    sometimes convenient to use a USB-extension cable to bring the
    device within easy reach. 
   </p><p>
    Memory sticks usually have <em>write protect
    switches</em> which should be turned off if you want to use
    it as read-write device. If the switch is in the <span class="QUOTE">&quot;on&quot;</span> position,
    the device is <em>read-only</em>. The devices are
    usually equipped with a led (light emitting diode), which
    indicates that the device is operational. The led also flickers
    while data is being transferred to or from the device.
   </p><p>
    Digital cameras use flash memory for image storage. These are 
    powered by the camera and connected to the computer's USB-port via
    an electronic interface. To be able to connect to the computer,
    the camera's power must be turned on for the duration of the
    interfacing, and should only be turned off after the device had
    been unmounted from the computer. It is important to remember that
    the device takes power from the camera's battery. The operation
    should therefore be terminated as soon as possible.
   </p></div><div class="sect1"><hr><h1 class="sect1"><a name="buying"></a>3. Buying a memory stick</h1><p>
    Important considerations when buying a memory stick are the
    following:
   </p><div class="variablelist"><dl><dt><strong>The size of the memory</strong></dt><dd><p>
                This will depend on whatever use you have in mind. 128MB seems to be
                a popular choice.
        </p></dd><dt><strong>Is it known to work on Linux?</strong></dt><dd><p>
    The established brands have web sites in which this may be stated
    explicitly. Alternatively, ask the supplier. But beware: the sales
    person may not know what you are talking about. The instruction
    leaflet may also mention something like: Works on Linux-2.4, or
    may have a picture of the Linux penguin. If these inquiries fail, it
    may be wise not to buy.  
        </p></dd><dt><strong>Extension cable and keychain</strong></dt><dd><p>
    Memory sticks usually are packaged with an extension cable 
    (<a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#physical">Section 2</a>) and a keychain. The latter provides
    a safe and with-it way of transporting the device. Make sure that
    these are included. You may need an additional extension cable,
    depending on circumstances. Laptop and notebook computers usually
    don't need them.
        </p></dd><dt><strong>File system</strong></dt><dd><p>
    Over-the-counter memory sticks are usually formatted in vfat
    (msdos), and this will work in Linux, but you will not have the
    strength and versatility of the standard ext2 (or other) file
    system. This is not a problem. It can be endowed with other file
    systems as will be described later in this document.
        </p></dd><dt><strong>Cost</strong></dt><dd><p>
    Prices of memory sticks of a given size may vary considerably. It
    is a good idea to find out what that range is. The internet is
    excellent for the purpose.
        </p></dd></dl></div></div><div class="sect1"><hr><h1 class="sect1"><a name="reading"></a>4. Reading</h1><p> 
    Users of this document might want to acquaint themselves with
    the following:
     <a name="AEN104" href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#FTN.AEN104"><span class="footnote">[1]</span></a>
   </p><ul compact="COMPACT"><li style="list-style-type: none;"><span>
          Manual pages of the following tools:
          <span class="application">mount</span>,
                         <span class="application">umount</span>, <span class="application">fdisk</span>, <span class="application">mke2fs</span>, <span class="application">mkdosfs</span>,
          <span class="application">dumpe2fs</span>&gt; and <span class="application">fsck.ext2</span>.
        </span></li><li style="list-style-type: none;"><span>
          <a href="http://www.tldp.org/" target="_top">
            Linux documentation project
          </a>
        </span></li><li style="list-style-type: none;"><span>
          <a href="http://www.tldp.org/HOWTO/USB-Digital-Camera-HOWTO" target="_top">
            USB-Digital Camera HOWTO
          </a>*
        </span></li><li style="list-style-type: none;"><span>
          <a href="http://www.tldp.org/HOWTO/Partition" target="_top"> The Linux 
            Partition HOWTO
          </a>*
        </span></li><li style="list-style-type: none;"><span>
         <a href="http://www.tldp.org/HOWTO/The%20Linux%20SCSI-2.4-HOWTO" target="_top">
           The Linux 2.4 SCSI subsystem HOWTO
         </a>
        </span></li><li style="list-style-type: none;"><span>
         <a href="http://www.tldp.org/HOWTO/Kernel-HOWTO" target="_top">
           The Linux Kernel HOWTO
         </a>
        </span></li><li style="list-style-type: none;"><span>
         <a href="http://www.linux-usb.org/USB-guide/book1.html" target="_top">
           The Linux USB subsystem
         </a>*
        </span></li><li style="list-style-type: none;"><span>
         <a href="http://www.tldp.org/guides.html" target="_top">
           Linux filesystem hierarchy
         </a>
        </span></li><li style="list-style-type: none;"><span>
         <a href="http://www.tldp.org/guides.html" target="_top">
           The Linux Kernel
         </a>
        </span></li><li style="list-style-type: none;"><span>
           Linux Kernel 2.4.xx/Documentation (should be in
           <tt class="filename"> /usr/src/linux/Documentation</tt> )
        </span></li></ul></div><div class="sect1"><hr><h1 class="sect1"><a name="hardware"></a>5. Hardware and kernel</h1><div class="sect2"><h2 class="sect2"><a name="setup"></a>5.1. Setup</h2><p>
    This is a description of the salient features of the setup used to
    develop the procedures described below. All the procedures have
    been tried and tested, also for Linux-2.6. The screen-like
    displays are precise copies of what appeared on my screen.
   </p><ul compact="COMPACT"><li style="list-style-type: none;"><span>
       Hardware: Intel (R) Celeron (TM) 1100 MHz
      </span></li><li style="list-style-type: none;"><span>
       Distribution: RedHat Linux 7.0 (extensively modified)
      </span></li><li style="list-style-type: none;"><span>
       Kernel: Linux-2.4.20 (from <a href="http://www.kernel.org">www.kernel.org</a>). See also
       <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#linux-2.6">Section 12</a> for Linux-2.6.x.
      </span></li><li style="list-style-type: none;"><span>
       Tools: util-linux-2.11z (<span class="application">mount</span>, <span class="application">umount</span>, <span class="application">fdisk</span>); 
          e2fsprogs-1.32 (<span class="application">mke2fs</span>, <span class="application">dumpe2fs</span>, <span class="application">fsck.ext2</span>);
          mkdosfs-2.2
      </span></li></ul></div><div class="sect2"><hr><h2 class="sect2"><a name="kernel"></a>5.2. Kernel options</h2><p>
    It is uncertain if USB-support is sufficient in kernels earlier
    than 2.4.xx. The following support, relevant to this document, was
    compiled into the kernel. A modular approach may also be followed.
   </p><div class="sect3"><hr><h3 class="sect3"><a name="scsi"></a>5.2.1. SCSI support</h3><ul compact="COMPACT"><li style="list-style-type: none;"><span> SCSI support (CONFIG_SCSI  scsi_mod.o)</span></li><li style="list-style-type: none;">
<span> SCSI disk support (CONFIG_BLK_DEV_SD  sd_mod.o)</span></li></ul></div><div class="sect3"><hr><h3 class="sect3"><a name="fss"></a>5.2.2. File systems</h3><ul compact="COMPACT"><li style="list-style-type: none;"><span>
 DOS FAT fs support (CONFIG_FAT_FS  fat.o)</span></li><li style="list-style-type: none;"><span> MSDOS fs support (CONFIG_MSDOS_FS  msdos.o)</span></li><li style="list-style-type: none;"><span> 
        VFAT (Windows 95) fs support (CONFIG_VFAT_FS  vfat.o)
        </span></li><li style="list-style-type: none;"><span> /proc filesystem (CONFIG_PROC_FS)</span></li><li style="list-style-type: none;"><span> 
        Second extended fs support (ext2fs) (CONFIG_EXT2_FS  ext2.o)
      </span></li></ul></div><div class="sect3"><hr><h3 class="sect3"><a name="usb"></a>5.2.3. USB support</h3><ul compact="COMPACT"><li style="list-style-type: none;"><span> Support for USB (CONFIG_USB  usbcore.o)</span>
</li><li style="list-style-type: none;"><span> 
        Preliminary USB device filesystem (CONFIG_USB_DEVICEFS)
      </span></li><li style="list-style-type: none;"><span> 
        USB Mass Storage support (CONFIG_USB_STORAGE  usb-storage.o)
      </span></li></ul></div></div><div class="sect2"><hr><h2 class="sect2"><a name="notes"></a>5.3. Notes</h2><p>
     In the lists above the entities in uppercase refer to the
     variable names to be found in the <tt class="filename">.config</tt>
     file in the upper level directory of the kernel source (<tt class="filename">/usr/src/linux/</tt>). The entities
     <tt class="filename">xxx.o</tt> refer to the modules created when a
     modular approach is followed. When there is no reference to a
     module, the option can only be hard-compiled into the kernel.
    </p><p>
     Different kernel versions may have different indications of
     options when, for example, <em>make menuconfig</em>
     or <em> make xconfig</em> are run. Variables such
     as CONFIG_USB, which can be gleaned from the various <em>
     help</em> options, may be a more reliable indication.
    </p><p>
     Very recent Linux distributions such as
     <em>RedHat</em> and <em>SuSE</em>
     probably have the appropriate kernel options compiled in.
    </p><p>
     Under USB-support, options for a number of digital cameras are 
     available.
    </p><p>
     Please consult the relevant texts as set out in 
     <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#reading">Section 4</a> if you consider (re)compiling your 
     kernel.
    </p></div></div><div class="sect1"><hr><h1 class="sect1"><a name="basics"></a>6. Some basic concepts</h1><p>
    In this section we discuss in a very brief manner, some basic
    Linux concepts which should contribute to an understanding of the
    procedures described below.
   </p><div class="sect2"><hr><h2 class="sect2"><a name="proc"></a>6.1. The /proc filesystem</h2><p>
      The /proc filesystem serves as a window through which we can see
      the workings of a Linux setup. The objects of most interest for
      this document are the directories<tt class="filename">/proc/bus/usb/</tt> and <tt class="filename">/proc/scsi/</tt>. These will be used to
      verify that the kernel had been set up properly for our purpose
      (<a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#proc-probe">Section 7.2</a>). 

    </p></div><div class="sect2"><hr><h2 class="sect2"><a name="scsidev"></a>6.2. SCSI devices</h2><p>
    Your memory stick will be considered as a USB mass storage device
    posing as a removable SCSI disk (sd).  SCSI disk devices are
    mapped to the <tt class="filename"> /dev</tt>
    (devices) directory under <tt class="filename">
    /dev/sda</tt> , <tt class="filename">
    /dev/sdb</tt> , ... When different disk devices are present,
    they will be mapped to <tt class="filename">/dev/sda</tt>,
    <tt class="filename">/dev/sdb</tt>, etc.  If, for example, a memory
    stick and a digital camera are plugged in, the one would be mapped
    to <tt class="filename">/dev/sda</tt> and the other to
    <tt class="filename">/dev/sdb</tt>. Tests have indicated that the first
    device to be detected is mapped to <tt class="filename">sda</tt> and
    represented in the directory <tt class="filename">/proc/scsi/usb-storage-0</tt>. The second
    will be mapped to <tt class="filename">sdb</tt> and represented in
    <tt class="filename">/proc/scsi/usb-storage-0</tt>.
    What will happen when both devices are present at boot-up, is not
    known. An overview of the partitions relevant to this document,
    the file <tt class="filename">/proc/partitions</tt> may be consulted.
    Look for entries like <tt class="filename">sda, sda1, sdb</tt>. Under
    the Linux-2.6 series of kernels this problem may be very neatly
    resolved (<a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#linux-2.6">Section 12</a>).


    </p><p>
    In the descriptions further on, it will be assumed that only one
    memory stick is present, and therefore mapped to 
    <tt class="filename">/dev/sda</tt>.
   </p><p>
    In most distributions these points exist in abundance. You should
    check that this is the case in your setup
         (<tt class="userinput"><b><b class="command">ls</b> /dev/sda*</b></tt>. If there are none you can create them by
    doing (as root, indicated by the hash).
   </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br>             <tt class="prompt">#</tt> <tt class="userinput"><b><b class="command">mknod</b> /dev/sda  b 8 0
</b></tt><br>             <tt class="prompt">#</tt> <tt class="userinput"><b><b class="command">mknod</b> /dev/sda1 b 8 1</b></tt><br>             <tt class="prompt">#</tt> <tt class="userinput"><b><b class="command">mknod
</b> /dev/sda2 b 8 2</b></tt><br>   </font></pre></td></tr></tbody></table><p>
    etc, up to <tt class="filename">/dev/sda15</tt> if necessary. The
    device as a whole is mapped to <tt class="filename">/dev/sda</tt>,
    while <tt class="filename">/dev/sdax (x = 1 ... 15)</tt> represent
    the various partitions of the device. We shall describe, later on,
    how to create different partitions for different file systems (see
    <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#ext2">Section 8</a> and <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#mixed">Section 9</a> ). If you
    intend to use your memory stick with a single partition
    (filesystem), <tt class="filename">/dev/sda1</tt> is sufficient. 
   </p></div><div class="sect2"><hr><h2 class="sect2"><a name="usbfs"></a>6.3. The USB device filesystem</h2><p>
     This dynamically generated filesystem should be mounted at
     <tt class="filename">/proc/bus/usb/</tt>. It is
     therefore essential that this mount point exists. Once it is
     mounted, there should be more to be seen in <tt class="filename">/proc/bus/usb/</tt> and in <tt class="filename">/proc/scsi/</tt> (<a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#mounting">Section 7.3
</a>). To find out which USB devices are
     present, read the file <tt class="filename">/proc/bus/usb/devices</tt>
     (<b class="command"> less /proc/bus/usb/devices</b>). It takes a
     small effort to interpret the writing on the screen, but it is
     not difficult. A memory stick is indicated by <em>Mass
     Storage Device</em>.
    </p></div><div class="sect2"><hr><h2 class="sect2"><a name="ext2fs"></a>6.4. The ext2 filesystem</h2><p>
     The ext2 (second extended) filesystem still is the most prevalent
     in Linux setups. It is most versatile and sophisticated, carrying
     with it permissions (read-write-execute, who is permitted to do
     what), ownership (user, group, others), a timestamp (when last
     modified), etc. Moreover, tools for the proper maintenance of a
     device endowed with ext2, exist (<a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#maintain">Section 11</a>).  If
     a flash memory device is to be used exclusively within Linux
     setups, it is therefore desirable to format it in ext2 (see <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#ext2">Section 8</a>).
    </p></div><div class="sect2"><hr><h2 class="sect2"><a name="vfatfs"></a>6.5. The vfat filesystem</h2><p>
     Enabling vfat in the kernel makes it possible to mount
     filesystems created under Dos/Windows to be mounted in a Linux
     system. Most memory sticks are formatted for direct use on
     Windows and should therefore be considered as vfat-formatted. The
     vfat filesystem is less sophisticated than ext2 and will
     therefore be more economic as far as memory space is
     concerned. It does not carry permissions in the same way as ext2
     with the result that an ext2-file saved in vfat will re-appear
     with its permissions changed. Nonetheless, if a memory stick is
     to be used for the purpose of carrying data between Linux and
     Windows machines, it is best to keep it in the vfat format. A
     compromise is to partition the memory stick in two parts: one in
     vfat and the other in ext2. At least the Linux machine should be
     able to handle both. This is described in <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#mixed">Section 9</a>
    </p></div><div class="sect2"><hr><h2 class="sect2"><a name="options"></a>6.6. Explanation of command options</h2><p>
    Here is a short list of command options that occur in this
    document:
   </p><ul compact="COMPACT"><li style="list-style-type: none;"><span> 
       <tt class="userinput"><b><b class="command">mount</b> -t ext2 /dev/sda1 /mnt/memstick</b></tt> 
       Mount in filetype ext2, device sda1 at mountpoint /mnt/memstick
      </span></li><li style="list-style-type: none;"><span> 
       <tt class="userinput"><b><b class="command">ls</b> -l</b></tt>
       Make a complete list (modes, ownerships, etc.)
      </span></li><li style="list-style-type: none;"><span> 
       <tt class="userinput"><b><b class="command">mkdosfs</b> -F 32 /dev/sda1</b></tt>
       Create an ms-dos filesystem, FAT-size 32, on the
            partition /dev/sda1
      </span></li><li style="list-style-type: none;"><span> 
       <tt class="userinput"><b><b class="command">ln</b> -s /dev/sda1 /dev/flash</b></tt>
              link, symbolically, the existing /dev/sda1 to 
         the symbolic /dev/flash
      </span></li><li style="list-style-type: none;"><span> 
       <tt class="userinput"><b><b class="command">mkdir</b> -m 777
                 /mnt/memstick/superdir</b></tt>
        create a new directory with mode rwx for user, group and others
      </span></li><li style="list-style-type: none;"><span> 
       <tt class="userinput"><b><b class="command">dumpe2fs</b> -h /dev/sda1</b></tt>
       Show the header of the ext2 partition /dev/sda1
      </span></li></ul></div></div><div class="sect1"><hr><h1 class="sect1"><a name="verifications"></a>7. Basic verifications</h1><div class="important"><table class="important" border="0" width="100%"><tbody><tr><td align="center" valign="top" width="25">
<img src="http://www.tldp.org/HOWTO/html_single/images/important.gif" alt="Important" hspace="5"></td><td align="left" valign="top"><p>
   In order to make sure that the device you look at and write on is
   the one intended, it is best to remove similar devices from
   the USB-bus before starting these procedures.
  </p></td></tr></tbody></table></div><div class="sect2"><hr><h2 class="sect2"><a name="quick"></a>7.1. A quick check</h2><p>
    It is possible that your system is already set up for handling a
    USB-flash memory device. To check this, simply issue the command 
    <tt class="prompt">$ </tt><tt class="userinput"><b><b class="command">mount</b></b></tt> from an X-terminal. If something like
   </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br>           none on /proc/bus/usb type usbfs (rw)<br>      </font></pre></td></tr></tbody></table><p>
    appears among the output, you are ready to go to 
    <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#tests">Section 7.4</a> and proceed from there. It may be
    virtuous, however, to glance through the intervening sections.
    If the test is unsuccessful, all is not lost. Please read on.
   </p></div><div class="sect2"><hr><h2 class="sect2"><a name="proc-probe"></a>7.2. Probing the /proc filesystem</h2><p>
    A few things in the <tt class="filename"> /proc</tt>
    directory can be checked so see if the kernel options have been
    properly included or the appropriate modules properly inserted. As
    a first check, see if the directory <tt class="filename">/proc/bus/usb</tt> exists. If it does,
    your kernel supports the USB-subsystem correctly. If this is not
    the case the kernel has to be re-compiled with appropriate USB
    support (see <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#usb">Section 5.2.3</a>) or the kernel has to be
    updated. Next, check if the directory <tt class="filename">/proc/scsi</tt> exists. If it does, you're
    well-away. If it doesn't, SCSI support has not been compiled into
    your kernel (see <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#scsi">Section 5.2.1</a>).
   </p><p>
    In <tt class="filename"> /proc</tt> there should be
    provision for a mount point for the USB filesystem. That point is
    <tt class="filename"> /proc/bus/usb</tt>. If it
    exists, the kernel is correctly set up.  
   </p></div><div class="sect2"><hr><h2 class="sect2"><a name="mounting"></a>7.3. Mounting the USB filesystem</h2><p>
    If the verifications of the previous sections were positive, the
    next step is to mount the USB filesystem. This is issued from root
    as follows:
   </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><font color="#000000"><pre class="screen">             <tt class="prompt"># </tt><tt class="userinput"><b><b class="command">mount</b> -t usbfs none /proc/bus/usb 
</b></tt><br>   </pre></font></td></tr></tbody></table><div class="note"><table class="note" border="0" width="100%"><tbody><tr><td align="center" valign="top" width="25"><img src="http://www.tldp.org/HOWTO/html_single/images/note.gif" alt="Note" hspace="5">
</td><td align="left" valign="top"><p>
    In older kernel versions the mount command above may have to
    be changed by replacing <tt class="parameter"><i>usbfs</i></tt> with
    <tt class="parameter"><i>usbdevfs</i></tt>. In Linux-2.4.20 both forms work.
   </p></td></tr></tbody></table></div><p>
    If there are no complaints, do some more tests. The first is the
    quick test (<a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#quick">Section 7.1</a>).  A deeper probe would be to
    issue the command <tt class="prompt"># </tt><tt class="userinput"><b><b class="command">ls</b> -l /proc/bus/usb</b></tt> . This
    should give something similar to
   </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br>             dr-xr-xr-x 1 root root 0  Sep 19  14:21  001<br>             dr-xr-xr-x 1 root root 0  Sep 19  14:21  002
<br>             -r--r--r-- 1 root root 0  Sep 19  22:30  devices <br>             -r--r--r-- 1 root root 0  Sep 19  22:30  drivers<br>   </font></pre></td></tr></tbody></table><p>
    The path <tt class="filename">
    /proc/scsi/usb-storage-0/</tt> should now exist and one of
    the files at the end will show this. In my setup the command
    <tt class="prompt">$ </tt><tt class="userinput"><b><b class="command">less</b> /proc/scsi/usb-storage-0/1</b></tt> gives
   </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><font color="#000000"><pre class="screen">                Host scsi1: usb-storage  <br>                    Vendor: Generic  <br>                   Product: Mass Storage Device  
<br>             Serial Number: None  <br>                  Protocol: Transparent SCSI  <br>                 Transport: Bulk  <br>                      GUID: 0ed166800000000000000000  <br>                  Attached: Yes/No  
<br>   </pre></font></td></tr></tbody></table><p>
    If the flashdrive is present, the last line will have the entry
    &quot;Yes&quot;. If it is not plugged in, the entry will be &quot;No&quot;.
   </p></div><div class="sect2"><hr><h2 class="sect2"><a name="tests"></a>7.4. Tests -- vfat</h2><p> You are now ready to find out if the memory stick is
   working. Let us suppose that you bought it over the counter. Its
   instruction leaflet will most likely tell you how to set it up for
   Windows. That is an indication that it is formatted in vfat. Before
   you try to mount it, create a mount point for it. Do something like
   <tt class="prompt"># </tt><tt class="userinput"><b><b class="command">mkdir</b> -m 777
   /mnt/memstick</b></tt>. The mounting command would most likely
   be
   </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><font color="#000000"><pre class="screen">    <tt class="prompt"># </tt><tt class="userinput"><b><b class="command">mount</b> -t vfat /dev/sda1 /mnt/memstick
</b></tt><br>   </pre></font></td></tr></tbody></table><p> 
    If everything went smoothly, you should be able to see the device:
    <tt class="prompt"># </tt><tt class="userinput"><b><b class="command">ls</b>
    /mnt/memstick</b></tt>.
   </p><p> 
    Now try some standard things like making a directory on the device
    and copying a favourite text file to it:
   </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br>             <tt class="prompt"># </tt><tt class="userinput"><b><b class="command">mkdir</b> /mnt/memstick/apollo 
</b></tt><br>             <tt class="prompt"># </tt><tt class="userinput"><b><b class="command">cp</b> /home/myname/myfavourite_file /mnt/memstick/apollo/.</b></tt><br>   </font></pre></td></tr></tbody></table><p> 
    List again (<tt class="prompt"># </tt><tt class="userinput"><b><b class="command">ls</b> -l /mnt/memstick</b></tt> ) and
    pay attention to the permissions.
    </p><p> 
     Unmount the device (<tt class="prompt">#
     </tt><tt class="userinput"><b><b class="command">umount</b>
     /dev/sda1</b></tt> ) and mount it again as above. List again
     and check the permissions. Most likely your favourite text file
     will now have an x-permission. It became executable. That is
     normal in the vfat filesystem. If you are happy with that,
     unmount the device and skip to <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#users">Section 10</a> .
    </p></div></div><div class="sect1"><hr><h1 class="sect1"><a name="ext2"></a>8. Setting up an Ext2 filesystem</h1><p>
  The procedures described here will give the entire flash memory
  device a single partition endowed with the ext2 filesystem. This
  will make the device more suitable for use between Linux machines.
  Don't do this if the device is supposed to operate between
  Linux and Windows machines.
</p><div class="important"><table class="important" border="0" width="100%"><tbody><tr><td align="center" valign="top" width="25"><img src="http://www.tldp.org/HOWTO/html_single/images/important.gif" alt="Important" hspace="5">
</td><td align="left" valign="top"><p>
    The device associated with <tt class="filename">/dev/sda</tt> will be
    re-formatted. Any data present on it will be destroyed. To make
    sure that the device you work with is the one intended, remove
    similar devices from the USB-bus before starting these procedures.
  </p></td></tr></tbody></table></div><div class="sect2"><hr><h2 class="sect2"><a name="partition"></a>8.1. Partitioning</h2><p>
    It is assumed that the flash memory is mapped to <tt class="filename">
    /dev/sda</tt>. In this section we treat the situation where
    the whole flash memory device will become devoted to a single ext2
    partition. In the example procedure shown below, a 128MB flash
    memory was formatted for ext2. That is why figures like 131MB and
    888 cylinders appear. The fdisk tool, which is used, simply reads
    that from the device.
   </p><p> 
    All operations are done by root. The single partition will be
    created on <tt class="filename"> /dev/sda</tt>
    (please note: not <tt class="filename">
    /dev/sda1</tt> ) The procedure is described in a series of
    steps with comments. The standard prompt of
    <span class="application">fdisk</span> is <tt class="prompt"> Command (m for
    help):</tt> and you can, at any stage enter
    <tt class="userinput"><b>m</b></tt> to see the available commands. If you do
    that the result would be
   </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br>             Command   action <br>                a      toggle a bootable flag <br>                b      edit bsd disklabel 
<br>                c      toggle the dos compatibility flag <br>                d      delete a partition <br>                l      list known partition types <br>                m      print this menu <br>                n      add a new partition 
<br>                o      create a new empty DOS partition table <br>                p      print the partition table <br>                q      quit without saving changes <br>                s      create a new empty Sun disklabel 
<br>                t      change a partition's system id <br>                u      change display/entry units <br>                v      verify the partition table <br>                w      write table to disk and exit 
<br>                x      extra functionality (experts only) <br>   </font></pre></td></tr></tbody></table><p>
    Your memory stick must be plugged in, but not mounted. Take care
    that write protect is off.
   </p><p> Here goes:</p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br>             <tt class="prompt">#</tt><tt class="userinput"><b><b class="command"> fdisk
</b> /dev/sda</b></tt> <br>             Command (m for help):<tt class="userinput"><b>d</b></tt> {enter }<br>             Selected partition 1  <br>             Command (m for help):<tt class="userinput"><b>n</b></tt> {enter} 
<br>             Command action  <br>                e  extended  <br>                p  primary partition (1-4)  <br>             <tt class="userinput"><b>p</b></tt> {enter}  <br>             Partition number (1-4):<tt class="userinput">
<b>1</b></tt> {enter} <br>             First cylinder (1-888, default 1): {press enter} <br>             Using default value 1  <br>             Last cylinder ... (1-888, default 888): {press enter} <br>             Using default value 888  
<br>   </font></pre></td></tr></tbody></table><p> 
    Now is a good time to verify that all went well by printing out
    the partition details and table.
   </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br>             Command (m for help): <tt class="userinput"><b>p</b></tt> <br>             Disk /dev/sda: 131 MB, 131072000 bytes  
<br>             9 heads, 32 sectors/track, 888 cylinders  <br>             Units = cylinders of 288 * 512 = 147456 bytes <br><br>             Device     Boot Start End Blocks Id System <br>          <br>             /dev/sda1         1   888 127856 83 Linux 
<br>   </font></pre></td></tr></tbody></table><p>
    Make sure that the partition is not set up as bootable. There
    should not be an asterisk under the heading &quot;Boot&quot; in the
    partition table. Furthermore, the headings &quot;Id&quot; and &quot;System&quot;
    should be as they are in the printout shown above. That indicates
    that you can format the device in ext2 (next section). These are
    the defaults. If they are not, they can be changed by
   </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br>             Command (m for help): <tt class="userinput"><b>a</b></tt> [toggle a bootable flag] <br>             Command (m for help): 
<tt class="userinput"><b>t</b></tt> [change a partition's system id] <br>   </font></pre></td></tr></tbody></table><p> 
     If (or when) the partition table is correct, you can conclude the
     procedure with
    </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><font color="#000000"><pre class="screen">             Command (m for help): <tt class="userinput"><b>w</b></tt> [write table to disk and exit] <br>
    </pre></font></td></tr></tbody></table><p> That's it!</p></div><div class="sect2"><hr><h2 class="sect2"><a name="making-ext2"></a>8.2. Making an ext2 device</h2><p> 
    Having completed the partition part, we go straight on to
    &quot;formatting&quot; the device in ext2. For this we use the tool
    mke2fs. This is straightforward.
   </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br>             <tt class="prompt">#</tt> <tt class="userinput"><b><b class="command">mke2fs</b> /dev/sda1
</b></tt> <br>   </font></pre></td></tr></tbody></table><p>
    You might like to watch the led on your memory stick flicker
    while this is happening. When it stops, the job is done.
   </p></div><div class="sect2"><hr><h2 class="sect2"><a name="tests4"></a>8.3. Tests -- ext2</h2><p> 
    To see if you were successful, essentially repeat the procedures
    described in <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#mounting">Section 7.3</a> and <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#tests">Section 7.4</a>
    with two exceptions of detail. In the first place the mount
    command should be
   </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br>             <tt class="prompt">#</tt> <tt class="userinput"><b><b class="command">mount</b> -t ext2 /dev/sda1 /mnt/memstick
</b></tt> <br>   </font></pre></td></tr></tbody></table><p> 
    The second exception is that the permissions on your favourite
    text file should not change anymore.
   </p></div></div><div class="sect1"><hr><h1 class="sect1"><a name="mixed"></a>9. Setting up a dual partition</h1><div class="sect2"><h2 class="sect2"><a name="double-partition"></a>9.1. Partitioning</h2><p>
  The procedures described here will partition the flash memory device
  in two pieces -- one of the partitions will be formatted in ext2 and
  the other in vfat. This may be handy when the device is to be used
  to transport data between two (or more) Linux machines (ext2) and between Linux
  and Windows machines (vfat)
</p><div class="important"><table class="important" border="0" width="100%"><tbody><tr><td align="center" valign="top" width="25"><img src="http://www.tldp.org/HOWTO/html_single/images/important.gif" alt="Important" hspace="5">
</td><td align="left" valign="top"><p>
    The device mapped to <tt class="filename">/dev/sda</tt> will be
    re-formatted. Any data present on it will be destroyed.  To make
    sure that the device you work with is the one intended, remove
    similar devices from the USB-bus before starting these procedures.
  </p></td></tr></tbody></table></div><p> 
    In this section we describe how to set up a dual partition for
    the memory stick: One half of the device will be
    devoted to the vfat filesystem, and the other will be ext2. In
    this way your device will be more versatile, but also a little
    shattered. The procedure will be given in somewhat less detailed
    than in <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#partition">Section 8.1</a> . Note that the procedure
    of the previous section is repeated and that the hex code for 
    each file type is explicitly entered (lines following the entry 
    &quot;t&quot;: Win95 = b; Linux = 83). When the partition will only be for
    Linux, this is unnecessary -- Linux is the default. Also note that
    the vfat partition goes on first -- that is the way Windows would 
    have it.
   </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br>             <tt class="prompt">#</tt> <tt class="userinput"><b><b class="command">fdisk</b> /dev/sda</b>
</tt><br>            <br>             <tt class="prompt">Command (m for help):</tt> <tt class="userinput"><b>d</b></tt><br>             <tt class="computeroutput">Selected partition 1</tt><br><br>             <tt class="prompt">
Command (m for help):</tt> <tt class="userinput"><b>n</b></tt><br>             <tt class="computeroutput">Command action<br>                e   extended<br>                p   primary partition (1-4)</tt><br>             
<tt class="userinput"><b>p</b></tt><br>             <tt class="prompt">Partition number (1-4):</tt> <tt class="userinput"><b>1</b></tt><br>             <tt class="prompt">First cylinder (1-888, default 1): </tt><br>             
<tt class="computeroutput">Using default value 1</tt><br>             <tt class="prompt">Last cylinder or +size or +sizeM or +sizeK (1-888,<br>                   default 888):</tt><tt class="userinput"><b>444</b></tt><br>
             <tt class="prompt">Command (m for help):</tt> <tt class="userinput"><b>t</b></tt><br>             <tt class="computeroutput">Selected partition 1</tt><br>             <tt class="prompt">Hex code (type L to list codes):
</tt> <tt class="userinput"><b>b</b></tt><br>             <tt class="computeroutput"><br>              Changed system type of partition 1 to b (Win95 FAT32)<br>             </tt><br>             <tt class="prompt">Command (m for help):
</tt> <tt class="userinput"><b>n</b></tt><br>             <tt class="computeroutput">Command action<br>                e   extended<br>                p   primary partition (1-4)</tt><br>             <tt class="userinput">
<b>p</b></tt><br>             <tt class="prompt">Partition number (1-4):</tt> <tt class="userinput"><b>2</b></tt><br>             <tt class="prompt">First cylinder (445-888, default 445): </tt><br>             <tt class="computeroutput">
Using default value 445</tt><br>             <tt class="prompt"><br>              Last cylinder or +size or +sizeM or +sizeK (445-888,<br>              default 888): <br>             </tt><br>             <tt class="computeroutput">
Using default value 888</tt><br><br>             <tt class="prompt">Command (m for help):</tt> <tt class="userinput"><b>t</b></tt><br>             <tt class="prompt">Partition number (1-4):</tt> <tt class="userinput"><b>2
</b></tt><br>             <tt class="prompt">Hex code (type L to list codes):</tt> <tt class="userinput"><b>83</b></tt><br><br>             <tt class="prompt">Command (m for help):</tt> <tt class="userinput"><b>p</b></tt>
<br><br>             <tt class="computeroutput"><br>                                 Disk /dev/sda: 131 MB, 131072000 bytes<br>             9 heads, 32 sectors/track, 888 cylinders<br>             Units = cylinders of 288 * 512 = 147456 bytes<br><br>
                Device Boot    Start       End    Blocks   Id  System<br>             /dev/sda1             1       444     63920    b  Win95 FAT32<br>             /dev/sda2           445       888     63936   83  Linux<br>
                                 </tt><br><br>             <tt class="prompt">Command (m for help):</tt><tt class="userinput"><b>w</b></tt><br><br>   </font></pre></td></tr></tbody></table><div class="note"><table class="note" border="0" width="100%">
<tbody><tr><td align="center" valign="top" width="25"><img src="http://www.tldp.org/HOWTO/html_single/images/note.gif" alt="Note" hspace="5"></td><td align="left" valign="top"><p>
    Note that we went on with the second partition before writing.
   </p></td></tr></tbody></table></div><p>
    The choice of splitting the device right in the middle (1--444;
    445--888 for a 128 MB memory stick) is arbitrary. Any other
    well-conceived splitting would be fine.
   </p><p>
    If you had more than one partition to begin with, the &quot;delete&quot;
    part of the procedure would have to be repeated.
   </p></div><div class="sect2"><hr><h2 class="sect2"><a name="both"></a>9.2. Making a dual ext2/vfat system</h2><p> 
    This step is a repetition of <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#making-ext2">Section 8.2</a>. The first step
         makes the dos partition, the second makes the Linux ext2 partition.
   </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br>             <tt class="prompt">#</tt> <tt class="userinput"><b><b class="command">mkdosfs</b> -F 32 /dev/sda1
</b></tt><br>             <tt class="prompt">#</tt> <tt class="userinput"><b><b class="command">mke2fs</b> /dev/sda2</b></tt><br>   </font></pre></td></tr></tbody></table></div><div class="sect2"><hr><h2 class="sect2"><a name="mixed-tests">
</a>9.3. Tests -- ext2 and vfat</h2><p> 
    Simply carry out the tests of <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#tests">Section 7.4</a> and <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#tests4">Section 8.3</a> on the two devices separately. The mount commands
    would be
   </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br>             <tt class="prompt">#</tt> <tt class="userinput"><b><b class="command">mount</b> -t vfat /dev/sda1 /mnt/fatstick 
</b></tt><br>             <tt class="prompt"># </tt><tt class="userinput"><b><b class="command">mount</b> -t ext2 /dev/sda2 /mnt/memstick</b></tt><br>   </font></pre></td></tr></tbody></table><p>
         to mount both partitions on your device.
   </p></div><div class="sect2"><hr><h2 class="sect2"><a name="config-linux"></a>9.4. Configuring Linux for the dual partition</h2><p>
   The Linux machine you did the partitioning on, will be
   configured for the dual partition. Evidently you need to carry the
   keychain to another Linux machine. There you will find that it only
   sees <tt class="filename">/dev/sda1</tt>. This is, perhaps, a shortcoming
   of the kernel. The workaround is as follows: On the new host
   machine do (keychain plugged in but not mounted)
  </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br>             <tt class="prompt">#</tt> <tt class="userinput"><b><b class="command">fdisk</b> /dev/sda</b>
</tt><br>                   <tt class="computeroutput">Choose p; check partition table<br>                   If satisfied, choose w</tt><br>             <tt class="prompt">#</tt> <tt class="userinput"><b><b class="command">
less</b> /proc/partitions</b></tt><br>  </font></pre></td></tr></tbody></table><p>
   Your device with its partitions should be there. Data on your
   keychain should be untouched. For a single partition this is not 
   necessary.
  </p></div></div><div class="sect1"><hr><h1 class="sect1"><a name="users"></a>10. Making the memory stick accessible to users</h1><p> 
    What we have described so far, are simply the procedures of setting
    up the system and formatting memory sticks. We have to make the
    mounting of the USB filesystem more permanent, and we have to make
    mounting of such a device easier for non-root users. There are
    only a few things to be done.
   </p><p>
    The procedure described below is for the more complex situation of
    a memory stick with a dual partition (<a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#mixed">Section 9</a>). If 
    the partition is a single ext2, the procedure should be simplified
    by leaving out the line referring to the vfat part and changing 
    <tt class="filename">sda2</tt> to <tt class="filename">sda1</tt>.
   </p><p> 
    Suppose that the mount points <tt class="filename"> /mnt/memstick</tt>
    and <tt class="filename"> /mnt/fatstick</tt> have been created. You do
    not have to use those words and they don't even have to be
    sub-directories of <tt class="filename"> /mnt</tt>
   </p><p> 
    To make remembering easier, create the following symbolic links:
   </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br> <br>             <tt class="prompt">#</tt> <tt class="userinput"><b><b class="command">ln</b> -s /dev/sda1 /dev/fatflash
</b></tt><br>             <tt class="prompt">#</tt> <tt class="userinput"><b><b class="command">ln</b> -s /dev/sda2 /dev/flash</b></tt> <br>   </font></pre></td></tr></tbody></table><p> 
    For smoother and easier mounting add the following lines to
   <tt class="filename"> /etc/fstab</tt> : (<em> See NOTE at the end of
   </em> <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#mounting">Section 7.3</a> )</p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br>             none          /proc/bus/usb usbfs       defaults       0 0 
<br>             /dev/flash    /mnt/memstick ext2,vfat   rw,user,noauto 0 0 <br>             /dev/fatflash /mnt/fatstick vfat        rw,user,noauto 0 0 <br>   </font></pre></td></tr></tbody></table><p> 
    The middle line enables mounting either in ext2 or vfat.
    The last two lines make it possible for any user to mount the
    device by the command
   </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br>             <tt class="prompt">$</tt><tt class="userinput"><b><b class="command"> mount</b> /dev/flash
</b></tt>  [for ext2 or vfat] <br>             <tt class="prompt">$</tt><tt class="userinput"><b><b class="command"> mount</b> /dev/fatflash</b></tt>  [for vfat] <br>   </font></pre></td></tr></tbody></table><p> 
     It is possible to mount both partitions simultaneously. See <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#mixed">Section 9</a>.
   </p><p> 
    In the case of an ext2-formatted device it does not seem possible
    for a user (other than root) to mount in read-write mode. The
    solution is to create a directory on the memory stick owned by the
    particular user with complete permissions. Root should do that:
   </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br>             <tt class="prompt">#</tt> <tt class="userinput"><b><b class="command">mount </b>/dev/flash 
</b></tt><br>             <tt class="prompt"># </tt><tt class="userinput"><b><b class="command">mkdir</b> -m 777 /mnt/memstick/superdir </b></tt><br>             <tt class="prompt"># </tt><tt class="userinput"><b><b class="command">
chown</b> charles:charles /mnt/memstick/superdir </b></tt><br>   </font></pre></td></tr></tbody></table><p>
    If the device is in the vfat format, this step is unnecessary.
   </p><p> 
    In conclusion, here is a small script I use to mount and unmount
    my (ext2) flash drive:
   </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="programlisting"><font color="#000000"><br>             #!/bin/bash <br>             EXCODE=&quot;keepit&quot; <br>             green='\033[0;32m' 
<br>             yellow='\033[0;33m' <br>             ## ___________________________ <br>             ## Function to echo in colours <br>             echo_in_color () <br>             { <br>                  message=$2 <br>
                  message1=$4 <br>                  color=$1 <br>                  color1=$3 <br>                  echo -e -n $color <br>                      echo -n $message <br>                  echo -e -n $color1 &quot; &quot; <br>
                  echo  -n $message1 &quot; &quot; <br>                  tput sgr0 <br>                  return <br>             } <br>             ## ___________________________ <br>             clear <br>             mount /dev/flash 
<br>             echo_in_color $green &quot;Flash drive mounted&quot; <br>             sleep 2 <br>             while [ $EXCODE != &quot;flexit&quot; ] <br>                  do <br>                     clear <br>                     echo_in_color $yellow &quot;Enter [flexit] to unmount and exit:&quot; 
<br>                     read EXCODE <br>                  done <br>             umount /dev/flash <br>             exit <br>   </font></pre></td></tr></tbody></table><p> 
    I call this from an FVWM menu by <tt class="userinput"><b> Exec exec xterm
    -geometry 43x2+1250+0 -e /home/nikos/bin/flashdrive</b></tt>
    which places it on a tiny x-term in one corner of the screen. The
    horizontal displacement of 1250 may have to be modified according
    to the horizontal resolution of your screen.
   </p></div><div class="sect1"><hr><h1 class="sect1"><a name="maintain"></a>11. Maintenance</h1><div class="sect2"><h2 class="sect2"><a name="fs-inspect"></a>11.1. Filesystem inspection</h2><p>
    It is a virtuous habit to inspect your ext2 filesystem on the
    flash memory regularly. To do this, the tool
    <span class="application">dumpe2fs</span> may be used in the following way:
    <tt class="prompt"># </tt><tt class="userinput"><b><b class="command">dumpe2fs</b> -h /dev/sda1</b></tt> (you must be root and
    the device should not be mounted). The result should be similar to
    the following:
   </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br>             Filesystem volume name:   &lt;none&gt;<br>             Last mounted on:          &lt;not available&gt;
<br>             Filesystem UUID:          c42a6963-5e6a-4cd2-b7d7-c8f09dca6c52<br>             Filesystem magic number:  0xEF53<br>             Filesystem revision #:    1 (dynamic)<br>             Filesystem features:      dir_index filetype sparse_super
<br>             Default mount options:    (none)<br>             Filesystem state:         clean<br>             Errors behavior:          Continue<br>             Filesystem OS type:       Linux<br>             Inode count:              32000
<br>             Block count:              127856<br>             Reserved block count:     6392<br>             Free blocks:              116456<br>             Free inodes:              31922<br>             First block:              1
<br>             Block size:               1024<br>             Fragment size:            1024<br>             Blocks per group:         8192<br>             Fragments per group:      8192<br>             Inodes per group:         2000
<br>             Inode blocks per group:   250<br>             Filesystem created:       Sat Sep 20 12:43:00 2003<br>             Last mount time:          Tue Oct 28 14:13:03 2003<br>             Last write time:          Tue Oct 28 14:28:27 2003
<br>             Mount count:              13<br>             Maximum mount count:      35<br>             Last checked:             Sat Oct 18 11:28:26 2003<br>             Check interval:           15552000 (6 months)<br>
             Next check after:         Thu Apr 15 11:28:26 2004<br>             Reserved blocks uid:      0 (user root)<br>             Reserved blocks gid:      0 (group root)<br>             First inode:              11
<br>             Inode size:               128<br>             Default directory hash:   tea<br>             Directory Hash Seed:      118bee0a-efa5-4771-967e-41a0badd0355<br>   </font></pre></td></tr></tbody></table><p>
    A few important aspects need to be pointed out.
   </p><ul><li><p>
           When the ext2 filesystem is created, it is by default
           given maximal usage before it has to be checked. These can
           be seen <em> Maximum mount count </em> (35) and
           <em> Check interval</em> (expiry date).
         </p></li><li><p>
           The usage so far: <em> Mount count</em> and
           <em> Last checked</em> .
         </p></li><li><p>
           The existence of corrupted files (bad blocks):
           <em> Filesystem state</em> .
         </p></li></ul><p>
    You might get warnings about these things when you mount the
    device or when you try the read files from the device.
   </p></div><div class="sect2"><hr><h2 class="sect2"><a name="and-then"></a>11.2. And then?</h2><p>
    When the usage allocation has been spent, or there is evidence of
    file corruption, the thing to do is to run <tt class="prompt">#</tt> <tt class="userinput"><b><b class="command">fsck.ext2</b> /dev/sda1</b></tt> with the device unmounted. After that, usage
    parameters will be freshly allocated and bad blocks will be gone.
    </p><div class="note"><table class="note" border="0" width="100%"><tbody><tr><td align="center" valign="top" width="25"><img src="http://www.tldp.org/HOWTO/html_single/images/note.gif" alt="Note" hspace="5"></td><td align="left" valign="top">
<p> 
       When dealing with the vfat system, the <span class="application">
       dump</span> does not seem to exist. The command
       <tt class="prompt">#</tt> <tt class="userinput"><b><b class="command">dumpe2fs</b> -f /dev/sda1</b></tt> for filesystems
       other than ext2 does not work for vfat. The tool <span class="application">
       dosfsck</span> exists (it is still Alpha), and may be
       risky to use on a device you have not formatted yourself.
      </p></td></tr></tbody></table></div></div></div><div class="sect1"><hr><h1 class="sect1"><a name="linux-2.6"></a>12. The Linux-2.6 kernel</h1><div class="sect2"><h2 class="sect2"><a name="What-is-new"></a>12.1. What is new?
</h2><p> 
      Setting up your system as described above for the Linux-2.4.x
      kernels will be perfectly good, but with the Linux-2.6.x kernels
      (x = 0, 1, 2, 3 at the time of this writing) much more is possible:
     </p><ul><li><p>
          USB Hotplugging of devices has been improved immensely. This
          means that it has become possible to attach and remove a
          device from the USB port with full cognisance of the
          system. If a device is attached, it will show in the /proc
          filesystem. Once it is removed, it will not show anymore.
         </p></li><li><p>
          The <em>sysfs</em> system has been
          introduced. By using this facility, a very tight grip on
          attached devices, their attributes and nodes of attachment
          is possible.
         </p></li><li><p>
          Utilities for handling hotplugging have been improved or
          became available. With the aid of these it is possible to
          easily distinguish between attached devices irrespective of
          the order in which they were attached.
         </p></li></ul></div><div class="sect2"><hr><h2 class="sect2"><a name="kernel-options"></a>12.2. Kernel options</h2><p>
      Kernel configuration options are very much the same as described
      in <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#kernel">Section 5.2</a>. The configuration menu
      (<tt class="prompt">#</tt><tt class="userinput"><b><b class="command"> make </b>  
      menuconfig</b></tt>) has been organized differently
      and more systematically. Here are the relevant choices:
     </p><div class="sect3"><hr><h3 class="sect3"><a name="bus-options"></a>12.2.1. Bus options</h3><ul compact="COMPACT"><li style="list-style-type: none;"><span>
           Support for hot-pluggable devices (CONFIG_HOTPLUG)
          </span></li></ul></div><div class="sect3"><hr><h3 class="sect3"><a name="device-drivers"></a>12.2.2. Device drivers</h3><ul compact="COMPACT"><li style="list-style-type: disc;"><span>
           <strong> SCSI device support</strong>
          </span></li><li style="list-style-type: none;"><span>
            SCSI device support (CONFIG_SCSI scsi_mod)
          </span></li><li style="list-style-type: none;"><span> 
           legacy /proc/scsi support (CONFIG_SCSI_PROC_FS)
          </span></li><li style="list-style-type: none;"><span> 
           SCSI disk support (CONFIG_BLK_DEV_SD sd_mod)
          </span></li><li style="list-style-type: none;"><p> </p><br>
</li><li style="list-style-type: disc;"><span>
           <strong> USB support</strong>
          </span></li><li style="list-style-type: none;"><span>
           Support for USB (CONFIG_USB usbcore)
          </span></li><li style="list-style-type: none;"><span>
           USB device filesystem (CONFIG_USB_DEVICEFS)
          </span></li><li style="list-style-type: none;"><span>
           UHCI HCD support (CONFIG_USB_UHCI_HCD uhci_hcd) 
          </span></li><li style="list-style-type: none;"><span>
           USB Mass Storage support (CONFIG_USB_STORAGE usb_storage)
          </span></li></ul></div><div class="sect3"><hr><h3 class="sect3"><a name="fss-2.6"></a>12.2.3. File systems</h3><ul compact="COMPACT"><li style="list-style-type: none;"><span> 
           Second extended (CONFIG_EXT2_FS ext2)
          </span></li><li style="list-style-type: none;"><p> </p><br>
</li><li style="list-style-type: disc;"><span> 
           <strong> DOS/FAT/NT filesystems</strong>
          </span></li><li style="list-style-type: none;"><span> 
           DOS FAT fs support (CONFIG_FAT_FS fat)
          </span></li><li style="list-style-type: none;"><span> 
           MSDOS fs support (CONFIG_MSDOS_FS msdos)
          </span></li><li style="list-style-type: none;"><span> 
           VFAT (Windows 95) fs support (CONFIG_VFAT_FS vfat)
          </span></li><li style="list-style-type: none;"><p> </p><br>
</li><li style="list-style-type: disc;"><span>
           <strong> Pseudo filesystems</strong>
          </span></li><li style="list-style-type: none;"><span> 
           /proc file system support (CONFIG_PROC_FS)
          </span></li></ul></div></div><div class="sect2"><hr><h2 class="sect2"><a name="notes-2.6"></a>12.3. Notes</h2><p>
     It may be in your interest to consult 
        <a href="http://thomer.com/linux/migrate-to-2.6.html" target="_top">
          Migrating to Linux Kernel 2.6</a>,
     but it is not necessary to follow steps that cannot be followed.
    </p></div><div class="sect2"><hr><h2 class="sect2"><a name="hotplug"></a>12.4. Hotplugging and Naming</h2><p>
         In <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#scsidev">Section 6.2</a> the situation of two USB
         devices plugged in at the same time was discussed. The
         difficulty is that it becomes hard for the user to
         distinguish the two devices. Progress recently made in the
         <a href="http://sourceforge.net/search/" target="_top">Linux Hotplug
         Project </a> (search for hotplug) and implemented in the
         2.6-series of kernels, has made it possible to address this
         problem efficiently. For implementation some utilities are
         needed:
       </p><ul compact="COMPACT"><li><span> sysfs -- compiled by default into Linux-2.6.x
          </span></li><li><span>
           <a href="http://linux-diag.sourceforge.net/Sysfsutils.html" target="_top">
            sysfsutils-0.4.0 or later</a>
          </span></li><li><span> 
           <a href="http://sourceforge.net/projects/linux-hotplug" target="_top">
           hotplug-2004_01_05 or later</a>
          </span></li><li><span>
            <a href="http://www.kernel.org/pub/linux/utils/kernel/hotplug" target="_top">
             udev-016 or later</a>
          </span></li></ul><div class="sect3"><hr><h3 class="sect3"><a name="installation"></a>12.4.1. Installation</h3><div class="formalpara"><p><b>The sysfs filesystem. </b></p></div><p>
             The <em>sysfs</em> filesystem is intrinsic to
             the Linux-2.6 kernel series. It is used by
             <em>udev</em> and
             <em>sysfstools</em> to obtain information
             about kernel objects (devices, etc.), their attributes
             and mutual linkages. Activation is according to the
             following procedure:
            </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br>              <tt class="prompt"># </tt><tt class="userinput"><b><b class="command">cd</b></b>
</tt> /<br>              <tt class="prompt"># </tt><tt class="userinput"><b><b class="command">mkdir</b></b></tt> sys<br>              <tt class="prompt"># </tt><tt class="userinput"><b><b class="command">mount</b></b></tt>
 -t sysfs none /sys<br>            </font></pre></td></tr></tbody></table><p> 

             If you do <tt class="userinput"><b><b class="command"> ls </b>  -F
             /sys</b></tt>, a whole directory structure
             with entries like <em>block/</em>,
             <em>bus/</em>, ... will be shown. You were
             successful. The mounting should now be made permanent by
             adding the following line to
             <tt class="filename">/etc/fstab</tt>:
            </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><font color="#000000"><pre class="screen">              none  /sys   sysfs  defaults  0  0<br>            </pre></font></td></tr></tbody></table>
<div class="formalpara"><p><b>Sysfsutils. </b></p></div><p>
             This is installed in one of the usual ways without having
             to make special configuration options. Instructions in
             the README file are very clear. You should, however,
             first make sure that the entry
             <tt class="filename">/usr/local/lib</tt> is entered in
             <tt class="filename">/etc/ld.so.conf</tt> so that the
             <tt class="filename">libsysfs.so</tt> libraries will be
             recognisable by the system. After installation, check
             that the utilities <tt class="filename">/usr/local/bin/lsbus</tt>
             and <tt class="filename">/usr/local/bin/systool</tt> have been
             installed. Also check that the libraries mentioned above
             have been properly linked in
             (<tt class="userinput"><b><b class="command">ldconfig </b>-p | grep
             libsysfs</b></tt>).
           </p><div class="formalpara"><p><b>Hotplug. </b></p></div><p>
             Next install the <tt class="filename">hotplug</tt>
             scripts. The first thing to do is to check that
             hotplugging will work on your system. Do:
             <tt class="userinput"><b><b class="command"> less </b>
             /proc/sys/kernel/hotplug</b></tt>. The
             result should be
             <tt class="computeroutput">/sbin/hotplug</tt>. If it is
             not so, you should add the line <tt class="filename"> echo
             &quot;/sbin/hotplug&quot; &gt; /proc/sys/kernel/hotplug</tt> to
             an appropriate initialization script,
             e.g. <tt class="filename">/etc/rc.d/rc.local</tt>. This
             command could also be given (as root) before checking
             that everything works. Installation is extremely
             simple. Do: <tt class="prompt"># </tt><tt class="userinput"><b><b class="command"> make
             </b> install</b></tt>. Check afterwards that the
             script <tt class="filename">/sbin/hotplug</tt> exists.
            </p><div class="formalpara"><p><b>Udev. </b></p></div><p>
             This is the last installation. Study the README file and
             follow the instructions necessary to be able to run
             <tt class="userinput"><b><b class="command">make </b>
             USE_KLIBC=true</b></tt>. If you have
             compiled the Linux-2.6.x kernel, this should not be too
             difficult. A quick check would be to find out if
             <tt class="filename">/sbin/udev</tt> and
             <tt class="filename">/sbin/udevinfo</tt> exist. There are
             other occurences as well, a very important one being
             <tt class="filename">/etc/udev/udev.rules</tt>. If you have a
             working setup for memory sticks (as described above) and
             a memory stick plugged in you could try
             <tt class="userinput"><b><b class="command">ls </b>/udev</b></tt>, you
             should see the device (sda, sda1, ...). If it is there,
             unplug the device and list again. It should be gone!
           </p></div><div class="sect3"><hr><h3 class="sect3"><a name="names"></a>12.4.2. Naming memory sticks</h3><p>
             With the <em>udev</em> utility in place, it
             is possible to identify a memory stick on the basis of
             some built-in attribute. One that works, is the
             <em>vendor</em> identity. To find this for an
             attached device, do <tt class="userinput"><b><b class="command">systool
             </b> -vb scsi | grep vendor</b></tt>. This
             should give a list of attached SCSI devices (remember
             that your memory stick poses as a SCSI device <a href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#scsidev">Section 6.2</a>). Let us suppose that you have two
             memory sticks plugged in at the same time and found (as I
             did) two vendor Id's, namely &quot;UFD&quot; and &quot;STORAGE&quot;. Then
             add to the file <tt class="filename">/etc/udev/udev.rules</tt>
             the following lines (at the top if you like):
           </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><font color="#000000"><pre class="screen">              ## Flash Memory 1<br>              BUS=&quot;scsi&quot;, SYSFS_vendor=&quot;UFD*&quot;, NAME=&quot;namib%n&quot;
<br><br>              ## Flash Memory 2<br>              BUS=&quot;scsi&quot;, SYSFS_vendor=&quot;STORAGE*&quot;, NAME=&quot;kalahari%n&quot;<br>           </pre></font></td></tr></tbody></table><p>
             The vendor-identities may have trailing blank spaces, and
             therefore the wildcard asterisks have a purpose. Do not
             ignore them.  Remove and replace the memory sticks, then
             do <tt class="userinput"><b><b class="command">ls </b>
             /udev</b></tt>. Instead of the impersonal
             <tt class="filename">sda</tt>, <tt class="filename">sda1</tt>,
             etc. there should now be <tt class="filename">kalahari</tt>,
             <tt class="filename">kalahari1</tt>,
             <tt class="filename">namib</tt> and
             <tt class="filename">namib1</tt>. The devices have been named
             according to the &quot;vendor&quot; information in them. Thus we
             can identify the device, no matter where it was
             mapped. All that remains to be done is to creat
             appropriate mount points like
             <tt class="filename">/mnt/namib</tt> and
             <tt class="filename">kalahari</tt> and make entries like
           </p><table bgcolor="#e0e0e0" border="0" width="100%"><tbody><tr><td><pre class="screen"><font color="#000000"><br>             /udev/namib1     /mnt/namib     vfat,ext2  user,noauto,rw  0 0 <br>             /udev/kalahari1  /mnt/kalahari  vfat,ext2  user,noauto,rw  0 0         
<br>            </font></pre></td></tr></tbody></table><p>
             in <tt class="filename">/etc/fstab</tt> to enable mounting
             from other places.
           </p><p>
             This is great fun ... and remember, there are other
             deserts on the planet.
           </p></div></div></div><div class="sect1"><hr><h1 class="sect1"><a name="formal"></a>13. Formalities</h1><div class="sect2"><h2 class="sect2"><a name="copyright"></a>13.1. Copyright Information</h2><p>
    This document is copyrighted (c) 2003 Niko Sauer and is
    distributed under the terms of the Linux Documentation Project
    (LDP) license, stated below.
   </p><p>
    Unless otherwise stated, Linux HOWTO documents are
    copyrighted by their respective authors. Linux HOWTO documents may
    be reproduced and distributed in whole or in part, in any medium
    physical or electronic, as long as this copyright notice is
    retained on all copies. Commercial redistribution is allowed and
    encouraged; however, the author would like to be notified of any
    such distributions.
   </p><p>
    All translations, derivative works, or aggregate works
    incorporating any Linux HOWTO documents must be covered under this
    copyright notice. That is, you may not produce a derivative work
    from a HOWTO and impose additional restrictions on its
    distribution. Exceptions to these rules may be granted under
    certain conditions; please contact the Linux HOWTO coordinator at
    the address given below.
   </p><p>
    In short, we wish to promote dissemination of this
    information through as many channels as possible. However, we do
    wish to retain copyright on the HOWTO documents, and would like to
    be notified of any plans to redistribute the HOWTOs.
   </p><p>
    If you have any questions, please contact 
    <tt class="email">&lt;<a href="mailto:nikos@friedrichs.up.ac.za">nikos@friedrichs.up.ac.za </a>&gt;</tt>
   </p></div><div class="sect2"><hr><h2 class="sect2"><a name="disclaimer"></a>13.2. Disclaimer</h2><p>
    No liability for the contents of this documents can be accepted.
    Use the concepts, examples and other content at your own risk.
    As this is a new document, there may be errors
    and inaccuracies, that may of course be damaging to your system.
    Proceed with caution, and although this is highly unlikely,
    the author do not take any responsibility for that.
   </p><p>
    All copyrights are held by their by their respective owners, unless
    specifically noted otherwise.  Use of a term in this document
    should not be regarded as affecting the validity of any trademark
    or service mark.
   </p><p>
    Naming of particular products or brands should not be seen 
    as endorsements.
   </p><p>
    You are strongly recommended to take a backup of your system 
    before major installation and backups at regular intervals.
   </p></div><div class="sect2"><hr><h2 class="sect2"><a name="credits"></a>13.3. Credits</h2><p>
    I wish to express my deep gratitude towards my sons Paul and
    Philip who in 1995 persuaded me to move to Linux. Philip gave me
    profound advice and insights which made this project a pleasant
    learning experience.
   </p><p>
     Emma Jane Hogbin, in her review, raised a number of important
     questions which served to improve this document immensely. My
     sincerest thanks to her.
   </p></div><div class="sect2"><hr><h2 class="sect2"><a name="feedback"></a>13.4. Feedback</h2><p>
    Users of this document are most welcome to email me with
    suggestions on the improvement of the presentation and possible
    additions to the scope of it.
   </p></div></div></div>
<h3 class="FOOTNOTES">Notes</h3>
<table class="FOOTNOTES" border="0" width="100%">
<tbody><tr><td align="left" valign="top" width="5%"><a name="FTN.AEN104" href="http://www.tldp.org/HOWTO/html_single/Flash-Memory-HOWTO/#AEN104"><span class="footnote">[1]</span></a></td><td align="left" valign="top" width="95%">
<p>
         This document leans heavily on the texts marked with an asterisk
        </p></td></tr></tbody>
</table>
<br><br><div><span class="gmail_quote">On 9/3/06, <b class="gmail_sendername">Fouad Riaz Bajwa</b> &lt;<a href="mailto:bajwa@fossfp.org">bajwa@fossfp.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Dear Waqas and Ubuntu Users,<br>I would like you all to come in and join the international Ubuntu-Users<br>mailing list so that you have round the clock technical user support. The<br>list is here <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-users">
https://lists.ubuntu.com/mailman/listinfo/ubuntu-users</a>. Also we<br>need to track the users of Ubuntu-Linux in Pakistan so that we can come up<br>with an estimated figure of how many users are actually using Ubuntu!<br>
<br>Regards<br>-----------------------<br>Fouad Riaz Bajwa<br><br>-----Original Message-----<br>From: <a href="mailto:general-bounces@linuxpakistan.net">general-bounces@linuxpakistan.net</a><br>[mailto:<a href="mailto:general-bounces@linuxpakistan.net">
general-bounces@linuxpakistan.net</a>] On Behalf Of Waqas Toor<br>Sent: Monday, September 04, 2006 1:19 AM<br>To: Linux Pakistan; <a href="mailto:ubuntu-pk@lists.ubuntu.com">ubuntu-pk@lists.ubuntu.com</a><br>Subject: [LinuxPakistan] help needed with usb flash (ubuntu)
<br><br>hi linuxers,<br><br>i need some help to load usb flash drive ... i mean mount the drive<br>now there is not sda in drapper drake ubuntu<br>no /dev/sda etc<br>now in mtab there is an entry that shows like this<br>procbususb&nbsp;&nbsp;/proc/bus/usb/....
<br>i dont know what that means ... if i unmount the procbususb and mount<br>it to some other folder i cant get the contents either ... i get files<br>of 001 and 002<br>now tell me how to mount my usb flash drive in drapper drake ???
<br><br>i've also tried mountusbfs for example<br>/etc/init.d/mountusbfs start<br>bus what happens i dont know<br><br>so simple how to mount ha usb flash drive in ubuntu drapper drake<br><br><br>--<br>Waqas<br><br>Linux *is* user friendly. It's just selective about who its friends are.
<br>If Windows is the solution, can we please have the problem back?<br><br><a href="http://waqastoor.weblog.pk">http://waqastoor.weblog.pk</a><br>(Registered Linux user #424056)<br>ref link <a href="http://counter.li.org/">
http://counter.li.org/</a><br><br>_______________________________________________<br>General mailing list<br><a href="mailto:General@linuxpakistan.net">General@linuxpakistan.net</a><br><a href="http://mail.linuxpakistan.net/mailman/listinfo/general_linuxpakistan.net">
http://mail.linuxpakistan.net/mailman/listinfo/general_linuxpakistan.net</a><br><br>Hosting Provided by Inspedium &lt;<a href="http://www.inspedium.com/">http://www.inspedium.com/</a>&gt;<br><br><br>--<br>No virus found in this incoming message.
<br>Checked by AVG Free Edition.<br>Version: 7.1.405 / Virus Database: 268.11.7/436 - Release Date: 9/1/2006<br><br><br>--<br>No virus found in this outgoing message.<br>Checked by AVG Free Edition.<br>Version: 7.1.405 / Virus Database: 
268.11.7/436 - Release Date: 9/1/2006<br><br><br><br>--<br>Ubuntu-pk mailing list<br><a href="mailto:Ubuntu-pk@lists.ubuntu.com">Ubuntu-pk@lists.ubuntu.com</a><br><a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-pk">
https://lists.ubuntu.com/mailman/listinfo/ubuntu-pk</a><br></blockquote></div><br><br clear="all"><br>-- <br>Khawar Nehal<br><br>CEO<br>Applied Technology Research Center (ATRC)<br>C-55 Block A KDA Officers, Karachi 75260, Pakistan
<br>Voice : 92-21-4980523 Mobile : <br>Karachi 92-333-2486216 <br>Islamabad : 0334-5339171<br>Email : <a href="mailto:khawar.nehal@atrc.net.pk">khawar.nehal@atrc.net.pk</a> <br>Fax : 1-734-298-6555 Web : <a href="http://atrc.net.pk">
atrc.net.pk</a><br>Gmail account : <a href="mailto:atrc.support@gmail.com">atrc.support@gmail.com</a><br><br>Registrar<br>Preston Institute of Management, Science and Technology (PIMSAT)<br>177/2 IEP Building, Opposite Regent Plaza (Formerly Taj Mahal Hotel)
<br>Shahrah-a-Faisal, Karachi, Pakistan<br>Voice : 92-21-2789888 to 90 Fax : 92-21-2789891<br>Email : <a href="mailto:khawar@pimsat-khi.edu.pk">khawar@pimsat-khi.edu.pk</a> <br>General Inquiries : <a href="mailto:info@pimsat-khi.edu.pk">
info@pimsat-khi.edu.pk</a><br>Web : <a href="http://pimsat-khi.edu.pk">pimsat-khi.edu.pk</a>