10

I got a 64GB USB Stick formatted as exFAT from Windows containing a lot of files. The stick mounts without any problems on a Windows 10 system. My MacBook Pro running MacOS 10.13.2 cannot mount it. Instead the disk utility tells me it contains kind of Mac OS extended file system (German, sorry) but unable to mount (also information looks strange):

disk utility screenshot

Or from command line:

bb-8:~ arne$ diskutil list
/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *62.9 GB    disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:                  Apple_HFS                         62.6 GB    disk2s2

Running fdisk tells:

bb-8:~ arne$ sudo fdisk /dev/disk2
Disk: /dev/disk2    geometry: 7651/255/63 [122915328 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: EE 1023 254  63 - 1023 254  63 [         1 -  122915327] <Unknown ID>
 2: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
bb-8:~ arne$ sudo fdisk /dev/disk2s1
Disk: /dev/disk2s1  geometry: 812/8/63 [409600 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 2: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
bb-8:~ arne$ sudo fdisk /dev/disk2s2
Disk: /dev/disk2s2  geometry: 7609/255/63 [122243504 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: FF 1023 255  63 - 1023 255  63 [4294967295 - 4294967295] Xenix BBT   
 2: FF 1023 255  63 - 1023 255  63 [4294967295 - 4294967295] Xenix BBT   
 3: FF 1023 255  63 - 1023 255  63 [4294967295 - 4294967295] Xenix BBT   
 4: FF 1023 255  63 - 1023 255  63 [4294967295 - 2474929407] Xenix BBT   
bb-8:~ arne$ 

I have no idea why the volume is not mounting correctly. Any idea what to do without reformatting and loosing the data on the stick? Is there any option to manually mount the filesystem as exFAT using command line?

8
  • Your partition table seems to indicate that the partition type is Apple_HFS. This is why the Mac tries to mount it as HFS and fails. Can you check on your Windows machine if it displays the same in the partition table? (using diskmgmt.sys for example). Change the partition type to ExFAT and you should be able to mount the disk on the Mac as well.
    – jksoegaard
    Commented Dec 19, 2017 at 23:13
  • @jksoegaard it seems but: was formatted on a windows machine and also mounts there without hassle - looks like that information is wrong and I would wonder if the windows was able to create such. But I can check the windows info when I have access to tomorrow. Commented Dec 19, 2017 at 23:16
  • @jksoegaard how to safely change the partition type without risking the data? Commented Dec 19, 2017 at 23:18
  • The formatting and mounting only takes place at the partition level. The partitioning table is stored at the disk level instead. Might it be that you've created the partiton table on a Mac, and then later chose to reformat a single partition on a Windows PC to use there?
    – jksoegaard
    Commented Dec 19, 2017 at 23:18
  • Use a partition editor - I cannot remember if diskmgtmt.sys or fdisk on Windows will do it for this type of partition table. If not, you can most probably download a more advanced partition editor for free.
    – jksoegaard
    Commented Dec 19, 2017 at 23:19

4 Answers 4

8

Each partition on a drive is assigned a type. The type indicates what the partition will contain. Usually, but not always, this is a file system. The mapping from a partition type to a file system is not always one-to-one. For example, both the ExFAT and NTFS files systems map to the same partition type. Therefore, Windows generally does not look at the partition type, but rather looks at the content of the partition to determine the file system.

In your question, the output from the diskutil command shows the ExFAT formatted partition to be Apple_HFS. What should have appeared is Microsoft Basic Data. Therefore, the partition table has partition type error. Microsoft Windows will not care, but Apple macOS does.

Although, you do not show this in your question, the GUID for this type of partition is 48465300-0000-11AA-AA11-00306543ECAC. The correct value should be EBD0A0A2-B9E5-4433-87C0-68B6B72699C7. You could goto back to your machine running Windows, open a Administrator Command Prompt Window and enter the following commands. This will correct the error in the partition table.

Below I assume the USB stick (flash drive) is disk number 1. If not, then make the appropriate substitution. The detail partition command should show the incorrect partition type value of 48465300-0000-11AA-AA11-00306543ECAC.

diskpart
list disk
select disk 1
select partition 2
detail partition
help set
set id=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
exit

Note: If you are clever, you can cut-and-paste from the output of the help set command to enter the set id=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 command. If not, then type carefully.

Issues Regarding Using Windows Partitioning Tools on a Mac Computer.

Below has been referred to as THE GOLDEN RULE.

Never use the Windows diskpart or diskmgmt.msc commands to change the partitioning on a Mac computer.

Note: The diskmgmt.msc command displays the "Disk Management" window. An example is shown below.

c1

Originally, Mac computers could only BIOS boot Windows. In order for this to occur, a hybrid MBR/GPT partitioning method was employed. The Golden Rule was created because of this hybrid arrangement. Essentially, the diskpart and diskmgmt.msc commands would ignore the GUID partition table (GPT) and only update the MBR partition table. This could (and often did) lead to corruption of the partitions stored on a drive.

Eventually, Apple adopted the newer EFI boot method for Windows. When this method is employed, the hybrid MBR/GPT partitioning scheme is not used. Instead a a pure GPT scheme is employed. One would think this would negate The Golden Rule, but for a different reason, this rule lived on. This reason has to do with bugs introduced by the installation of Apple's Windows Support Software.

Windows Support Software, among may other things, allows Windows read-only access to certain Mac formatted partitions, such as "Mac OS Extended (Journaled)". Since the Windows software can now read these partitions, the software believes the partitions are Microsoft type partitions. When running Windows partitioning software, this can cause many possible side-effects. One is the replacement of the correct GUID partition type with Microsoft's partition type GUID of EBD0A0A2-B9E5-4433-87C0-68B6B72699C7. So it seemed, The Golden Rule still applied.

Recently, cases have been found where The Golden Rule can be broken. In other words, there are cases where the diskpart command can be used to edit a drive partition table when a pure GPT scheme is employed.

One such case is when the Windows Recovery Environment is used. This environment can be entered by holding down the shift key while selecting to restart Windows. When you navigate to a Command Prompt window, you can access the diskpart command. This command, when entered here, is unaffected by the Apple's Windows Support Software. Basically, the Windows Recovery Environment loads the Winre.wim image file, which was unaltered when the Windows Support Software was installed. This image file contains a copy of the diskpart command which can be executed safely.

3
  • Thanks for your detailed answer. At the end it was not worth the effort regarding a malfunction USB stick. I temporary copied it to a windows machine, reformatted as exFAT on a Mac and copied back. From there it works. Commented Dec 31, 2017 at 11:05
  • @ArneBurmeister Well, this is not a fair solution :) I've read somewhere that Mac likes only clusters 1024 bytes in size, and rejects others. You are lucky you had a Mac to format the card, but what if one has only a Windows machine to prepare a source drive? I recently bought a Macbook myself, and have a similar issue of moving large files around.
    – Rusty Core
    Commented Sep 11, 2018 at 23:37
  • In Windows 10 the command "set id=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7" resulted in error: the specified type is not in correct format". I used command "set id-0C" instead. It worked fine
    – tutejszy
    Commented Nov 14, 2018 at 12:56
2

Thanks David Anderson for your detailed answer! It points me to a solution on MacOS.

My situation was the same with Arne's, except:

> sudo fdisk /dev/disk2
/dev/disk2 (external, physical):
#:                       TYPE NAME                    SIZE       IDENTIFIER
0:      GUID_partition_scheme                        *123.0 GB   disk2
1:           Linux Filesystem                         123.0 GB   disk2s1

I previously formatted my drive on Linux and then on Windows. Guess Windows did not write the partition type. Let's do it for her on MacOS. First let's find out how our GPT table's laid out:

> sudo gpt -l /dev/disk2
         start       size  index  contents
          0          1         PMBR
          1          1         Pri GPT header
          2         32         Pri GPT table
         34       2014         
       2048  240252895      1  GPT part - 0FC63DAF-8483-4772-8E79-3D69D8477DE4
  240254943         32         Sec GPT table
  240254975          1         Sec GPT header

We want EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 a.k.a. Basic Data Partition to replace 0FC63DAF-8483-4772-8E79-3D69D8477DE4 a.k.a. Linux Filesystem Data.

There are 3 numbers to take note of from the output. What the numbers are depends on what was printed on your terminal. Do not copy mine. Do not lose them until you're done.

Look at the line that says about your partition. The 3 numbers are:

       2048  240252895      1  GPT part - 0FC63DAF-8483-4772-8E79-3D69D8477DE4
        ^        ^          ^
       start    size      index

First remove the wrong partition. It does not remove our actual data. In this command we use the number index, in my case 1:

> sudo gpt remove -i 1 /dev/disk2
/dev/disk2s1 removed

And then we add the correct partition. In this command we use all the 3 numbers: start, size and index. In my case they are 2048, 240252895 and 1. Replace with yours where appropriate.

> sudo gpt add -b 2048 -s 240252895 -i 1 -t EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 /dev/disk2
/dev/disk2s1 added

Done! Now MacOS sees it as an exFAT partition. Finder happily mounts the partition. Yay.

Reference on GPT GUIDs on Wikipedia:
https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs

0

When you try to mount it through Disk Utility, it decided to mount as Apple HFS automatically based on the observation it made, which it indicates your drive to be a MacOS Extended file system drive instead of Microsoft Basic Data - ExFAT.

I’ve encountered similar problems when I formatted my drive on Windows and then became unrecognizable / unmount-able, to manually mount a partition as specific file system, the following command line will do the trick:

# replace the last part with your own drive’s identifier
mount -t exfat disk2s1
man mount # for more info about ‘mount’, you can check out the man page

For another, one thing that I would personally suggest is to never try to check and repair a “corrupted” exFAT formatted drive (formatted with Mac) with Windows’ chkdsk command line even if you think your drive is corrupted, and that should go with the GOLDEN RULE that @David Anderson mentioned about, chkdsk really annoyed me a lot because it damaged 3 of my USB drives while I was entrusting it to fix the drive with all the data on it...

0

I had the same problem. I tried this: I tried to reformat the USB drive on the Windows 10, but this time I hit the button 'Restore device defaults' and selected 'Default allocation size', and it worked. I was then able to access the drive on the Macbook.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .