macosformattingpartitionusb-flash-drive

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

  • 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