Format Flash Drive Mac Command Line



Formatting in context of USB or Hard Drives means deleting everything from that drive and rebuilding the file system so that we can use it with an Operating System. And we usually perform formatting in our USB or External Hard Drive when we want to get rid of viruses, or we want to clean the disk as it was when we purchased it. Also when we buy a new USB or Hard Drive, it often comes with windows compatible not the mac so formatting it even needed in this case. So in this post, I will tell you “How to Format USB on Mac?”.

How to Format USB on MAC?

Use Disk Utility to Format USB Flash Drive on Mac. The simplest way to format a disk in Mac OS is to simply use the Disk Utility since it is the Mac’s built in disk maintenance tool. To format USB drive on Mac using this method, all you need to do is plug in the USB device into your Mac and select it from the Disk Utility’s sidebar menu. Plug your flash drive into an empty USB port and back up any data on the drive. Open the main menu, move your cursor over 'Accessories' and then click on 'Terminal.' At the terminal prompt, type sudo apt-get install gparted and press Enter. Enter your Ubuntu administrator password when prompted and press Enter.

If you never formatted a USB drive then don’t worry it is effortless. And here I will tell you two answers to this question that “How to Format USB on Mac?”. First, we will go with the straightforward way of doing it; then we will move to the easy way. 😉

So first, we will use the Disk Utility program, which is a GUI and very straightforward so that any kid can do it. Then in the next method, we will format USB drive from mac terminal. So let’s start.

Format USB on Mac using Disk Utility

  • Connect the USB Drive to your Mac. (This is obvious we need a USB first, then only we can format it 😛 )
  • Now we need to open Disk Utility. (Here I will give you one more tip. To open any program in your Mac just press the command + spacebar. It will start the Spotlight Search, now from here you can search for any program, but now we need Disk Utility, so search it).
Format mac drive on pc

Format Flash Drive Mac Command Line Download

  • Now, on the Disk Utility window you will see External Drives on the left.
  • Here I have my USB Drive connected, and its name is No Name. In the top we have options like First Aid, Partition, Erase, Restore, Unmount. To format the drive we need to click on the Erase Button.

Format USB on Mac

  • Here, we have two options, the first one is the Name that you can set for your USB Drive. The second one is the Format. If you want to make it windows compatible you need to select MS-DOS (FAT) here. And you can also use the Mac OS Format. So its up to you what you want.
  • Now, just click on the Erase Button to complete the format.
  • And thats it. Your drive is formatted.

For formatting any External Hard Drive, we can follow the same steps.

Format USB Drive Mac using Terminal

We also have a Command Line Disk Utility interface in Mac. And we can use it to format the USB on Mac as well. Now lets see how we do this.

  • First open the terminal (Again press command + space, write terminal and hit enter).
  • In terminal now type the following command.
  • The above command will display all the disk connected with your machine.
  • Here the USB Drive that is connected, is disk2 and we will format this disk only. To format the USB drive here we will write the following command.
  • In the above command eraseDisk is the format command. Then comes JHFS+ is the Disk Type which is Mac OS Extended (Journaled). Then Belal is the name of the disk that will be assigned after formatting. Finally we are writing the name of the disk that we need to format, which disk2 is in this case. Now hit enter.
  • And the disk is formatted. 😉 Super Easy, isn’t it?

So that’s it for this tutorial friends if you got some problems then tell me in the comments. And if you think this post was useful for you, or it helped you in any way, then I request you to please SHARE it with your friends. I hope you got the answer very clearly that “How to Format USB on Mac?”. So thank you, guys. Will catch you in the next post.

This article talks about how to fix the corrupted USB flash drives/Pen drives using CMD (command prompt), including CHKDSK and Diskpart. You can also follow the tutorial to recover lost data from corrupted USB drives with iBoysoft Data Recovery.

