Computing: Computer Administration

Unable to write data onto my USB flash drive.

I run my macOS 11 as a VMware virtual machine on a PC with Intel x64 processor, the host operating system being Windows 10. It thus arrives that I use one of my USB flash drives to transfer files from my Windows system to the Mac, sometimes also in the other direction. I actually have 2 USB sticks. No problem on either of them to read data on macOS. However, macOS is capable to write to one of them, but not to the other. Do you guess what the reason for this may be?

The drive that macOS can read from and write to is formatted using the extFAT filesystem. This is the filesystem usually used with flash drives and is read-write accessible by so to say all operating systems. If in Finder, you right-click within an extFAT drive, you have the same commands available as you have on your local disks. In particular, you can create a new folder and move a file or folder to the bin (this is a difference with Windows where, on removable media, files are erased and not moved to the recycle bin).

If, on the other side, you open an NTFS formatted drive in Finder, there will be no writing commands available in the context menu, in particular there is no way to create a file or folder, or to move them to the recycle bin. Also, you cannot delete or rename files and folders on an NTFS drive. The screenshot below shows my NTFS formatted USB stick opened in Finder with the context menu displayed. With a file on that drive selected, the "Open" and "Open with" commands are displayed, but the command "Move to bin" is not available.

NTFS drives on macOS: Finder context menu without writing related commands

Does this mean that macOS can read from NTFS drives, but can't write to them? I'm not sure. On some Internet sites they say that macOS can write to NTFS, but that by default this feature is disabled. The reason for this is probably because the NTFS filesystem is property of Microsoft. Anyway, the usual way to access an NTFS flash drive on macOS is to install a third party NTFS driver. Most of these drivers are commercial (e.g. EaseUS NTFS for Mac, or Paragon NTFS for Mac). These drivers are known as being fast and reliable. Also, their installation is easier than setup of the open source solution, consisting of macFUSE and NTFS-3g. It's about the open source solution that this help text is about.

To install macFUSE and NTFS-3g, you need homebrew. If you haven't it yet on your Mac, please install it now. If you need help for this, you might want to have a look at my tutorial Installing the package manager Homebrew on macOS.

Installing macFUSE.

To install macFUSE, open a terminal and run the command
    brew install --cask macfuse

NTFS drives on macOS: Installing macfuse using homebrew

Please, reboot your Mac when done.

Installing NTFS-3g.

To install NTFS-3g, open a terminal and run the commands
    brew tap gromgit/homebrew-fuse
    brew install ntfs-3g-mac

NTFS drives on macOS: Installing ntfs-3g using homebrew

And reboot when installation is finished.

Replacing the NTFS handler.

Normally, all that remains to do would be to replace the original NTFS handler (the one shipped with macOS) with the new one (the one we just have installed). However, on newer releases of macOS this is not possible. In fact, there is a security feature called System Integrity Protection (SIP), that prevents Mac users to make changes to the operating system. The work-around consists of temporarily disabling SIP (starting the Mac in recovery mode), making the changes and enabling SIP again. This procedure is described in the article Enabling NTFS write in macOS the Open source way at the Medium website.

macOS recovery mode on VMware.

The reason why I reference the article at the Medium website instead of including the replacement of the NTFS handler in my help text is because I did not succeed to do this on my VMware virtual machine. Booting my Mac, holding down "Windows key" + R (the Mac "Command" key corresponds to the "Windows key" on a PC keyboard) did not start recovery mode, but resulted in a reboot loop, the Apple logo never showing up, but the VM just rebooting again and again (until I released the keys, and macOS booting normally). I don't know what's the reason of this (nor if it's really VMware specific). Maybe it has to do with the recovery partition, that seems to be there, but not as a "physical volume" (and no "Boot from recovery partition" option in the EFI settings). I suppose that there are possibilities to fix this. As I do not really need NTFS write (just using my extFAT formatted stick), I didn't continue to investigate the problem. And, there is a way (somewhat annoying, maybe, but working and a good alternative for occasional write access to an NTFS flash drive) to use NTFS-3g without having to replace the handler.

Remounting the NTFS drive with NTFS-3g in a terminal.

The procedure consists in unmounting the NTFS partition and remounting it using the NTFS-3g driver. It can then normally be used in Finder, with the difference that it will be accessible in read-write mode. This is finally simpler than having to play around with SIP. With, of course, the disadvantage that it's a manual operation, thus, having to be done each time we want to use the drive. Putting the commands within a bash script would simplify things, however this is somewhat dangerous. In fact, the partition identifier may not always be the same!

The first thing to do is to look up the partition identifier. Open a terminal and enter
    diskutil list
As you can see on the screenshot further down, on my Mac, the drive identifier is "disk4" and the partition identifier is "disk4s1". Be aware, that you'll have to adapt this value when unmounting and remounting the partition.

Now, lets remount the partition:
    sudo diskutil unmount /dev/disk4s1
    sudo mkdir /Volumes/NTFS
    sudo /usr/local/sbin/mount_ntfs /dev/disk4s1 /Volumes/NTFS
where the first command unmounts the NTFS partition, the second one creates a directory to be used for the remount operation and the third one remounts the partition. Note that we use mount_ntfs located in /usr/local/sbin/ and not the original mount_ntfs located in /sbin!

As you can see on the screenshot, we'll have to confirm the mount operation by pushing the OK button in the "Terminal would like to access files on a removable volume" dialog box.

NTFS drives on macOS: Remounting an NTFS drive using ntfs-3g (manual Terminal operation)

A new volume called NTFS (I should have call it "Flash" instead...) appears on the desktop and we can view its properties (right-click the volume and choose Get Info). On the screenshot, you can see that the format of the volume is no longer Windows_NTFS (as it was when we listed the partitions) but NTFS-3g (macFUSE).

NTFS drives on macOS: Properties of an NTFS drive mounted with ntfs-3g

And, opening the volume in Finder and right-clicking inside in order to display the context menu, this one now lists the command New folder, what means that our NTFS drive may now be written to!

NTFS drives on macOS: Finder context menu with writing related commands thanks to ntfs-3g

If you find this text helpful, please, support me and this website by signing my guestbook.