-
Notifications
You must be signed in to change notification settings - Fork 37
Image File Fragmentation
Eric Helgeson edited this page Jan 7, 2025
·
6 revisions
If the image file on your SD card is fragmented it can impact the performance.
You will see a warning:
- file is fragmented, see https://github.com/BlueSCSI/BlueSCSI-v2/wiki/Image-File-Fragmentation
which leads you to this page.
- Copy all files off your SD Card.
- Delete all files off the SD card or do a Full format of the card
- Copy all the files over to your SD Card one at a time.
- The files should no longer be fragmented on the SD card.
Modern MacOS has extended attributes on files which can not be copied to FAT/exFAT file systems and cause fragmentation when attempting to copy. Here are a few work rounds:
- Copy the file without extended attributes
cp -X MyFileName.hda /Volumes/MySDCard/
or
- Remove extended attributes before copying files
- Open
Terminal
- Run
xattr -c MyFileName.hda
- Run
xattr -d com.apple.provenance MyFileName.hda
- Can only be run from Terminal.app (not iTerm/etc)
- Copy via Finder or CLI.
- Open
It is also a good idea to stop MacOS from updating metadata files on the drive:
- Exclude the SD Card from Spotlight
-
System Settings
->Siri & Spotlight
->Spotlight Privacy...
- Exclude the SD Card
-
- Disable
.DS_Store
creation on removable drives- Open
Terminal
- Run
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
- Open
- Use a defrag utility like Defraggler to defrag the image file on the SD card.
https://github.com/greiman/SdFat/issues/256#issuecomment-778795554