LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Problems with reading & writing to USB Flash Drive (https://www.linuxquestions.org/questions/linux-hardware-18/problems-with-reading-and-writing-to-usb-flash-drive-409566/)

LordSurvivoR 01-30-2006 07:26 AM

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 :cry:

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

Emerson 01-30-2006 07:50 AM

Those flash memory chips cannot be written unlimited times. Perhaps yours just expired?

LordSurvivoR 01-30-2006 08:29 AM

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

Emerson 01-30-2006 08:56 AM

Yep. I am sure. :(

amosf 01-30-2006 04:53 PM

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 :(

michaelk 01-30-2006 06:07 PM

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.

amosf 01-30-2006 06:37 PM

Yep. All the ones I have had die on me were never used that heavily. They just die sometimes...

Emerson 01-30-2006 09:44 PM

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?

LordSurvivoR 01-31-2006 03:45 PM

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


All times are GMT -5. The time now is 05:23 PM.