[SLE] USB sticks mini HOWTO

From: Silviu Marin-Caea (silviu_at_genesys.ro)
Date: 06/11/04

  • Next message: Michael Hasenstein: "Re: [SLE] eth0 and wlan0 problems in 9.1"
    Date: Fri, 11 Jun 2004 12:41:15 +0300
    To: SuSE Support Group <suse-linux-e@suse.com>
    
    

    Mike wrote:

    > Nope.. It WAS writeable in linux and winders. Guess again. It's
    > formatted with fat NOT ntfs. Has been since I bought it. Worked fine
    > in 9.0, and for that matter still does. Can't even change permissions
    > as root.

    You are trying to change permissions on a FAT volume? FAT doesn't have
    permissions. What you see is something that linux puts there depending
    on how you mounted the volume.

    Regarding USB sticks, I've seen that they come formatted in a strange
    setup, from the vendor.

    Like they have 4 partitions, yet windows displays one. I don't think
    it's useful to know what it really does, I don't care.

    I have erased all partitions, and created the FAT filesystem from linux,
    with one FAT copy only, to save some KB.

    Become root.
    To erase the whole partition table on the stick:

    dd if=/dev/zero of=/dev/look_at_the_device_name bs=512 count=1

    To look_at_the_device_name you can type "mount" after SUSE has mounted
    it and see the line with /media/usb-storage-odd-.... Device name can be
    /dev/sda, for example, ONLY if you don't have any SCSI disk, or /dev/sdX.

    After you wipe the partition table, I think you'd better take it out and
    insert it again.

    To create one FAT partition:

    fdisk /dev/sda
    "n"
    of type "e W95 FAT16 (LBA)" if you have a stick >32 M or "4 FAT16
    <32M". I think that for sticks larger that 512M you need "c W95 FAT32
    (LBA)"

    Write changes with "w"

    Create the FAT filesystem like this:

    mkdosfs -f 1 /dev/sda1

    -f 1 means only one copy of FAT. Flash-sticks are reliable, they are
    not diskettes, so having only one copy of FAT saves some KB.

    Other useful parameters:

    -F 32 for sticks larger that 512M
    -s and -S to save space (less slack) it's better to have a small sector
    size (512 bytes) and a small number of sectors per cluster.
    Fragmentation is not something you worry about on a stick. Space for
    files is allocated in clusters, that's the DOS term (blocks in Linux).
    Because files are not exact multiples of cluster size, there is unused
    space in the last cluster. That's called slack space and you want to
    reduce that, by having small clusters. However, the number of clusters
    is limited, so you need to test starting with
    -s 2 -S 512
    -s 4 -S 512
    -s 8 -S 512
    Until you don't get an error.

    You will have a stick that's OPTIMALLY formatted for space and can be
    used with Linux and Windows without any problem.

    -- 
    Check the headers for your unsubscription address
    For additional commands send e-mail to suse-linux-e-help@suse.com
    Also check the archives at http://lists.suse.com
    Please read the FAQs: suse-linux-e-faq@suse.com
    

  • Next message: Michael Hasenstein: "Re: [SLE] eth0 and wlan0 problems in 9.1"

    Relevant Pages

    • RE: File transfers between linux and windows?
      ... >> to transfer files from the Windows side to the Linux side or vice ... > partition from either ... how do you go about accessing this FAT partition ...
      (RedHat)
    • multiboot, multiple fat32 partitions
      ... Please help setting up Linux with Win98 and two FAT 32 partitions. ... logical, within extended partition. ... First thing I tried was to partition disk with linux fdisk, ...
      (comp.os.linux)
    • Re: Windows partitions
      ... >> I need to know how to read windows partitions (FAT32, NTFS) on linux. ... you do this for FAT: ... You replace NNN with the device node where the FAT partition resides; ...
      (comp.os.linux.hardware)
    • Re: FAT32 or NTFS?
      ... >>of a hugely bloated FAT and large cluster sizes, ... resilience --- As far as FAT partitions go, don't forget to wave goodbye to ... technologies imbedded in the file system ensure that data is only written on ... Which brings me to this - In an NTFS file ...
      (microsoft.public.windowsxp.general)
    • Re: Resizing FAT partitions
      ... full cluster, and are thus part of the volume, but unused. ... determining the max amount of space to partition on a given drive. ... each type of FAT with a fixed table used for floppies. ... not be able to copy to such small drives. ...
      (microsoft.public.win32.programmer.kernel)