New USB memory-stick howto: Flash-Memory-HOWTO

New USB memory-stick howto: Flash-Memory-HOWTO

Post by Matt » Wed, 31 Mar 2004 23:28:46



Hi folks.

I was trying to get my new memory stick to work with Linux and after
some time found:

http://www.ibiblio.org/pub/Linux/docs/HOWTO/Flash-Memory-HOWTO

I am nothing like an expert on this, but the document looks excellent:
well-organized, well-written, thorough, and recently revised.  I mention
it here because it did not exactly leap out at me, and I expect a lot of
people don't even know what these devices are and that they can be used
with Linux.  I have appended the first part of the file:

> USB Flash Memory HOWTO

> Niko Sauer

> Unit of Advanced Study
> University of Pretoria, South Africa


> Revision History                                                            
> Revision 0.06            2004-03-10           Revised by: ns                
> Added section on Linux-2.6.                                                  
> Revision 0.05            2003-12-26           Revised by: ejh                
> Technical review.                                                            
> Revision 0.04            2003-12-11           Revised by: ns                
> Revision 0.03            2003-12-02           Revised by: ejh                
> Technical review.                                                            
> Revision 0.02            2003-10-30           Revised by: ns                
> Changed 2003-11-20                                                          

>   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.

> -----------------------------------------------------------------------------
> Table of Contents
> 1. Purpose
> 2. Physical devices
> 3. Buying a memory stick
> 4. Reading
> 5. Hardware and kernel
>     5.1. Setup
>     5.2. Kernel options
>     5.3. Notes

> 6. Some basic concepts
>     6.1. The /proc filesystem
>     6.2. SCSI devices
>     6.3. The USB device filesystem
>     6.4. The ext2 filesystem
>     6.5. The vfat filesystem
>     6.6. Explanation of command options

> 7. Basic verifications
>     7.1. A quick check
>     7.2. Probing the /proc filesystem
>     7.3. Mounting the USB filesystem
>     7.4. Tests -- vfat

> 8. Setting up an Ext2 filesystem
>     8.1. Partitioning
>     8.2. Making an ext2 device
>     8.3. Tests -- ext2

> 9. Setting up a dual partition
>     9.1. Partitioning
>     9.2. Making a dual ext2/vfat system
>     9.3. Tests -- ext2 and vfat
>     9.4. Configuring Linux for the dual partition

> 10. Making the memory stick accessible to users
> 11. Maintenance
>     11.1. Filesystem inspection
>     11.2. And then?

> 12. The Linux-2.6 kernel
>     12.1. What is new?
>     12.2. Kernel options
>     12.3. Notes
>     12.4. Hotplugging and Naming

> 13. Formalities
>     13.1. Copyright Information
>     13.2. Disclaimer
>     13.3. Credits
>     13.4. Feedback

> 1. Purpose

>   The purpose of this document is to describe procedures for implementing USB
> flash memory devices (memory sticks) on Linux. This entails the following:

>   *   making over-the-counter devices, pre-formatted for the MS Windows
>     system, work on Linux;

>   *   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;

>   *   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;

>   *   making the device more user friendly;

>   *   maintaining the filesystem of the device;

>   *   using additional features of Linux-2.6.x.

 
 
 

New USB memory-stick howto: Flash-Memory-HOWTO

Post by Lin?nu » Thu, 01 Apr 2004 09:45:47


["Followup-To:" header set to comp.os.linux.advocacy.]

Error BR-549: MS DRM 1.0 rejects the following post from Matt:

Quote:> Hi folks.

> I was trying to get my new memory stick to work with Linux and after
> some time found:

> http://www.ibiblio.org/pub/Linux/docs/HOWTO/Flash-Memory-HOWTO

If you format your dongle using Windoze's Format GUI, you kill it for use in
Linux.  To make it most like it shipped from the factory, you have to delete
the partition on the dongle, mark it as FAT16 using the partitioning software,
and then use "mkfs -t vfat" on the new partition.

Then it works fine in both Windoze and Linux.

 
 
 

New USB memory-stick howto: Flash-Memory-HOWTO

Post by Craig McCluske » Sat, 03 Apr 2004 08:29:50



> ["Followup-To:" header set to comp.os.linux.advocacy.]

No. This is hardware. I don't read advocacy and others who have seen
this post may not either.

Quote:> If you format your dongle using Windoze's Format GUI, you kill it for use in
> Linux.  To make it most like it shipped from the factory, you have to delete
> the partition on the dongle, mark it as FAT16 using the partitioning software,
> and then use "mkfs -t vfat" on the new partition.

> Then it works fine in both Windoze and Linux.

As root, execute

/sbin/mkfs.vfat -c -F 32 -I /dev/sdc

(or whatever your memory stick [pendrive] connects as).

=======================================================
Options:

-c     Check the device for bad blocks before creating the file system.

-F FAT-size
       Specifies  the type of file allocation tables used (12, 16 or 32
       bit). If nothing is specified, mkdosfs will automatically
       select between 12 and 16 bit, whatever fits better for the
       filesystem size. 32 bit FAT (FAT32 format) must (still) be
       selected explicitly if you want it.

-I    Normally you are not allowed to use any 'full' fixed disk
       devices. mkdosfs will complain and tell you that it refuses to
       work. This is different when using MO disks. One doesn't
       always need partitions on MO disks. The filesytem can go
       directly to the whole disk. Under other OSes this is known as
       the 'superfloppy' format.

       This switch will force mkdosfs to work properly.
=======================================================

Just did a 2 GB pendrive this way.

[root mnt]# mount pendrive/
[root mnt]# df /mnt/pendrive/

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sdc               2043988         4   2043984   1% /mnt/pendrive

[root mnt]# sfdisk -l /dev/sdc

Disk /dev/sdc: 1016 cylinders, 65 heads, 62 sectors/track
Units = cylinders of 2063360 bytes, blocks of 1024 bytes, counting from 0

    Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sdc1          0       -       0          0    0  Empty
/dev/sdc2          0       -       0          0    0  Empty
/dev/sdc3          0       -       0          0    0  Empty
/dev/sdc4          0       -       0          0    0  Empty

[root mnt]# fdisk -l /dev/sdc

Disk /dev/sdc: 2097 MB, 2097152000 bytes
65 heads, 62 sectors/track, 1016 cylinders
Units = cylinders of 4030 * 512 = 2063360 bytes

    Device Boot    Start       End    Blocks   Id  System


Disk /dev/sdc: 2097 MB, 2097152000 bytes
65 heads, 62 sectors/track, 1016 cylinders, total 4096000 sectors
Units = sectors of 1 * 512 = 512 bytes

    Device Boot    Start       End    Blocks   Id  System

[root mnt]# sfdisk -V /dev/sdc
Warning: no primary partition is marked bootable (active)
This does not matter for LILO, but the DOS MBR will not boot this disk.
/dev/sdc: OK

Works just fine on XP, too.

Craig

 
 
 

New USB memory-stick howto: Flash-Memory-HOWTO

Post by jame » Sat, 03 Apr 2004 15:48:56




>Hi folks.

>I was trying to get my new memory stick to work with Linux and after
>some time found:

>http://www.ibiblio.org/pub/Linux/docs/HOWTO/Flash-Memory-HOWTO

Sure wish the SD reader on Toshiba Satellite A25-S307 worked under Linux.

I think I'd settle for a definitive answer that "it does not work".  
Stupid no-brand $10.00 USB smartmedia reader works, why not the Toshiba SD?
If it doesn't work, it's just a useless thing polluting my laptop, and
serves as a constant aggravation and a reminder that Linux is still not
there yet.

 
 
 

New USB memory-stick howto: Flash-Memory-HOWTO

Post by GreyClou » Sun, 04 Apr 2004 01:07:06





>> Hi folks.

>> I was trying to get my new memory stick to work with Linux and after
>> some time found:

>> http://www.ibiblio.org/pub/Linux/docs/HOWTO/Flash-Memory-HOWTO

> Sure wish the SD reader on Toshiba Satellite A25-S307 worked under
> Linux.

> I think I'd settle for a definitive answer that "it does not work".
> Stupid no-brand $10.00 USB smartmedia reader works, why not the
> Toshiba SD? If it doesn't work, it's just a useless thing polluting
> my laptop, and serves as a constant aggravation and a reminder that
> Linux is still not there yet.

So one would think.  But Toshiba designed their laptop to work exclusively
with windows.  Hence the appearance that windows just works.  Look at OS
X... pretty much bsd UNIX inside.  And all the hardware on the Apple just
works.
It is difficult to back-engineer hardware drivers when the company that
makes that piece of hardware won't tell you how it works.  Solution:  get a
laptop that will work with linux.  Sun Solaris has the same problems with
x86 hardware.  But they have a Hardware Compatibility List so that you can
make sure your hardware works.  Most of the windows hardware that is obscure
or almost virtually unknown is junk anyway and of the cheapest ilk.
 
 
 

New USB memory-stick howto: Flash-Memory-HOWTO

Post by Grant Edward » Sun, 04 Apr 2004 01:38:12



Quote:> I think I'd settle for a definitive answer that "it does not
> work".  Stupid no-brand $10.00 USB smartmedia reader works,
> why not the Toshiba SD?

Because people who design "stupid no-brand" stuff use
commodity, off-the-shelf parts for which datasheets are
availble:

  Datasheets == Linux Drivers.

When Toshiba/Compaq/Dell/whoever desings a gee-whiz, full-custom,
thingambob into a laptop mobo, they rarely provide datasheets
for the peripherals:

  No Datasheets == No Linux Drivers.

Quote:> If it doesn't work, it's just a useless thing polluting my
> laptop,

We all make a mistake and buy a useless thing once in a while.
Forgive yourself and get on with life.  :)

Quote:> and serves as a constant aggravation and a reminder that Linux
> is still not there yet.

Wrong.  Toshiba is "still not there yet".  Toshiba is the one
that has caused the thing to be useless.  * at them.

--
Grant Edwards                   grante             Yow!  Sorry, wrong ZIP
                                  at               CODE!!
                               visi.com            

 
 
 

New USB memory-stick howto: Flash-Memory-HOWTO

