LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-30-2006, 06:26 AM   #1
LordSurvivoR
Member
 
Registered: Jul 2005
Location: Serbia
Distribution: Gentoo
Posts: 46

Rep: Reputation: 15
Unhappy Problems with reading & writing to USB Flash Drive


No problems with mounting. The thing is that files from USB stick couldn't be earsed; it worked great in the past.
I tried a few times to do: rm -r /mnt/usb/* , and it was "done" without any complains.
ls /mnt/usb : it was empty, but after umount and mount /dev/sda1, files are there again :|

tried as well: mkdosfs /dev/sda1, again w/o errors, but after mounting, files are there again

copying in krusader "visually" goes well (indeed very slow, but w/o complains), but nothing copied.
from terminal
Code:
cp /path/to/file/file /mnt/usb gives this: cp: cannot create regular file `/mnt/usb/file': Read-only file system

last time I did:
Code:
rm -r /mnt/usb/*
rm: cannot lstat `/mnt/usb/laptop/p 25 07:.45:': Input/output error
umount, mount, rm -r /mnt/usb/* - no errors, ls /mnt/usb/ - nothing, umount, mount, ls /mnt/usb/ - files are there :roll:

Code:
cat /etc/fstab | grep /dev/sda1
/dev/sda1               /mnt/usb        auto            noatime,noauto,user,rw,exec,uid=1000,gid=100    0 0
The other bad thing is that usb stick couln't be formated as well on windows (yep, I have windows on my bro's gaming pc). Errors about Write Protection; files could be just visually removed (in some ceses), after replugging, files are back; explorer.exe crashes (usual staff).

Just to mention, my USB stick doesn't have anything on it to turn write protection on (unlike floppy disks). It worked fine a few days ago; problems started when I was using it to copy some files to my PC (from laptop - gentoo as well - same fstab entry about /dev/sda1, but no udev, it's devfs) during stage1/3 instalation. USB stick worked great on laptop before (wasn't plugged for the first time in gentoo laptop, on the time of installing gentoo on PC).

some useful information here:
Code:
lsusb -v

Bus 002 Device 001: ID 0000:0000  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x0000 
  idProduct          0x0000 
  bcdDevice            2.06
  iManufacturer           3 Linux 2.6.14-gentoo-r5 uhci_hcd
  iProduct                2 UHCI Host Controller
  iSerial                 1 0000:00:07.3
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               none
        wMaxPacketSize          2
        bInterval             255
  Language IDs: (length=4)
     0409 English(US)

Bus 001 Device 003: ID 058f:9380 Alcor Micro Corp. USB Flash drive
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x058f Alcor Micro Corp.
  idProduct          0x9380 USB Flash drive
  bcdDevice            1.00
  iManufacturer           1 030708
  iProduct                2 USB DRIVE
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk (Zip)
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               none
        wMaxPacketSize         64
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               none
        wMaxPacketSize         64
        bInterval               0
  Language IDs: (length=4)
     0409 English(US)

Bus 001 Device 001: ID 0000:0000  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x0000 
  idProduct          0x0000 
  bcdDevice            2.06
  iManufacturer           3 Linux 2.6.14-gentoo-r5 uhci_hcd
  iProduct                2 UHCI Host Controller
  iSerial                 1 0000:00:07.2
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               none
        wMaxPacketSize          2
        bInterval             255
  Language IDs: (length=4)
     0409 English(US)
How to remove "Read-Only" from it? Or anything else?
Thanks in advance.

Daniel
 
Old 01-30-2006, 06:50 AM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,665

Rep: Reputation: Disabled
Those flash memory chips cannot be written unlimited times. Perhaps yours just expired?
 
Old 01-30-2006, 07:29 AM   #3
LordSurvivoR
Member
 
Registered: Jul 2005
Location: Serbia
Distribution: Gentoo
Posts: 46

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Emerson
Those flash memory chips cannot be written unlimited times.
Are you sure about this statement?
IMHO, this shouldn't be true... there is nothing that could be scratched or damaged inside.

Regards,
Daniel
 
Old 01-30-2006, 07:56 AM   #4
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,665

Rep: Reputation: Disabled
Yep. I am sure.
 
Old 01-30-2006, 03:53 PM   #5
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
Yep, flash has a limitted number of write/erease cycles unfortunately

I think most has about a 10,000 write/erase limit? Something like that, some might be more
 
Old 01-30-2006, 05:07 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,783

Rep: Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936
I will 3rd the motion. Flash memory does have a limited number of write/erase cycles. I am fuzzy about the logic part. There is some failure logic built in to the drives that even though a single memory cell has 10,000 write/erase cycle the drive life is on the order of a 1M. You can google for more info.

The samething happened to me that one day it worked fine, the next day it was dead. It was never used that much so I doubt I exceeded its write/erase cycles.
 
Old 01-30-2006, 05:37 PM   #7
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
Yep. All the ones I have had die on me were never used that heavily. They just die sometimes...
 
Old 01-30-2006, 08:44 PM   #8
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,665

Rep: Reputation: Disabled
Hm. The TOC (or FAT) area probably fails first. Every time something is written (or erased - this is writing too) TOC has to be updated. And if mounted wihout noatime every access is also a write ... Don't know, maybe 10,000 is not that big number at all?
 
Old 01-31-2006, 02:45 PM   #9
LordSurvivoR
Member
 
Registered: Jul 2005
Location: Serbia
Distribution: Gentoo
Posts: 46

Original Poster
Rep: Reputation: 15
Thank you for your responses.

It's obvious that I must get new USB stick.
Which vendors produce USB flash drives that are known to be reliable on number of write/erase cycles? Corsair, Kingston, maybe?

Best regards,
Daniel

Last edited by LordSurvivoR; 01-31-2006 at 02:56 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
slow writing to flash drive obstinatesod Linux - Newbie 11 01-03-2006 03:14 AM
Problems mounting/unmounting flash USB drive LordSurvivoR Linux - Hardware 1 07-12-2005 11:19 PM
USB flash drive problems in FC3. mr_segfault Fedora 2 11-17-2004 01:51 AM
USB Flash memory writing problem tajuton Linux - Hardware 8 02-18-2004 02:17 AM
usb thumb drive writing chii-chan Linux - General 3 11-09-2003 06:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration