The Short Answer
You probably can fix your problem by entering the command below. To understand what "probably" means, you would probably need to read the rest of this answer.
dd if=/dev/zero count=1 seek=1 of=/dev/disk5
The Long Answer
A drive can contain both a Master Boot Record (MBR) scheme and an Apple Partition Map (APM) scheme simultaneously. When this happens, Windows (and PC firmware) will choose the MBR scheme and ignore the APM scheme. On the other hand, macOS/OS X (and Intel Mac firmware) does the opposite and chooses the APM scheme over the MBR scheme.
Usually, when both schemes are deliberately applied to the same drive, this is done in a way where conflicts are avoided. Since the volume contained by the partition of type Apple_HFS
is not mounting, you probably have a conflict which resulted in the volume at least being partially corrupted.
Below is an example using 2013 iMac running Catalina and a HP PC running Windows 11.
I started by plugging a 16 GB flash drive into the Mac and then used the Disk Utility to erase the flash drive. The following was chosen.
Next, I ejected and plug the flash drive into the PC. Windows Disk Management shown this flash drive to be Disk 1
, as seen below.
I delete the volume shown and creating a new volume using the default size. The following was chosen.
The result is shown below.
Next, I copied a file named scratch.txt
to the flash drive. This file is sufficiently large enough to at least overwrite the header of the JHFS+ volume named MyJHFS+
. The result is shown below.
I ejected and returned the flash drive to the Mac. Below is the output from the command diskutil list external
that pertains to the flash drive. You can tell the Apple_HFS
type volume did not mount, because the name MyJHFS+
is missing.
/dev/disk4 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: Apple_partition_scheme *15.9 GB disk4
1: Apple_partition_map 32.3 KB disk4s1
2: Apple_HFS 15.7 GB disk4s3
Below is the output from the command sudo fdisk /dev/disk4
. This output shows the MBR Partition Table which is stored in sector 0 and was created by Windows 11.
Disk: /dev/disk4 geometry: 1929/255/63 [30998528 sectors]
Signature: 0xAA55
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
------------------------------------------------------------------------
1: 0C 0 32 33 - 1023 254 63 [ 2048 - 30994432] Win95 FAT32L
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
Note that sectors 1 through 2047 are unallocated. Typically, this is done to reserve space required for a legacy GRUB install.
Below is the output from the command sudo pdisk -l /dev/disk4
. This output shows the APM which is stored in sectors 1 through 63 and was created by macOS Catalina.
Partition map (with 512 byte blocks) on '/dev/disk4'
#: type name length base ( size )
1: Apple_partition_map Apple 63 @ 1
2: Apple_Free 262144 @ 64 (128.0M)
3: Apple_HFS 30736304 @ 262208 ( 14.7G)
4: Apple_Free 16 @ 30998512
Device block size=512, Number of Blocks=30998528 (14.8G)
DeviceType=0x0, DeviceId=0x0
The table below summarizes the locations of the partition tables and volumes. Note that the locations of the partition tables are not in conflict, but the volumes defined in these tables definitely are.
Use |
Type |
Name |
Start Sector |
End Sector |
Size in Secors |
MBR Partition Table |
FDisk_partition_scheme |
|
0 |
0 |
1 |
APM Table |
Apple_partition_map |
|
1 |
63 |
63 |
FAT32 Volume |
Windows_FAT_32 |
MYFAT32 |
2048 |
30996479 |
30994432 |
Mac OS Extended (Journaled) Volume |
Apple_HFS |
MyJHFS+ |
262208 |
30998511 |
30736304 |
Since the MyJHFS+
volume failed to mount, the MYFAT32
volume was not be damaged by macOS. Therefore zeroing out the APM table would result in macOS using the MBR partition table. Actually, zeroing out the first sector would be sufficient. This can be done by using the command given below.
sudo dd if=/dev/zero count=1 seek=1 of=/dev/disk4
Below is the new output from the command diskutil list external
that pertains to the flash drive. This was observed after entering the above command.
/dev/disk4 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *15.9 GB disk4
1: Windows_FAT_32 MYFAT32 15.9 GB disk4s1
Below is a Finder view of the mounted FAT32 volume named MYFAT32
.
How to Prevent Two Partition Tables
Simply use the Windows diskpart
command to clean the drive before using Windows Disk Management. See the example shown below.
C:\Users\david>diskpart
Microsoft DiskPart version 10.0.22621.1
Copyright (C) Microsoft Corporation.
On computer: HPWINDOWS11
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 931 GB 256 GB *
Disk 1 Online 14 GB 0 B
DISKPART> select disk 1
Disk 1 is now the selected disk.
DISKPART> clean
DiskPart succeeded in cleaning the disk.
DISKPART> exit
Note: The clean
command does remove all volumes on the drive.
diskutil info disk5
with an edit?