Format Flash Drive Mac Command Line



Summary :

Note: If you run into issues later while setting up Windows 10 on a drive with a GPT (GUID Partition Table) partition scheme, use the following command instead to format the USB stick and go through the rest of the steps again. Diskutil eraseDisk MS-DOS “WINDOWS10” GPT /dev/disk2. Mount the ISO from the Downloads folder of your Mac. Make sure to substitute the file name of the ISO image.

If a USB drive is corrupted/damaged, or needs to be formatted, you can easily format USB by using CMD on Windows 10/8/7. This tutorial includes a detailed guide. However, any disk formatting will erase all data on the disk, so you should back up all needed data beforehand. To recover data from formatted USB, you can try MiniTool Power Data Recovery.

Quick Navigation :

USB flash drive is widely used for storing and transferring files. But sometimes you may need to format the USB drive because of corrupted file system, data corruption issues, bad sectors, virus infection, etc. This post gives a step-by-step guide for how to format USB using CMD, namely the Windows built-in free DiskPart command tool, on Windows 10/8/7.

Note: Disk formatting will wipe all data on the disk. If the USB flash drive can still be recognized by computer, you can connect it to computer and copy needed files to another device. If the USB can’t be recognized by computer, you may try some tips to see if you can make it visible on PC before you use Command Prompt to format it.

How to Format USB Flash Drive/Pen Drive Using CMD on Win 10

Step 1. Open Command Prompt on Windows 10

You have several ways to open Command Prompt on Windows 10. One easy way is: press Windows + R, type cmd in Run dialog, press Ctrl + Shift + Enter and click Yes to run Command Prompt as administrator.

Step 2. Open DiskPart command tool

Next you can type the command diskpart in Command Prompt window. Press Enter to launch DiskPart utility.

Step 3. List all disks on PC

  1. Right-click or Control-click the drive’s icon in the Finder’s sidebar (or on your desktop) and select “Get Info.” You’ll see the drive’s file system displayed to the right of “Format” under the General heading. In the screenshot below, the drive is formatted with the exFAT file system. How to Format a Drive on a Mac.
  2. Enter the following command syntax at the command line, replacing “UNTITLED” with your USB drive name if necessary: sudo /Applications/Install macOS High Sierra.app/Contents/Resources/createinstallmedia -volume /Volumes/UNTITLED && say Boot Installer Complete.

Then you can type the command list disk, press Enter and all detected disks will be displayed with detailed information. Check carefully which disk is your USB drive. You may identify the USB by checking the size. Here, my USB is Disk 3.

Step 4. Select and clean the target USB drive

Type the command select disk 3 and press Enter to select the target USB flash drive. Then type clean command and press Enter. DiskPart will wipe disk data.

Step 5. Format USB flash drive/pen drive with CMD (Command Prompt)

Tip: Before you format USB using CMD, you can confirm again that you’ve selected the right disk, to avoid formatting the wrong disk. You can type list disk command again, press Enter, and the selected disk should have a “*” mark before the disk number.

After that, you can type the command create partition primary, and press Enter.

Then type the command format fs=ntfs or format fs=fat32, and press Enter to format the USB flash drive to NTFS or FAT32 format. Optionally you can add a “quick” flag after the command for a faster format.

Step 6. Assign a drive letter for the USB

Continue to type the command assign letter=h, replace “h” with the preferred drive letter you want to assign to the USB drive. Press Enter to assign a letter for the USB drive and make it visible in Windows File Explorer.

Type exit to close DiskPart and type exit to close Command Prompt window.

After formatting the USB flash drive in CMD (Command Prompt), the USB drive should be shown in Windows File Explorer and is available for storing files.

Format USB Flash Drive for Free with Software

Actually, you can easily format a USB flash drive on Windows 10 by using File Explorer. You can connect your USB to your Windows computer, open File Explorer, and right-click the USB drive to select Format and select a file system to format the USB flash drive.

However, you might get an error message “Windows was unable to complete the format” when using this way to format USB. If you meet this error, you can use the Command Prompt to format the USB drive or use other USB formatter software to do this task for free.

