Problem with Music Files on USB Drives

For years I have had a USB stick in my car loaded with mp3 files which worked perfectly. A couple of days ago I refreshed this USB drive with some new music using Finder on an Apple Silicone MBP and all heck broke loose. I erased the drive using Disk Utility and then copied the mp3s to the drive using Finder. Lo and behold the car then started to "say" that every other file was unplayable. I tried the stick on a music system at home, same issue, every other file unplayable. I then tried a different USB drive, same issue. Long story but the problem is that macOS places a duplicate named copy of every file in the USB drive with the prefix ._ and the extension .mp3 (even though they are not mp3s) and to make matters worse the files are hidden in macOS. Command + Shift + . will NOT show the hidden files on a Mac however (thanks for Windows) two Windows PCs, one W10 and the other W11, both display the hidden files. So there are hidden files on a Mac that that are not visible even if I do the Command + Shift + . Not good!!!


I cannot take a screenshot of these files on the Mac as the files do not show. However I took a screenshot on much maligned Windows and they can be seen below. These appear for every single album that I have copied so deleting them manually would not work as I have hundreds. And please note that this was not an issue in the past but I don't recall when I last refreshed that USB drive, it's been awhile. My research shows that this has been going on for awhile but it had not bitten me yet.


So is there something I can do while copying to avoid corrupting my USB drives with these hidden mac files that play havoc on other systems, cars, home stereos, etc?


As an example, using a Windows computer to display an album one can see 11 hidden files (not visible on a Mac even with hidden files "showing"), all mp3s, all 4KBs, and somehow placed there by macOS after copying the real 11 music files. The cars and the home stereos try to play these files but are unable and display an error. Any ideas on how to avoid this? I found an app called BlueHarvest that removes these files, the issue is know, is that the only way?




I tried running a batch file on a USB drive in W11 in an attempt to delete these files but was unsuccessful. Here is what I tried:


D:

cd D:\

del /s /q ._*.*


Thanks for any help.


Posted on Jul 22, 2023 6:16 PM

Reply
Question marked as Top-ranking reply

Posted on Jul 23, 2023 7:41 PM

elcpu wrote:

I erased the drive using Disk Utility and then copied the mp3s to the drive using Finder. Lo and behold the car then started to "say" that every other file was unplayable. I tried the stick on a music system at home, same issue, every other file unplayable. I then tried a different USB drive, same issue. Long story but the problem is that macOS places a duplicate named copy of every file in the USB drive with the prefix ._ and the extension .mp3 (even though they are not mp3s) and to make matters worse the files are hidden in macOS.


The Finder sees that the external drive does not use a Mac filesystem. It is trying to preserve some extended attributes that a Mac filesystem would maintain, by creating


  • FOO.MP3 – the main file
  • ._FOO.MP3 – the extended attribute file


The idea being that if you ever copy files back to the Mac, it can transparently combine the data from these two files, to preserve the extended attributes.


macOS is based on Unix, and adding a leading '.' (s a standard Unix convention for hiding a file from regular directory listings. The ._FOO.MP3 name represents an attempt to create a hidden file with a unique name that is easy to associate with the main file.


Unfortunately, other systems don't know about the Finder's "._" games, and may not even know about the Unix convention for hiding a file by starting its name with a "." They see the .MP3 suffix, conclude that the extended attribute files are MP3 files, and of course, then discover that these "MP3" files are hopelessly corrupt.


The same issue happens with preparing thumb drives and memory cards for use with HDTVs and digital picture frames. The ._*.JPG files look like corrupt JPG photos to many third-party devices.


The solution is to go into Terminal just before you eject a memory card or USB flash drive.

  1. Go to that volume. (E.g., type cd and a space, then drag-and-drop the memory card or USB flash drive icon.)
  2. Do a rm ._*.* to get rid of all files with a leading ._
  3. Do a ls -a to identify any remaining files that begin with a .
  4. Do a rm on any such files other than . or .. (in Unix, . means the current directory and .. is the parent directory)
  5. In the Finder, eject the memory card or flash drive without doing anything else first.


For a MP3 or JPG file, you don't lose all that much by trashing the extended attributes file – even if you do decide to later copy the file back to the Mac.

Similar questions

45 replies

Jul 24, 2023 7:44 AM in response to elcpu

elcpu wrote:

Servant of Cats wrote:

That's just part of the prompt, to let you know that the shell is waiting for you to type in another command. The bash shell ("Bourne Again Shell"; the name is a pun) uses "$"; other shells like csh might use "%".

You lost me there... Care to elaborate?
I am using zsh because that is what Barney used, does it make any difference?


As to the pun … The original Unix shell was sh (shell). The Bourne shell was developed by a guy at Bell Labs whose last name was Bourne. ("Bourne Again shell" is to "shell" what "born again Christian" is to "Christian"; get it?).


bash used to be the default shell for macOS, but Apple stopped upgrading the version of bash they shipped with macOS … and in current versions of macOS, zsh is the default shell. The set of scripting commands you find in one shell may be a bit different from the set you find in another, which is one reason why some power users have strong preferences for one shell or another, and why you can change your default shell.


My version of macOS is old enough that bash is its default shell. But for what you're doing, if your default shell is zsh and you have a script that works with zsh, there isn't any reason to switch to another shell.


Jul 24, 2023 5:59 PM in response to Servant of Cats

Servant of Cats wrote:

Mac to USB flash drive with hidden files to Mac isn’t where you see the problem. The Finder on the second Mac knows about, or does not care about, the hidden files.

Mac to USB flash drive with hidden files to some non-Apple device that does not understand what the hidden files contain is where you see the problem.


Right on.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Problem with Music Files on USB Drives

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.