Emergency, USB flash drive is read only [SOLVED]

Forum Forums General Software Emergency, USB flash drive is read only [SOLVED]

  • This topic has 11 replies, 3 voices, and was last updated Jun 18-4:48 pm by ModdIt.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #84713
    Member
    kaye

      Hello Friends!

      For some reason my USB flash drive kept on unplugging (unmounting / ejecting) on its own (not physically), which caused it to become read-only.

      The entire flash drive is read only. I cannot edit files and cannot add files.

      What do I do?

      The link below doesn’t seem to help.

      https://www.linuxquestions.org/questions/linux-hardware-18/usb-flash-drive-becomes-read-only-again-4175652822/page2.html

      Thank you for your time

      • This topic was modified 10 months, 3 weeks ago by kaye.
      #84714
      Member
      ModdIt
        Helpful
        Up
        0
        ::

        Hallo kaye, not an emergency if you are following good practices.
        USB sticks going read only is one of many possible failure modes.

        Rescue any important data plus your configuration files to another stick or device.
        Personaly I always keep a complete home backup.

        Restore the drive from your backup ISO image. But do not trust it.

        • This reply was modified 10 months, 3 weeks ago by ModdIt.
        #84716
        Member
        kaye
          Helpful
          Up
          0
          ::

          ok thank you Moddlt

          #84717
          Moderator
          caprea
            Helpful
            Up
            0
            ::

            What does “doesn’t seem to help” mean ?
            Did you run the fsck command from the link, was it fully performed and if not please post the output.

            #84718
            Member
            kaye
              Helpful
              Up
              0
              ::

              it’s the first time i’ve used fsck so i really don’t know what i’m doing. i just read the prompt messages and i choose whatever option i think is good.

              the following is my latest attempt:

              
              $ sudo fsck -V /dev/sdc1
              [sudo] password for homet: 
              fsck from util-linux 2.36.1
              [/usr/sbin/fsck.vfat (1) -- /media/marlon] fsck.vfat /dev/sdc1 
              fsck.fat 4.2 (2021-01-31)
              There are differences between boot sector and its backup.
              This is mostly harmless. Differences: (offset:original/backup)
                65:01/00
              1) Copy original to backup
              2) Copy backup to original
              3) No action
              [123?q]? 3
              Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
              1) Remove dirty bit
              2) No action
              [12?q]? 1
              
              *** Filesystem was changed ***
              The changes have not yet been written, you can still choose to leave the
              filesystem unmodified:
              1) Write changes
              2) Leave filesystem unchanged
              [12?q]? 1
              /dev/sdc1: 31799 files, 1732374/1892800 clusters

              After performing the above, flash drive is still read-only.

              • This reply was modified 10 months, 3 weeks ago by kaye.
              #84721
              Moderator
              caprea
                Helpful
                Up
                0
                ::

                And did you also try to remount as read-write … ?

                #84730
                Member
                kaye
                  Helpful
                  Up
                  0
                  ::

                  When the flash drive kept on unmounting / ejecting, I may have unmounted it using the umount command, then physically pulled it out, and plugging it in again.

                  I don’t know if that counts as “remount as read-write”.

                  #84731
                  Moderator
                  caprea
                    Helpful
                    Up
                    0
                    ::

                    In the link you provided the OP said it was still flagged as only readable and worked after he forced it to be mounted as read-write.
                    sudo mount -o remount,rw /dev/sdc1

                    #84781
                    Member
                    kaye
                      Helpful
                      Up
                      0
                      ::

                      Sorry I missed that. Yes that seems to work

                      sudo mount -o remount,rw /dev/sdc1

                      Thank you very much.

                      I wonder if my flash drive is starting to go…..

                      • This reply was modified 10 months, 3 weeks ago by kaye.
                      #84785
                      Member
                      ModdIt
                        Helpful
                        Up
                        1
                        ::

                        Kaye wrote:
                        I wonder if my flash drive is starting to go…..

                        Which is why I suggested to back up your data immediately.

                        USB drives have a limited lifetime. I have seen enough desperate users whòs data was non recoverable to have become
                        very cautious. Had defective drives myself too..

                        FSCK can often fix filesystem errors it can not tell you why things went wrong or indicate if your usb stick is healthy.

                        You can use following: CAUTION, all are destructive. Back up your data.

                        To test and detect bad sector in USB flash memory or pen drive, run: badblocks -w -s -o error.log /dev/sdX
                        You can check out what the command is doing by tapping man badblocks in the terminal and pressing enter.  
                        To error check USB flash drive, you can use the f3write and f3read commands, which is an alternative to h2testw app from Windows operating systems.

                        Should you happen to be using a Transcend Jet Flash drive please check if the (windoze only) online repair tool can update the controller software for you.
                        The tool has fixed both of my 64GB sticks after failures.

                        Buy good drives, San disk and Transcend are my personal choices, buy devices where the manufacturerer is offering a decent warranty. I look for 5 years minimum.

                        Using an Micro SDx card in an adapter may be a preferrable choice, the cards are designed to survive camera usage over extended periods. They are more robust.

                        #84791
                        Member
                        kaye
                          Helpful
                          Up
                          0
                          ::

                          Currently mine is Kingston. No good?

                          Thanks for recommending San disk and Transcend.

                          I’ll take note of the 3 commands

                          badblocks -w -s -o error.log /dev/sdX
                          f3write
                          f3read

                          Many thanks

                          #84808
                          Member
                          ModdIt
                            Helpful
                            Up
                            0
                            ::

                            Not clear enough, f3 is a tool designed to test flash drives. You have to install it as not standard in the distro.

                            Regarding Kingston USB sticks, I found them very disappointing especialy in regard to write speeds after the cache is full
                            and quality, experienced early failures.

                            In my personal experience san disk seems to be the most reliable and offers good performance. I tend to buy selected ultra
                            and extreme sticks, the long warranty (hopefully) is an expression of manufacturer confidence in the products.
                            San disk is a Western Digital product, for those who do not know.

                            I had to online repair both of my 64GB Transcend sticks. After the controller software was succesfully updated the performance
                            was greatly improved compared to pre failure. The first stick was repaired months ago, working fine since. I do like the fact that
                            Transcend admitted to faulty software and offer customers a fix.

                          Viewing 12 posts - 1 through 12 (of 12 total)
                          • You must be logged in to reply to this topic.