0

So I have accidentally corrupted a sandisk usb drive. When I go to Disks & Devices, the usb is not detected there. I can access it only through kde partition manager or the terminal but I am unable to read any data in it. It is supposed to be 64GB but in kde partition manager, the capacity is shown as 64MB. I tried creating a new partition table, it shows success but the partition table doesn't get created. It still prompts me to create a new partition table. How do I make the usb drive usable? I don't care if the data is lost.

I tried the previous answer to a similar question How to format a USB drive?

It didn't work for me. Here is the output when executing those commands.

❯ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0         7:0    0     4K  1 loop /snap/bare/5
loop1         7:1    0  72.9M  1 loop /snap/core22/509
loop2         7:2    0  72.9M  1 loop /snap/core22/522
loop3         7:3    0 452.4M  1 loop /snap/gnome-42-2204/56
loop4         7:4    0 460.3M  1 loop /snap/gnome-42-2204/65
loop5         7:5    0  91.7M  1 loop /snap/gtk-common-themes/1535
loop6         7:6    0  49.8M  1 loop /snap/snapd/17950
loop7         7:7    0  49.8M  1 loop /snap/snapd/18357
sda           8:0    1    64M  0 disk 
nvme0n1     259:0    0 476.9G  0 disk 
├─nvme0n1p1 259:1    0   260M  0 part /boot/efi
├─nvme0n1p2 259:2    0    16M  0 part 
├─nvme0n1p3 259:3    0 200.9G  0 part 
├─nvme0n1p4 259:4    0     1G  0 part 
├─nvme0n1p5 259:5    0   2.2G  0 part 
├─nvme0n1p6 259:6    0   252G  0 part /
└─nvme0n1p7 259:7    0  20.6G  0 part

❯ sudo fdisk /dev/sda

Welcome to fdisk (util-linux 2.37.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command.

Device does not contain a recognized partition table. Created a new DOS disklabel with disk identifier 0xf430b9ec.

Command (m for help): o Created a new DOS disklabel with disk identifier 0xd9afc416.

Command (m for help): n Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): p Partition number (1-4, default 1): 1 First sector (2048-131071, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-131071, default 131071):

Created a new partition 1 of type 'Linux' and of size 63 MiB.

Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks.

❯ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS loop0 7:0 0 4K 1 loop /snap/bare/5 loop1 7:1 0 72.9M 1 loop /snap/core22/509 loop2 7:2 0 72.9M 1 loop /snap/core22/522 loop3 7:3 0 452.4M 1 loop /snap/gnome-42-2204/56 loop4 7:4 0 460.3M 1 loop /snap/gnome-42-2204/65 loop5 7:5 0 91.7M 1 loop /snap/gtk-common-themes/1535 loop6 7:6 0 49.8M 1 loop /snap/snapd/17950 loop7 7:7 0 49.8M 1 loop /snap/snapd/18357 sda 8:0 1 64M 0 disk nvme0n1 259:0 0 476.9G 0 disk ├─nvme0n1p1 259:1 0 260M 0 part /boot/efi ├─nvme0n1p2 259:2 0 16M 0 part ├─nvme0n1p3 259:3 0 200.9G 0 part ├─nvme0n1p4 259:4 0 1G 0 part ├─nvme0n1p5 259:5 0 2.2G 0 part ├─nvme0n1p6 259:6 0 252G 0 part / └─nvme0n1p7 259:7 0 20.6G 0 part

Even though fdisk says a new partition was created, when rechecking afterwards with lsblk it doesn't show any new partition.

  • what is your actual question since you ask two different ones? Is it to format the drive or to recover the data from it? Please [edit] accordingly. – graham Aug 21 '23 at 14:20
  • @graham made the changes – hasan ramp Aug 21 '23 at 14:22
  • does this answer your question? https://askubuntu.com/questions/198065/how-to-format-a-usb-drive – graham Aug 21 '23 at 14:26
  • @graham I used method 2. In the end it shows "Created a new partition 1 of type 'Linux' and of size 63 MiB.". But when I use lsblk again, it doesn't show the new partition. – hasan ramp Aug 21 '23 at 14:31
  • 1
    Be aware that SanDisks have gained a reputation for sudden failures recently and Western Digital was sued for it. I hope this is not the situation for you, and wish you best of luck. – user68186 Aug 21 '23 at 14:38
  • @user68186 That's not the case. The usb was working, but I accidentally started to format it and then I cancelled it midway. Probably that's why it got corrupted somehow. – hasan ramp Aug 21 '23 at 14:46
  • Does this answer your question? How to format a USB drive? – user68186 Aug 21 '23 at 14:49
  • @user68186 read above comments – hasan ramp Aug 21 '23 at 14:52
  • 1
    I am voting to close this question as a duplicate. the method 2 should have worked. Please try it again and copy and paste the commands and corresponding outputs in your question. You may have to unplug and plug the drive again to get it recognized. It is important to edit the question and demonstrate that the answers to the linked question didn't work so that it is not considered a duplicate. – user68186 Aug 21 '23 at 14:53
  • 2
    The hardware of your USB drive might be damaged. Otherwise the methods discussed in the previous comments should work. Anyway, you can analyze the problem according to this link and if you are lucky, find a solution. – sudodus Aug 21 '23 at 15:58
  • 1
    Take a look at the f3 package (fight fake flash) -- the larger flash drives are popular fraud targets. – ubfan1 Aug 21 '23 at 16:00
  • 1
    You've provided no OS/release details; where software stack specifics are helpful and avoid is being limited to generic advice. Your details match dying or a failed flash drive, with the media being cheap and made to cost, without the diagnostics or redundancy found in hard drives or SSDs. As such I see the question currently about hardware problems due to failing/faulty device – guiverc Aug 21 '23 at 22:55

0 Answers0