MiniTool Partition Wizard is the best free disk partition manager for Windows 10. You can use this program to easily format USB to NTFS or FAT32 for free. The process is much simpler than formatting USB with CMD.

MiniTool Partition Wizard allows you to easily create/resize/format/delete/wipe partitions, convert FAT to NTFS or vice versa, check and fix disk errors, migrate OS, clone disk, benchmark disk, etc.

Download and install MiniTool Partition Wizard on your Windows 10 computer. Check how to use this tool to format USB in a few clicks below.

Step 1. Connect you USB to PC. Launch the USB format tool.

Step 2. Right-click the partition on the USB drive, and choose Format.

Step 3. In the pop-up Format Partition window, choose a file system like FAT32, NTFS. Type a preferred partition label if you like. Click OK.

Step 4. Click Apply button at the bottom-left to start the USB formatting process.

How to Recover Data from a Mistakenly/Intentionally Formatted USB

Formatting USB with CMD or other USB format tools will erase all data on it. No matter you mistakenly or intentionally formatted the USB flash drive/pen drive, you can recover data from USB drive if you want.

MiniTool Power Data Recovery is a professional data recovery program for Windows. This free data recovery software lets you recover any deleted/lost files from USB flash drive/pen drive, SD card, HDD, SSD, and Windows local hard drive. You can use it to recover data from various data loss situations.

Download and install MiniTool Power Data Recovery on your Windows 10 computer, and check how to use it to recover data from formatted USB below.

Step 1. Plug in the USB to your Windows 10 computer. Launch MiniTool Power Data Recovery.

Step 2. Next you can click Removable Disk Drive in the left column, and find the USB in the right window. Select the USB flash drive, and click Scan button.

Step 3. After the software finishes the scanning, you can see it displays all files incl. deleted and lost files on the USB. It recovers all data on the formatted USB drive. You can check the folders to find needed files and click Save button to select a new destination to store the recovered files.

Conclusion

In this guide, you have learned how to format corrupt USB with CMD (Command Prompt) on Windows 10. An alternative free USB formatter software is also attached with an easy guide if Command Prompt is not working on your Windows 10 computer. To recover data from a formatted USB, this post also covers a free and easy guide.

If you have any problems when using software from MiniTool, you can contact [email protected].

Format USB CMD FAQ

You can press Windows + R, type cmd, and press Ctrl + Shift + Enter to run Command Prompt as administrator. Then type the following commands and press Enter after each command.

  • diskpart
  • list disk
  • select disk * (replace * with the exact disk number of USB)
  • clean
  • format fs=fat32 quick (replace fat32 with ntfs if you want to format USB to ntfs format)
  • assign letter=* (replace * with preferred drive letter)
  • exit
Linux
You can either use CMD or MiniTool Partition Wizard to completely format USB flash drive or pen drive for free.

Click Start menu, type cmd, right-click Command Prompt to run it as administrator. Then type the following commands to format write-protected USB using CMD. Press Enter after each command.

  • diskpart
  • list disk
  • select disk <disk number>
  • attributes disk clear readonly
  • select disk <disk number>
  • clean
  • format fs=fat32 quick (replace fat32 with ntfs if you want to format USB to ntfs format)
  • assign letter=<preferred drive letter>
  • exit
You can use Command Prompt or MiniTool Partition Wizard to easily format your USB to FAT32. The detailed guide is included in this post.

How can I format USB drive in CMD? How to format USB using CMD to NTFS? Can I format a USB using CMD in Windows 10? Don't worry if you have the same questions in your mind.

On this page, you'll learn how to format USB using CMD or CMD alternative tool in Windows 10/8/7 successfully. Pick up the suitable USB format tool for help now:

USB Format ToolPros
1. Format USB Using CMD
  • Format to NTFS/FAT32
  • For professional users
2. Format USB Via CMD Alternative
  • Format to NTFS/FAT32/exFAT/EXT4/3/2
  • Convert FAT32 to NTFS without formatting
  • For all levels of users, beginners' best choice
Notice:
As formatting will remove all saved data on the USB drive, if your USB is accessible, make sure to back up valuable USB data to another secure location in advance.

If you prefer an easy and quick way to format USB or you need to format to Ext 4/3/2, pick up CMD alternative format tool for help.

Let's start to format your USB using CMD or its alternative tool and make the RAW, inaccessible, unreadable, and even corrupted USB flash drive, pen drive, memory stick work normally again.

Part 1. How to Format USB Flash Drive Using CMD (Command Prompt)

Applies to: Format USB to FAT32/NTFS, format RAW USB, repair corrupted USB, etc.

USB flash drive is worldwide used for storing data and transferring files. However, sometimes, USB may corrupt or become inaccessible due to RAW or invalid file system, bad sector, or other errors. Formatting USB using CMD is a quick way to resolve these problems.

The following are two detailed guides, illustrating how to format a USB flash drive using Windows Command Prompt that you should strictly follow.

Steps to Format USB (to NTFS or FAT32) Using CMD

#1. Format USB using CMD in Windows 10:

Step 1. Connect USB to your PC and press Windows + R keys.

Step 2. Type cmd in the Search box and hit Enter to bring up Command Prompt.

Step 3. Type the following command lines one by one and hit Enter each time:

  • diskpart
  • list disk
  • select disk + number (Replace 2 with the number of your USB drive.)
  • list volume
  • select volume + number (Replace 10 with the volume number of your USB flash drive.)
  • format fs=ntfs quick (You can also replace NTFS with FAT32 or exFAT.)
  • exit

CMD also works to fix Windows was unable to complete the format error in your computer hard drive, USB, or other storage devices.

#2. Format USB Flash Drive using Command Prompt in Windows 8/7:

Step 1. Plug USB in your computer and click the Windows icon and select 'Search'.

Step 2. Type command prompt in the Search box.

Right-click on Command Prompt and choose 'Run as administrator'.

Step 3. On the Command Prompt window, type diskpart and press 'Enter'.

Step 4 Type list disk and press 'Enter'. Check the disk number of your USB flash drive. For example, disk 2.

Step 5. Now type select disk 2 and press 'Enter'. (If the USB number is not 2, replace it with the right one.)

Step 6. Type format fs=ntfs and press 'Enter'.

If you prefer other file system formats, change the command NTFS to the desired one, such as format fs=fat32.

Step 7. Type exit and hit Enter to close the window.

Mac

After this, exit DiskPart and you save data to your USB flash drive again. However, as Linux file system Ext2/3 is not compatible with Windows OS, you can refer to a UBS format tool in Part 2 for help.

Part 2. Format USB Using CMD Alternative in Windows 10/8/7

Applies to: Format corrupted USB, format USB to Ext2, Ext3, format FAT32 USB to NTFS, format USB to FAT32, etc. on all Windows OS.

Although CMD is capable of formatting USB flash drive, it's not user-friendly for most Windows beginners. Also, it requires users to remember all command lines while executing operations in Command Prompt.

Also, any importer operation may cause data loss on other storage devices. Here, we would like to recommend you try third-party CMD alternative software - EaseUS free partition manager.

EaseUS Partition Master Free Edition is a perfect CMD alternative tool for USB formatting. With an easy-to-use interface and precise operation, you can use it to format USB easily in only a few clicks.

Tutorial - 4 Steps to Format USB via CMD Alternative in Windows 10/8/7

All levels of users can apply this tool and format USB to usable again in Windows 10/8/7:

Step 1. Launch EaseUS Partition Master, right-click the partition on your external hard drive/USB/SD card which you want to format and choose the 'Format' option.

Step 2. Assign a new partition label, file system (NTFS/FAT32/EXT2/EXT3), and cluster size to the selected partition, then click 'OK'.

Step 3. In the Warning window, click 'OK' to continue.

Step 4. Click the 'Execute Operation' button in the top-left corner to review the changes, then click 'Apply' to start formatting your external hard drive/USB/SD card.

Part 3. Bonus Tips to Fix Errors While Formatting USB Using CMD

According to some USB users, they reported that they encountered some errors while formatting USB in CMD.

Here, we've collected two common errors in formatting USB using CMD, if you get the same errors, don't worry. You can follow the provided solutions to resolve them:

Error 1: Diskpart format fs=ntfs stuck at 0, 10, 11, 12...

