1

There were two attempts of mine to install something on my USB stick, both times this resulted in a, what I call, "complete destruction" of my USB stick.

Why I think that it is not a hardware problem: I tried to install a Nextcloud docker container passing the USB stick as storage location. In both cases the scenario was absolutely identical: The first installation attempt failed I retried after modifying the permissions of a folder on the USB stick with chmod, but it failed again. I retried and it was stuck in the process forever and claimed there was a process writing to the USB stick when I tried to unmount it. After a considerable amount of time I forced a restart after which the sticks were not recognised anymore.

I tried to rescue it with Gparted but unfortunately the stick is not recognised anymore. However, execution of usb-devices once with the USB stick plugged in and once without it being plugged in, reveals that the following entry is associated to one of the broken sticks, herafter referred to as stick 1 (for the other one, stick 2, there is nothing found):

T:  Bus=01 Lev=02 Prnt=02 Port=03 Cnt=03 Dev#= 11 Spd=480 MxCh= 0
D:  Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=058f ProdID=1234 Rev=00.02
S:  Manufacturer=ALCOR          
S:  Product=AU87101A UFDISK     
S:  SerialNumber=123456789ABCDEF     
C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=200mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

For stick 1 execution of sudo lsblk -o model,name,size,fstype,label,mountpoint yields: USB Remove DIS sda 29.8G For stick 2 nothing is returned.

My question: What can I do to repair the sticks (I do not care about any data on them)?

Update: I managed to overwrite stick 1 with zeros now by: sudo dd if=/dev/zero of/dev/sda

After doing so I tried to create a new data partition on it with sudo mkfs.ext4 /dev/sda which gave the following output (UUID replaced by X...X):

mke2fs 1.43.4 (31-Jan-2017)
Discarding device blocks: done                            
Creating filesystem with 467512 1k blocks and 116928 inodes
Filesystem UUID: XXXXXXXXXXXXXXXXXXXXX
Superblock backups stored on blocks: 
    8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409

Allocating group tables: done
Writing inode tables: done
Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information: done

Gparted then shows an entry for /dev/sda with file System unknown and a size of 456.55 MiB (compare the result of the lsblk command above). Still the stick is not recognised as USB stick properly if I plug it into an arbitrary computer (including the one I have gparted on).

  • If you have access to windows you could try bootice. I always managed to repair my broken usb sticks with it – totalynotanoob Aug 30 '20 at 18:09
  • 3
    Check the answers here: https://askubuntu.com/questions/144852/cant-format-my-usb-drive-i-have-already-tried-with-mkdosfs-and-gparted/ – KGIII Aug 30 '20 at 18:12
  • @KGIII Thanks for your answer. I have updated my question according to the instructions given in the article. – DonkeyKong Aug 30 '20 at 18:55
  • Have you tried according to *all* the tips in the answer "Analysis of the problem"? for example rebooted the computer, disconnected other USB devices, tried in another computer? If you still cannot see one of the pendrives with the lsblk command line, there is nothing we can do with the tools available to normal users to recover that drive. But the other pendrive should be possible to use (can be restored according to the tips in the link). – sudodus Aug 30 '20 at 20:01
  • @sudodus: I have checked on Ubuntu, Windows10, and raspian. As I have written in the question above lsblk gave a result. I have then tried to completely delete the stick using sudo dd if=/dev/zero of=/dev/sda, which gave the following output for both of the sticks: ```dd: writing to '/dev/sda': No space left on device 935025+0 records in 935024+0 records out 478732288 bytes (479 MB, 457 MiB) copied, 5.17719 s, 92.5 MB/s
    
    
    – DonkeyKong Aug 30 '20 at 20:19
  • @sudodus I have further updated my question above. I just tried to create a new data partition from command line in ext4 format but the file system is shown as unkown in gparted. If I redo the formatting to ext4 in gparted it says it were successful but the file system remains unkown. I am completely lost now... – DonkeyKong Aug 30 '20 at 21:07
  • 1
    "I have checked on Ubuntu, Windows10, and raspian" - Please tell us the results from these checks. Do they match or not? -- When dd finds the end of the drive at 479 MB, there might be a severe damage in the drive, but the problem might also be a fake drive (pretending to be bigger than it is). Sometimes pendrives and memory cards get 'gridlocked', the hardware gets read-only. It looks like you can write to it, but after unplugging and replugging or rebooting, the content is the same as before you wrote to it. And i mean writing a file as well as writing a partition table and file system. – sudodus Aug 31 '20 at 06:54
  • 1
    @sudodus I think it was a hardware damage. At the end it was not recognised anymore by any of the options described in that article. I will now use a powered USB-Hub instead of the ports of my raspberry pi, hoping that the next USB stick will not be grilled... Thanks for your elucidating article. It helped me a lot in my general understanding of storage hardware! – DonkeyKong Sep 05 '20 at 22:38
  • 1
    You are welcome and good luck with the powered USB-Hub, @DonkeyKong :-) – sudodus Sep 06 '20 at 07:35

2 Answers2

1

Creating filesystems on raw disks is comprised of two steps: creating partition(s) and then creating the filesystem. I think what's happening is that you created a partition without a filesystem with gparted and then tried creating a filesystem without partitions using mkfs.ext4. Try the following:

  1. Zero out the drive again using dd just so we know we're starting from scratch
  2. Create one giant partition using gparted that takes up the entire drive
  3. Format the new partition as ext4 using the command sudo mkfs.ext4 /dev/sda1 (note the use of sda1 and not sda, this indicates the first partition vs the entire disk).

You might be already aware but Windows has no support for reading data on ext4 partitions (there are third party utilities but they're underdeveloped). If you're wanting to read this thumbdrive from Windows and are running 20.04, I would recommend formatting as exFAT. The downside to that is that exFAT doesn't support any permissions on the files/directories.

Brian Turek
  • 1,826
1

It was a hardware problem, presumably caused by too high voltage on my RaspberryPi's USB slots. I now put a powered USB-Hub in between and the next stick did not break anymore.