How to restore Usb Drive to full capacity?

Hello. I have 64 GB USB drive. It shows that it has 3 sectors
sdb 64kb
sdb1 2 GB
sdb2 100 MB

Gparted shows only sdb 64kb
I want to make it just one sdb 64 GB, and delete sdb1 and sdb2, how to do it?

In Gparted, in the menubar, go to Devices and choose Create Partition Table.

:warning: Make sure to choose the right device. This action will wipe the data on the chosen device. :warning:

Apply the operation in the toolbar :white_check_mark:

Now you could create a new partition on the drive and format it.

Hope this helps!

1 Like

Making new Partition Table does not help, because it shows that only 64kb available for partition.

Before making a new partition, did you try making a new Partition Table as described above?

Yes maked msdos partition table.

If I use
dd if=/dev/zero of=/dev/sdb bs=1024
Will dd stop when it reaches end of drive capacity or I need to restrict it somehow?

Yes, I guess so.

Ok so if I clear sdb with dd, what to do with sdb1 and sdb2? Clear them too? or I can delete merge them with sdb somehow?

If I am not mistaken, using dd in this way should clear the partition table and partitions as well.

You should end up with a device showing unallocated space.

So what bs= should I set so it won’t take forever to do for 64GB drive?

I would try something like

dd if=/dev/zero of=/dev/sdX bs=512 count=1
(replace X with the correct letter for your USB drive)

to just clear the partition table. This should be instantaneous.

I use fdisk to fix this kind of issue.

From pendrivelinux:

It is often necessary to restore USB drives after working with tools such as Etcher or Win32 Disk Imager to write an image to a removable device. Depending on the raw image file used, these tools can make your removable device appear to be corrupted or unreadable.
In some cases, the flash drive might not even be assigned a drive letter and can not be detected by your Computer. This is because these tools use raw-write style dd tasks to put an .img or .iso file on the drive. As a result, the boot record, partition table data, and filesystem becomes overwritten with that of the raw image file.

How to restore usb drives

Use fdisk and delete the partitions that is seen. Then create a new partition from first to last sector. Follow the howto on pendrivelinux. Fdisk Arch wiki

The problem is if I set bs=512 count=1 then gparted shows that whole sdb size is 512, and making system table does not help.

Ok fixed it at last. Thank you for the answers.

Could you share the steps here in case other users have the same issue?

Tbh it was really strange I used

dd if=/dev/zero of=/dev/sdb bs=1M status=progress

Waited till it showed that 6GB copied and then canceled it.
After that lsblk -l shows only /dev/sdb 60GB size.
After that made in gparted msdos table and ext4 partition.

1 Like