Post by jame » Sun, 04 Apr 2004 06:54:41




Quote:>Wrong.  Toshiba is "still not there yet".  Toshiba is the one
>that has caused the thing to be useless.  * at them.
}From the OS advocate's point of view, of course.  I'm with you.  I'm

the devil's advocate here, and I'm reflecting the consumer's point of
view.  It doesn't matter what the *reasons* are.  The result is the
same.

Maybe OSX in the Mac world will end up helping Linux.  Or maybe we will
end up with OSX on intel-ish platforms, who knows?

 
 
 

New USB memory-stick howto: Flash-Memory-HOWTO

Post by Kenny McCorma » Sun, 04 Apr 2004 11:29:01



...

Quote:>So one would think.  But Toshiba designed their laptop to work exclusively
>with windows.  Hence the appearance that windows just works.  Look at OS
>X... pretty much bsd UNIX inside.  And all the hardware on the Apple just
>works.

I know you're just *ing, and that a large part of the function of these
newsgroups is to support said *ing.  And, don't get me wrong, I'm as
much into *ing as anyone.

That said, I have to point out that my experiences with Toshiba laptops
& Linux have been pretty good.  Not perfect, and one has to accept that
unless/until the world does significantly change, hardware support under
Linux is never going to be quite as good as under Windows.  But very close
to perfect, I have to say.  Yes, the (software) modem doesn't work, but
then, who uses modems anymore?

*That* said, I have to point out that the situation with Toshiba is much
better than it is with Dell - and that:

        As far as I can tell
        the attitude of the company known as Dell
        is that Linux can go to hell.

And, finally, I don't know if my readers are going to consider a comparison
with Dell to be a valid comnparison, but it is a fact that, in the minds of
many if not most of the general public, Dell is to hardware what Microsoft
is to software - that is, the standard (like it or not) to which other
things are compared.

 
 
 

New USB memory-stick howto: Flash-Memory-HOWTO

Post by Lin?nu » Sun, 04 Apr 2004 21:08:20


Error BR-549: MS DRM 1.0 rejects the following post from Kenny McCormack:

Quote:> *That* said, I have to point out that the situation with Toshiba is much
> better than it is with Dell - and that:

>    As far as I can tell
>    the attitude of the company known as Dell
>    is that Linux can go to hell.

I've had very little trouble with Linux on my Dell Inspiron.  I am going to
replace it's RedHat install with Debian someday soon, however.

Quote:> And, finally, I don't know if my readers are going to consider a comparison
> with Dell to be a valid comnparison, but it is a fact that, in the minds of
> many if not most of the general public, Dell is to hardware what Microsoft
> is to software - that is, the standard (like it or not) to which other
> things are compared.

The general public is like my old neighbor who called me to ask what specs he
should look for in a new computer.

Why was he buying a new computer?  His old one "always freezes up."  Sigh.
Do I help him unfreeze his computer, or should I just offer to buy the old one
so I can have another box?

--
Windows XP:  the OS with a load in its pants

 
 
 

New USB memory-stick howto: Flash-Memory-HOWTO

Post by Charlie Gibb » Wed, 07 Apr 2004 08:11:33






>...
>>So one would think.  But Toshiba designed their laptop to work
>>exclusively with windows.  Hence the appearance that windows
>>just works.  Look at OS X... pretty much bsd UNIX inside.
>>And all the hardware on the Apple just works.

>I know you're just *ing, and that a large part of the function of
>these newsgroups is to support said *ing.  And, don't get me wrong,
>I'm as much into *ing as anyone.

>That said, I have to point out that my experiences with Toshiba laptops
>& Linux have been pretty good.  Not perfect, and one has to accept
>that unless/until the world does significantly change, hardware
>support under Linux is never going to be quite as good as under
>Windows.  But very close to perfect, I have to say.  Yes, the
>(software) modem doesn't work, but then, who uses modems anymore?

I do.  All the time.  So I plug a cable into the serial port and
use an external modem.

I picked up a second-hand Toshiba Satellite 4100 and loaded Slack 9.1
onto it.  It just works.  I stuffed a LinkSys NIC into one of its
PCMCIA slots.  It just works.  I start a CD player and stick an
audio CD into the drive.  It just works.

I had one _hell_ of a time getting that same PCMCIA NIC working on
a laptop running Windows.

Microsoft is not a necessary evil.  Microsoft is not necessary.

--

\ /  I'm really at ac.dekanfrus if you read it the right way.
 X   Top-posted messages will probably be ignored.  See RFC1855.
/ \  HTML will DEFINITELY be ignored.  Join the ASCII ribbon campaign!

 
 
 

New USB memory-stick howto: Flash-Memory-HOWTO

Post by Jack Strang » Wed, 07 Apr 2004 21:44:22



> That said, I have to point out that my experiences with Toshiba laptops
> & Linux have been pretty good. ...  Yes, the (software) modem doesn't work, but
> then, who uses modems anymore?

Usually,  slmdm works. (With SatPro 6100, atleast).

Jack
--
First, they fear you. Then they match you. Then they laugh at you.
Then they ignore you. Then you lose.