Announcement

Collapse
No announcement yet.

flaky usb behavior

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    flaky usb behavior

    I'm trying to salvage a usb thumbdrive (16 gib) which will not allow me to erase it and reformat it. The problem is that awhile ago I was fooling around with the mount point for some reason and set it to mount automatically to /media/steve and then tried to copy an appimage to it, which crashed my system completely--at least that seems to have been the problem. At the moment I have neon user 18.04 latest build on it, which I copied using Startup Disk Creator, hoping that the process would erase any problem area. It did not. While Neon opens correctly (at least in Dolphin), I cannot get rid of it when I use KDE partition manager. Here's what happens:
    --I open the usb in part man and see an unallocated file over 14 gib long (there used to be a fat16 partition, but I successfully deleted that.
    --I right-click on the unallocated partition, and the only options I get are New and Restore. I click New.
    --I set it to ext4, close the dialogue box, and that option appears at the bottom. I click Apply changes.
    --It does not work, says it cannot access my usb. When I check /media/steve, the Neon iso is mounted there.
    --When I close the application and unmount the USB, the Neon also unmounts from /media/steve.
    How can I keep my thumbdrive from mounting Neon to /media/steve so that I can do a clean format and use my drive again? I'm in no mood to crash my system with any more experiments, so I'm asking the experts.

    #2
    One thing I do when I have a messed up/loaded/crapped-out flash drive, is to "zero it out" -- write zeros to every byte on that flash drive. Of course, that will totally and permanently destroy all data you have on that flash drive.

    If you do this ...

    Identify the flash drive when it is plugged in. Let's say it is sdx.
    Then you open Konsole and issue the following command:

    sudo dd if=/dev/zero of=/dev/sdx

    It may take awhile, like 10-45 minutes, depending, and it won't tell you what it is doing. But just leave Konsole open, let it do its thing, and when it is finished it will give you a report of bytes in, bytes out, time in seconds, whatever ... IOW, it will be clear that it is done and stopped.

    It is now like it was from the factory, re-set to nothing (actually reset to zeroes).
    You can format it using gparted or KDE partition editor.


    This is Example 1 from Part 2 of my 3-part how-to on dd:
    Example 1 Zero-out the hard drive or flash drive
    https://www.kubuntuforums.net/showth...l=1#post110611
    -> Clears it to like-new state
    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

    Comment


      #3
      Thanks. I will try that out soon.

      Comment


        #4
        It didn't work--said it couldn't write to the thumbdrive because it was full. It seems to me that the drive automatically mounts to /media/steve as soon as I try to delete the partition of the drive (sdb1) using KDE partition manager. Is it possible to erase it from its mount point? I don't want to mess anything up.
        Last edited by oldgeek; Aug 30, 2018, 11:03 AM.

        Comment


          #5
          Is it possible to erase it from its mount point?
          I don't think so.

          It didn't work--said it couldn't write to the thumbdrive because it was full.
          You got me here. Never heard of dd not being able to write to a (thumb)drive. dd works kind of "raw," writing bytes to the hardware, and it doesn't care what is on the thumb drive, and it certainly doesn't care about any filesystem that may have been put there by some operating system.

          I guess you ran something like
          sudo fdisk -lu
          or
          lsblk
          or something to determine how the thumb drive is seen by your system, as some sdx.

          I'm not sure what's going on.
          An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

          Comment


            #6
            IF dd running as root can erase that USB stick

            https://www.addictivetips.com/ubuntu...rive-on-linux/

            then the stick may be defective:

            https://www.zdnet.com/article/how-do...-storage-fail/
            "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
            – John F. Kennedy, February 26, 1962.

            Comment


              #7
              Well, I finally managed to write zeros onto the usb drive. Using kde partition manager, I then tried to format it to exct4, to try it out. Supposedly it was successful, but now the thing won't mount. I erased it and re-formatted it using gparted to a fat32 format, and got the same message. Am I still doing something wrong? The flash drive is fairly new, by the way.

              Comment


                #8
                I had a flash drive that behaved somewhat like the OP's. I turned out that it was not partitioned as either ms-dos or as GPT, it was "mac" - according to fdisk. Eventually, between gparted and various iterations of fdisk and a couple of hours of frustration, I was able to erase everything on the flash drive then partition it GPT and then to format it as fat32. And it works fine!!
                The next brick house on the left
                Intel i7 11th Gen | 16GB | 1TB | KDE Plasma 5.24.7 | Kubuntu 22.04.4 | 6.5.0-28-generic


                Comment


                  #9
                  It shouldn't matter what has been put on a flash drive by any operating system. The dd program should be able to run OK. This error message does not sound like anything dd would return; it sounds like dd was not running, but instead an OS utility was running and returned this high-level message:
                  ...couldn't write to the thumbdrive because it was full.
                  An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                  Comment


                    #10
                    I think that message meant that it was finished writing because there was no more room for zeros. It did the same again, but seemed to finish correctly. The message came near the end of the process--I didn't know that at first because I had left it running while I did something else. The actual message said something like 'unable to write--disk full'. Maybe it meant it couldn't write any more zeros. At least that's what I think now. The problem now is that I've formatted the USB OK, it seems, but it can't mount.

                    Comment


                      #11
                      When you open a Konsole
                      sudo -i
                      mount /dev/sdX1 /mnt (or /media, and assuming you created a partition)
                      what does it say?
                      "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                      – John F. Kennedy, February 26, 1962.

                      Comment


                        #12
                        Do what GG says in Post #11 regarding mounting.

                        Back to this:
                        I think that message meant that it was finished writing because there was no more room for zeros. It did the same again, but seemed to finish correctly. The message came near the end of the process--I didn't know that at first because I had left it running while I did something else. The actual message said something like 'unable to write--disk full'. Maybe it meant it couldn't write any more zeros. At least that's what I think now. The problem now is that I've formatted the USB OK, it seems, but it can't mount.
                        Yes, you are absolutely correct, as you have explained this now. That was a message from dd: it had written all the zeroes it could write on that flash drive because the flash drive was all full-up of zeroes.
                        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                        Comment


                          #13
                          And, just double-checking here ...

                          So, you ran dd, the flash drive is all zero'd out,you remove the flash drive, wait a few seconds, and then you put the flash drive in the computer, opened gparted (or your partitioning program), from a drop-down list (in gparted) you chose the flash drive, and you saw a bunch of unallocated space on the flash drive, you clicked on that unallocated space, you chose Partition - New (or something like that to create a partition), you were then reminded by gparted that you need to select a partition scheme, you then chose MBR (or something like that, I can't recall, but you did NOT choose gpt (although that would also work)), so then that was set up for you, then again you clicked on the unallocated space and selected again Partition-New, and then selected the partition size (maybe the whole flash drive) and the type of partition (probably FAT32, or ext4), and then that was done for you, so then you were done with gparted and you exited from gparted, removed the flash drive from the computer, waited a few seconds, re-inserted the flash drive into the computer, and you then see if it is recognized by your Kubuntu device notifier ... Correct?
                          An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                          Comment


                            #14
                            The flash drive now mounts when I use GreyGeeks instructions (IOW, it says nothing after I type the instructions). I can't find it in Dolphin, however. But the drive opens when I press the device icon... I did follow all the steps Qqmike described. Do I have to mount the drive with sudo every time I want to use it? I thought that was done automatically.

                            Comment


                              #15
                              Do I have to mount the drive with sudo every time I want to use it? I thought that was done automatically.
                              I'll let the RealExpertsTM chime in on that, but I've never had to manually mount a flash drive -- always just click on the device notifier, or maybe it was listed in Dolphin.
                              An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                              Comment

                              Working...
                              X