One of the more common computer-related issues that more and more users appear to be encountering on a regular basis is a corrupted or damaged USB flash drive. USB drives related issues like USB device not recognized may be common, but they're still incredibly annoying and can make life very difficult indeed. That's because, such media store a wide variety of different types of info on them, so keeping them in perfect working order is hugely important. With that said, however, sometimes they do wind up becoming damaged or corrupted for no apparent reasons. Does this mean that you should give up with them? Absolutely not. You can even fix a corrupted SD card or USB drive using Windows built-in tool - Command Prompt (CMD).

Let's go into detail.

What are USB flash drives?

USB flash drives, or Pen drives, thumb drives, are basically small, portable electronic devices used for storage purposes. The devices have a built-in USB type-A plug that slots directly into a USB port. These devices basically serve the same purpose as other storage media, in that they're used to store data and info and transfer it from one device to another. USB flash drives can be used to store files, like audio files, images, videos, written documents, and much more besides. Basically, if you think of them as digital filing cabinets, you're on the right track. As these things are technological, they do sometimes go wrong and damaged or corrupted USB flash drives are unfortunately quite common, such as the USB flash drive not showing up when connected to computers. Luckily, there are things you can do if you do happen to encounter any issues regarding your USB flash drive, and again, it's what we're going to be looking at for today's article.

Common problems on USB flash drives

As you now know, USB flash drives are sometimes prone to damage or corruption. Recently, we received an email from one of our users who was overcome with worry because her USB flash drive appeared to be corrupted. Take a look at what she had to say and see if any of the issues she raised in her email sound familiar to you.

'Hi, Guys, I really hope you can help me. Recently I was clearing my old computer and had stored plenty of photographs and videos to one of my USB flash drive (yes, I have 4 USB-based drives). Everything's right till this morning. I inserted the USB flash drive into my computer, only to be greeted with an error message. The message stated that 'The disk is not formatted. Do you want to format it now'? Many of the files on the drive were very important so I didn't format the USB flash drive. I'm now panicking as I really don't want to lose any of the files stored on the card. Please, guys, is there anything I can do to fix this corrupted USB flash drive, or can I just recover files from the USB drive?'

As you can see, she was quite distressed, and for good reason too. Thankfully, instead of throwing in the towel, she did reach out to us and we were able to help her retrieve all of the important images and videos of her and her family, that clearly meant so much to her.

Besides that, we have also received other USB flash drive related issues include:

  • Damaged USB flash drive;
  • USB flash drive infected with virus;
  • USB flash drive not recognised by computers;
  • USB flash drive incorrect capacity;
  • Cannot format USB flash drive, and so on.

How to fix a corrupted USB flash drive using CMD?

Now it's time for us to look at what you can do to repair a corrupted USB flash drive using CMD. There are actually a number of things you can try here, so the good news is that you do still have plenty of options.

Before we can proceed any further, we need to draw your attention to the fact that using CMD to fix corrupted USB flash drives, SD cards, or any other type of storage devices for that matter, could potentially wipe all files stored on the device in question. To avoid data loss, ensure you have a backup, or alternatively, download iBoysoft Data Recovery to ensure that data loss isn't an issue for you.

Video tutorial: How to fix corrupted USB flash drives using CMD?

Method 1: Fix corrupted/damaged USB flash drives using CHKDSK

The first CMD method we're going to look at today for repairing a USB flash drive, or an SD card, an external hard drive as well, is to utilize CHKDSK command. If you find that your USB flash drive is corrupted or damaged, the first thing you should do is utilize Windows chkdsk /f command prompt to perform a check disk error. This method could help to keep your important files intact and potentially repair a corrupted flash drive and make the files accessible once more.

However, CHKDSK may also delete files, too. So, please make sure you have a backup copy.

Format Flash Drive Mac Command Line Command

  1. Step 1: Begin by plugging your USB flash drive into your computer via a USB flash drive cable.
  2. Step 2: Next, make your way over to the start menu, type 'cmd' in the search bar, right click on 'cmd.exe' and then choose 'Run as Administrator.
  3. Step 3: Now, you will need to type 'chkdsk *: /f /r /x, replace * with the drive letter you wish to repair. As an example, if you wanted to repair the G drive, you would need to type in chkdsk G: /f /r /x.

