Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Last active March 13, 2024 15:49
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save miguelmota/d1d70d19fbd763afdd65c5c1375ddbde to your computer and use it in GitHub Desktop.
Save miguelmota/d1d70d19fbd763afdd65c5c1375ddbde to your computer and use it in GitHub Desktop.
OS X mount FAT32 partition with read/write permissions
diskutil list
diskutil unmount /dev/disk0s6
sudo mount -w -t msdos /dev/disk0s6 /Volumes/data
Make sure to move the switch up on the side of the SD card to disable write-protected mode.
@icepicknz
Copy link

/dev/disk2 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *15.8 GB disk2
1: DOS_FAT_32 piaware 134.2 MB disk2s1
2: Linux 1.9 GB disk2s2

Barrys-MacBook-Pro:~ root# sudo mount -w -t msdos /dev/disk2s1 /Volumes/personal/
mount_msdos: /dev/disk2s1 on /Volumes/personal: Permission denied

@jimcam
Copy link

jimcam commented Sep 14, 2018

I'm getting the same error. Any insights?

$ sudo mount -w -t msdos /dev/disk2s1 /Volumes/boot
mount_msdos: /dev/disk2s1 on /Volumes/boot: Permission denied

@jdjasperson
Copy link

So, here's what I did after much face-palming and cursing of Apple and their absolute disregard for their users:

From the terminal:

  1. Identify your USB by NAME and IDENTIFIER:

diskutil list

Output is:

/dev/disk3 (external, physical):  
#:                       TYPE NAME                    SIZE       IDENTIFIER  
0:     FDisk_partition_scheme                        *2.0 GB     disk3
1:                 DOS_FAT_32 MIXTAPE                 2.0 GB     disk3s1

In this case, NAME=MIXTAPE and the IDENTIFIER=/dev/disk3s1

  1. Now unmount the USB:

sudo diskutil unmount /dev/$IDENTIFIER

Example:

sudo diskutil unmount /dev/disk3s1

Output is:

Volume MIXTAPE on disk3s1 unmounted

  1. Now create the Volume directory - this appears to be the key!

sudo mkdir /Volumes/$NAME

Example:

sudo mkdir /Volumes/MIXTAPE

No output.

  1. Now mount the USB to the Volume:

sudo mount -w -t msdos /dev/disk3s1 /Volumes/$NAME

Example:

sudo mount -w -t msdos /dev/disk3s1 /Volumes/MIXTAPE

No output.

  1. Validate that the USB is now writeable:

touch /Volumes/$NAME/tmp.txt

Example:

touch /Volumes/MIXTAPE/tmp.txt

  1. You should now be able to see that you were able to create the tmp.txt file on your USB in the Finder app or by:

ls -al /Volumes/$NAME

Example:

ls -al /Volumes/MIXTAPE

@shreyanshp
Copy link

For people, whose disk has a space in the name
mkdir hello\ there or mkdir 'hello there'

@drummingfool
Copy link

Hi guys,

New here - signed up to respond to this thread.

I was having difficulties mounting an SD card with the process outlined above - kept getting permission denied or read-only access.
Followed the steps, tried to create a new folder in Volumes and mount to that, etc - no luck and was beginning to pull out my hair!

I came across this video on YouTube from 2013 - I almost dismissed it at first because the solution seemed too good to be true - alas! when I tried it, my SD card mounted with full write permission no problem, no playing with custom mount points, etc.
https://www.youtube.com/watch?v=nehn7mh81vs

Anyway - I thought I'd leave this here for anyone who might still be having a permission denied issue when trying to mount an SD card with write permission. Hope it helps for some of you!

@thermosym
Copy link

when I mount a mp3 player fat32 disk, it shows an error like this

mount_msdos: Unsupported sector size (0)

@BrianHenryIE
Copy link

This worked for me before, but it's not working for me today. I presume the difference is the M1 Mac.

sudo mount -w -t msdos /dev/$IDENTIFIER /Volumes/$NAME

mount_msdos: Unsupported sector size (98)
mount: /Volumes/HASSFAT failed with 71

@jdjasperson Can I suggest you edit 4. to be sudo mount -w -t msdos /dev/$IDENTIFIER /Volumes/$NAME.

I was able to edit the file using a Windows VM on Parallels (ARM).

@mohamed-ea
Copy link

BrianHenryIE i'm getting the exact error 71 with an i7 mbp ! it's not related to M1
by the way i'm stuck in this step :

sudo mount -w -t msdos /dev/disk2s3 /Volumes/data
mount_msdos: /dev/disk2s3 on /Volumes/data: Permission denied
mount: /Volumes/data failed with 71

@devmauvsantos
Copy link

@mohamed-ea @BrianHenryIE seems like this is a common issue now, I solved it on my case.
I was getting:

$ sudo mount -w -t msdos /dev/disk6 /Volumes/fat
mount_msdos: Unsupported sector size (0)
mount: /Volumes/fat failed with 71

The problem is because we were trying to either mount the disk or the wrong partition, make sure you are mounting the correct partition on your disk

Screenshot 2023-02-08 at 10 16 50 PM

@califlower
Copy link

does not work for me on an m1 mac,

mount_msdos: /dev/disk4: Operation not permitted
mount: /Volumes/nrf failed with 71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment