“I have a hard drive and I’m trying to format it and use it as an external drive for transferring data between two PCs. When I plugged it into a USB drive case, the computer recognized it, but it was not accessible. I went to Disk Management and tried to format it, I got "incorrect function". Then I tried to go to admin CMD. Everything went well at first, but when I ran clean or clean all command, the error occurred: DiskPart has encountered an error: incorrect function. See the System Event Log for more information. I don’t know where the problem is, can someone help me with this? Thank you!”
Actually, you may come across this error not only when you try to format the drive, but also when you initialize the disk. Many reasons cause this error. For instance, the drive is write-protected, the drive is damaged, etc.
How to fix DiskPart has encountered an error incorrect function?
To fix this error, you can try the methods below.
Rescan the disk
When you encounter this issue, it may have something to do with Virtio SCSI driver that require a rescan to show the changes. According to the feedback of some users, you can get it fixed by doing a disk rescan from command prompt. To run the disk rescan, follow the steps below.
1. Open Command Prompt under administrator.
2. Type diskpart and press Enter.
3. At the Diskpart command prompt, type: rescan and press Enter.
The damaged driver may cause this issue too. You can uninstall the drivers for the drive and then reinstall the drivers again after restarting your computer.
1. Click Start button, type device manager in the Search Box and hit Enter.
2. Select Device Manager, expand categories to find the name of your hard drive. Right-click the device and select Uninstall, then restart PC. Windows will automatically reinstall the drivers on the hard drive for you.
Remove write protection
There is some possibility to meet this issue when your disk is write-protected, you can remove the write protection and try to format the drive again.
Step 1. Open the command prompt. Type "diskpart" to start the utility.
Step 2. Type "list disk" to show the list of available disks in the system.
Step 3. Type “select disk n”, “n” stands for the disk number of your drive.
Step 4. Type attribute disk clear readonly. This step will change the properties of your SD card so that it is no longer read-only.
Fix Diskpart incorrect function error in another way
If after trying all the methods mentioned above, the error “DiskPart has encountered an error incorrect function” still exists, you may consider using an alternative to DiskPart to manage your disk. AOMEI Partition Assistant is a good alternative tool that provides all features that DiskPart contains.
It is a free partition manager that can help you format all types of disk including SSD, external hard drive, USB drive, SD card, etc. And you can format write protection disk easily. This software is designed for all versions of Windows 11/10/8/7. Let’s see how to solve Diskpart has encountered an error incorrect function with AOMEI Partition Assistant.
Step 1. Download AOMEI Partition Assistant and launch this software.
Step 2. Right-click the disk that you want to format and choose Format Partition.
Step 3. You can format the disk to NTFS, FAT32, Ext4/3/2, exFAT, FAT32. Choose one among listed File Systems. Then, click on OK.
Step 4. Review the pending operation and click Apply and Proceed to perform it.
Actually, besides the error “DiskPart has encounter an error incorrect function”, you may also meet other errors when using DiskPart like “DiskPart has encountered an error, the media is write protected”, “DiskPart has encountered an error, access is denied”, etc, you can solve all these errors with the help of AOMEI Partition Assistant. Finally, if you want to try more useful features of AOMEI Partition Assistant including partition recovery and partition split, you should upgrade the Standard edition to the Professional edition.