If the formatting process gets stuck in DiskPart, as the shown message, don't worry. You have two ways to go:

  1. #1. Just wait for the formatting process to complete.
  2. #2. Close CMD, turn to EaseUS Partition Master in Part 2 to format your drive.

Error 2: Diskpart has encountered an error: Access is denied. See the System Event Log for more information.

If you come across this issue, click the link below to get rid of the problem:

Format Flash Drive Mac Command Line Download

Data Recovery is not a challenge anymore. EaseUS serves as a dependable data recovery application to retrieve lost data within simple clicks.

The End Line

Due to its portability, flexibility, large storage size, and reasonable price, USB flash drive is still the No.1 external storage device around the world.

While using USB for data transferring or storage, problems with USB flash drives also increase. Formatting USB flash drive is one of the top issues.

On this page, we included two USB formatting tools to help you format USB using CMD or CMD alternative - EaseUS Partition Master. You may pick up a suitable tool and follow the respective tutorial guide to make your USB flash drive work normally.

For an easy and free formatting resolution, take EaseUS Partition Master as your first choice. It's a perfect CMD alternative tool that can help you anytime.

People Also Ask About Format USB Using CMD

Mac Command Line Open File

Some of you may have more questions about formatting USB. Here we collected some top concerned questions and listed answers below. If you have the same doubts, check out the answers now.

1. Why do you need to format USB flash drive?

Usually, HDDs and SSDs are widely used for OS installation and data storage and removable storage devices like USB flash drives are more used for data transferring and storage. But the USB flash drive may become inaccessible, and you'll need to format it so as to make it work again.

Here is a list of reasons why do you and other USB users need to format the flash drive:

  1. 1. RAW, invalid, or unrecognized USB file system
  2. 2. USB flash drive corruption
  3. 3. Virus infection
  4. 3. USB is write-protected
  5. 3. Change USB file system to NTFS, FAT32, or Ext 2/3/4 by formatting

2. How to format bootable USB using cmd?

The process of formatting a bootable USB flash drive is almost the same as the process shown on this page. You can apply CMD to format it with the listed steps here:

  1. Step 1. Connect the bootable USB drive to your PC.
  2. Step 2. Open Command Prompt.
  3. Step 3. Type diskpart and hit Enter.
  4. Step 4. Type list disk and hit Enter.
  5. Step 5.Type select disk + number and hit Enter. (Replace 2 with the number of your USB drive.)
  6. Step 6. Type list volume and hit Enter.
  7. Step 7. select volume + number and hit Enter. (Replace 10 with the volume number of your USB flash drive.)
  8. Step 8. Type format fs=ntfs quick and hit Enter. (You can also replace NTFS with FAT32 or exFAT.)
  9. Step 9. Type exit and hit Enter.

3. How to format write-protected USB using cmd?

Here are the steps that you can follow to format a write-protected (read-only) USB using the command lines below:

  1. Step 1. Press 'Win + R', type cmd to open 'Command Prompt'.
  2. Step 2. Type diskpart and hit Enter.
  3. Step 3. Type list disk and hit Enter.
  4. Step 4. Type select disk 2 and hit Enter. (Replace 2 with the write-protected device number) and hit Enter.
  5. Step 5. Type attributes disk clear readonly and hit Enter.
  6. Step 6. Type exit to close the diskpart window.

Once the write protection removing process completes, you can format the USB drive again. You can either apply EaseUS Partition Master, Windows File Explorer, or even the CMD command as shown in Part 2 to format the USB drive.

4. Windows was unable to complete the format, how to fix it?

When you use File Explorer to format the USB flash drive, it warns you that 'Windows was unable to complete the format', don't worry. Here are 7 ways that you can try to fix this error:

  1. #1. Use EaseUS Partition Master
  2. #2. Use Diskpart Command
  3. #3. Use Disk Management
  4. #4. Clear Virus and Complete the Format
  5. #5. Remove Write Protection and Complete the Format
  6. #6. Fix Disk Errors and Complete the Format
  7. #7. Repair Bad Sectors and Complete the Format

Mac Flash Drive Format

Note that you can try the above two tutorials to format your USB flash drive and resolve this issue. You can also follow this link to get rid of the Windows Was Unable to Complete the Format error immediately.