thumb

Today I bought a brand new external hard drive WD Elements Portable 1Tb. A Western Digital company says that it can be used on both Windows and macOS. But most WD drives come formatted in the NTFS file system format for OS Windows, while for macOS we needed the HFS+ format or the Apple’s brand new APFS (Apple File System) format.

macOS can read but not write to NTFS formatted drives. So the only workaround is to format the drive to HFS+ or APFS. The easiest way to format the drive is by using macOS built-in Disk Utility app. I started up the Disk Utility and tried to Erase it and make it APFS, but every time I try, I get the following error:

MediaKit reports not enough space on device for requested operation.

After several attempts, I tried formatting to HFS+, and get the same error.

What causes this error

As I understood, the problem was that I started to reformat my new hard drive from NTFS to APFS format instead of the usual HFS+ format. I used the old method to prepare the WD hard drive for use with macOS. But then I found this instruction. New instruction says that we first need to reformat NTFS into Mac OS Extended (Journaled), and then convert it to APFS format.

What I have:

WD Community Knowledge Base:

How to solve it

To solve this problem, we will use the Terminal app and the two tools diskutil and dd. Both tools are built-in in macOS, so we do not need to download or install anything.

Open Terminal app.

Firstly we need to find the proper system name of our disk (hard drive):

diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *121.3 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk1         121.1 GB   disk0s2

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +121.1 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            105.9 GB   disk1s1
   2:                APFS Volume Preboot                 20.3 MB    disk1s2
   3:                APFS Volume Recovery                519.9 MB   disk1s3
   4:                APFS Volume VM                      3.2 GB     disk1s4

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1000.2 GB  disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:                  Apple_HFS Elements                999.8 GB   disk2s2

There are two types of devices:

  • raw devices /dev/rdisk*, communication is direct with the disk.
  • buffered devices /dev/disk*, data transit via buffer.

When using dd or other duplication programs, always use raw device.

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

Before any operations on the disk we must unmount it:

diskutil unmountDisk force disk2
Forced unmount of all volumes on disk2 was successful

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

Now we will write zeros to the disk:

sudo dd if=/dev/zero of=/dev/rdisk2 bs=1024 count=1024

Note! Do not forget to replace the rdisk2 before pressing the Enter.

Enter your password after prompted and then watch the magic happen…

Password:
1024+0 records in
1024+0 records out
1048576 bytes transferred in 0.890086 secs (1178062 bytes/sec)

Let’s now try to partition the disk. This will be the HFS+ format:

diskutil partitionDisk disk2 GPT JHFS+ "Elements" 0g
Password:
1024+0 records in
1024+0 records out
1048576 bytes transferred in 0.890086 secs (1178062 bytes/sec)
MacBook-Arthur:~ berserkr$ diskutil partitionDisk disk2 GPT JHFS+ "Elements" 0g
Started partitioning on disk2
Unmounting disk
Creating the partition map
Waiting for partitions to activate
Formatting disk2s2 as Mac OS Extended (Journaled) with name Elements
Initialized /dev/rdisk2s2 as a 998 GB case-insensitive HFS Plus volume with a 57344k journal
Mounting disk
Could not mount disk2s2 after erase
Finished partitioning on disk2
/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1000.2 GB  disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:                  Apple_HFS Elements                999.8 GB   disk2s2

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

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

Looks good. Our WD hard drive work again.

Finally, we can use the Disk Utility app to convert our hard drive from HFS+ format to APFS format. Done!


If this article helped you solve the problem then please leave a comment. :smiley:

Thanks for reading!



Arthur Gareginyan

Arthur Gareginyan

Arthur is a designer and full stack software engineer. He is the founder of the studio SpaceX-Chimp and the blog MyCyberUniverse.com. His personal website can be found at arthurgareginyan.com.

Follow Arthur: