Format Flash Drive Mac Terminal

I needed to perform an offline system update for Xbox One S but I only have Macs. Installed the Paragon NTFS for Mac using 10 day trial. That allowed me to format a USB drive as NTFS with full read-write access and then write the system update files to the USB drive. Offline Xbox update worked like a charm via USB stick. – Brian D Dec 2 '19. For example, if you install macOS or Microsoft Windows on a USB drive, your Mac can recognize that drive as a startup disk. This guide provides 2 ways to boot a Mac from a USB flash drive. Starting up your Mac from an external disk requires the following: Intel-based Mac.

Have you ever met this problem that a flash memory card or USB flash drive is not showing the full capacity but a wrong size in macOS? I got this problem every time when trying to erase an SD memory card after working with Raspberry Pi. In this article I will show you how to format a flash drive to reclaim full capacity and make it available for saving data again now.

What causes this issue

I noticed that no matter the size of my SD memory card, after writing an image with OS for my Raspberry Pi, macOS can only recognize one partition with about 60 MB. If I try to format it using macOS built-in Disk Utility app, it will only free the space in that partition. This is not a my SD memory card issue. And it can happen with a flash drive from any manufacturer. This is not a problem with the flash drive at all.

In my case it’s all about the type of previous formatting. To use a flash drive as a boot disk (for example, with the OS for Raspberry Pi), it creates two partitions: the first one with the bootloader and occupies 60 MB, the second one with the OS files is a hidden partition and occupies the rest of the flash drive space. The Disk Utility app does not see this hidden partition and therefore formats only the first partition instead of the two.

How to solve it

To solve this issue, we will use the Terminal app and the tool diskutil. This tool is built-in in macOS, so we do not need to download or install anything.

Critical! The instructions in the article below are designed to help format a flash drive. This process is data destructive and cannot be undone. Once the process begins, all the data on the flash drive will be lost!

Connect the flash drive which is not showing full capacity to your Mac.

Firstly, in order to avoid data loss, we need to restore and extract data from the flash drive. If we can open the flash drive, we may directly copy and save files from the flash drive to other storage device. If the flash drive is not accessible now, our best choice is to use any professional flash drive recovery software for help.

Launch the Terminal app from the Utilities folder of your Applications folder, or use Spotlight to find it.

Format flash drive windows 10

Execute the following command to identify the mount name of the flash drive following the pattern /dev/diskX, e.g., /dev/disk2.

Note! The below commands assume this is disk2, but replace disk2 with the correct disk if it’s something different.

Say the disk name is /dev/disk2. Now format the flash drive to FAT32 by running the following command (this will erase the entire flash drive):

Warning! Do not forget to replace the disk2 before pressing the key Enter.

Note! Replace “MYSD” with the name that you want to give to your flash drive.

This command will prompt us to enter our computer password. Enter your password and then watch the magic happen…

Note! It’s normal that the password you enter is not displayed. This is how the password is entered on the command line. Just enter your password, and then press the Enter key.

Format Flash Drive Mac Fat32 Terminal

Let’s now re-enter the diskutil list command to verify that the flash drive is showing full capacity (in my case - 4 GB) instead of 58.7MB.

Access Flash Drive On Mac

Conclusion

That’s it, we’re done. We reclaimed full capacity on flash drive, and make it available for saving data again now. We can leave our flash drive in the FAT32 format or convert it to any other format using the Disk Utility app. So simple isn’t it?

If you are having trouble fixing this problem with the instructions above, but are being able to solve this problem with any another method please describe it in the comment section below. Thanks!

If this article has helped you solve the problem then please leave a comment

Using Flash Drive On Mac

Thanks for reading!

Arthur is a designer and full stack software engineer. He is the founder of Space X-Chimp and the blog My Cyber Universe. His personal website can be found at arthurgareginyan.com.

Format Pen Drive Mac Using Terminal

Follow Arthur