'How to retrieve/get back unallocated space on a flash drive in MacOS

So, sometimes, when you format a flash drive, some of the available space disappears. In my case, I have a 128GB flash driver, I used it to make a bootable USB for installing windows 10. And the drive became only 32GB. No matter how many times or different format I tried to format the flash drive, I was not able to get the remaining space back. How should this be resolved in MacOS?



Solution 1:[1]

The reason is that those spaces became unallocated. You need to re-partition the flash drive. In MacOS terminal, first execute.

diskutil list

This will show all the disks attached to the system, you need to identify the name of your flash drive, likely to be "disk1" or "disk2". Because we do not want to repartition system disk. Next, you execute.

diskutil partitionDisk disk2 1 MBR MS-DOS MyFlashDrive R

Here is what each parameter in this command means

  • partition disk2
  • create 1 partition, partition type is MBR
  • The partition is MS-DOS format, named MyFlashDrive, and uses Remaining space

Solution 2:[2]

For Windows

  • In the Start Menu, search for and launch diskpart.

    • Type list disk to see all current disk volumes on your system.
    • Plug in your USB drive and type list disk again. Note the newly listed volume.
    • Type select disk # where # corresponds to your USB drive's volume number.
    • Type clean to wipe the volume of all partitions.
    • Type create partition primary to make a new partition with all unallocated space.
    • Type exit to finish.

ref: https://www.makeuseof.com/tag/recover-lost-space-usb-drive/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jack Feng
Solution 2 Pasha M.