Hopefully, that should then work. It is also worth noting that if it shows 'Cannot open volume for direct access' when chkdsk running, chkdsk can't continue working. And CHKDSK is not available for RAW drives. If you receive a message stating something to this effect, try method 2 instead.

What is RAW file system?

RAW file system is basically a state of your chosen storage device, or the computer's hard drive, which currently has no known Windows file system such as FAT32 or NTFS. Because the file system is RAW, it basically means that you are unable to access folders or files on the drive, plus you cannot use it to store any data. Thus, to fix a device showing as Raw file system, you may need to convert RAW to NTFS, FAT32 or any other recognizable file systems. We will tablk about it later.

Method 2: Fix corrupted/damaged USB flash drives using Diskpart

Mac Command Line

Now we're going to look at how you can repair a corrupted USB flash drive utilizing Diskpart command. If you're looking to repair a corrupted USB flash without having to reformat, utilizing Diskpart command is very effective in a lot of cases. The thing to remember here is that all data on the corrupted USB flash drive will be wiped. This basically means that if there is anything on the device that you do wish to keep, you should not go with Diskpart command. So we recommend you to use Diskpart only if you have no important files on the device in question.

Step 1: Plug in your USB flash drive to the computer.

Reformat Flash Drive Mac

Step 2: In the search box, type in 'Diskpart' and then right click on it and then select 'Run as Administrator'.

Step 3: Next, type 'List disk' before pressing 'Enter'. According to the list disk information, check which disk is your corrupted USB flash drive. For example, disk 2.

Note: Just remember that Diskpart is basically just like reformatting, so all data, important or otherwise, will be removed if you go with this process. So, select the wrong command can actually cause harm to your data and even your computer. This is why it's vital to ensure that you've selected the right command.

Step 4: Now, you will need to Type 'format fs=ntfs' and press enter. If you would prefer other file system formats, simply change the command ntfs to your desired one, such as FAT32, exFAT, etc.

Method 3: Fix corrupted USB drives by reformatting

Finally, we have what many people consider to be most effective solution of all. This is reformatting the corrupted USB flash drive. However, if you have tons of important files on the device, you need to firstly perform USB drive data recovery.

iBoysoft Data Recovery is a free USB drive data recovery that is able to recover lost data from corrupted/damaged USB drives, and also able to recover lost data from corrupted SD cards, hard drives, USB external hard drives, Pen drives, memory cards. What's more, it can also recover lost data from inaccessible, unrecognized, unreadable, formatted drives and deleted or lost partitions, and plenty more on top of that.

Step 1: Recover lost data from corrupted USB drives/SD cards

1. Download and install iBoysoft Data Recovery on your computer. The software is completely free to install.

2. Launch iBoysoft Data Recovery, choose the corrupted or damaged USB flash drive and click 'Next'. The program will then start to scan for misplaced files on the corrupted drive.

Mac Flash Drive Format

3. During, or indeed, after the scanning process, you will have the ability to preview the scanning results and select the individual files that you want to recover.

4. Click the 'Recover' button to recover lost data from corrupted SD card.

5. Now, check to ensure that all lost data has been recovered.

Step 2: Reformat the corrupted USB drives/SD cards

After the data recovery has been completed, you should then right click the USB flash drive in My Computer/Computer/PC and select 'Format' or click 'Run Disk Management' to format your drive. What's more, you can run Diskpart to format corrupted USB drive as mentioned above.

More about iBoysoft Data Recovery

There are countless examples of free data recovery pieces of software out there for you to choose from, but some are unfortunately not very reliable, nor are they that effective. Finding a reliable and trustworthy piece of free data recovery software is essential, which is why iBoysoft Data Recovery comes so very highly recommended. It is considered by a number of users to be the absolute best free data recovery software option on the market today. This software is ideal, in that it supports the recovery of the following: deleted photos, deleted videos, audio files, images, text files, and more.

How to fix RAW USB drives without formatting?

Format Mac Drive On Pc

The USB flash drive becomes RAW suddenly? Follow the tutorial to fix it without formatting on Windows 10/8/7. Read more >>