MacBook – Could removing corrupted files on the MacBook or Mac’s hard drive make the file system’s health even worse

apfsfilesystemhfs+macmacbook pro

I tried to move some files from the MacBook's SSD to a network drive (by drag and drop) , and the "Copy" window reported the file was corrupted. If I remove the file and empty out the trash can, could it actually further damage the file system (or make the hard drive's health even worse)?

This is due to: if the files was occupying some bad sectors (on the SSD), then could releasing the sectors let other apps or even the macOS write to and read from those sectors, and cause big problems due to this, especially if it is macOS using those sectors as virtual memory.

(so in a way, if we don't delete those files, it is to let the files occupy the bad sectors so that those sectors are never used by other apps or macOS again).

I think those files were corrupted due to when copying from the external hard drive, the USB plug was a little loose, and so the copying got interrupted in the middle. But the strange thing is, if that's the case, it should be only one file that got corrupted. Right now it was 2 or 3 files (or maybe the USB plug was loose for 2, 3 times, which I can't remember now).

The issue maybe further complicated by the MacBook previous using OS X 10.9 Mavericks, and possibly some of Yosemite, El Capitan, Sierra, and High Sierra during the upgrades in the past, so it was using HPS+ and now APFS (Mojave).

Best Answer

Short answer: yes, almost any changes you make on the disk have a possibility of causing further damage. Back up anything important (making minimal changes as you do so), then try to diagnose and fix it.

Long answer: there are several different levels where you could have data corruption/damage:

  1. There might be a hardware problem -- failing drive, bad cable, etc. I'm not familiar enough with the failure modes of SSDs to tell if this might be the problem here, but I wouldn't rule it out.
  2. The filesystem data structures (which keep track of what files exist on the disk, where their data is stored, which blocks are available for use, etc) might be corrupted. This sort of damage sort-of applies to the entire volume (or container, in the case of APFS), but might only affect some files/folders.
  3. Some individual files might have damaged/corrupted contents. I don't think that's the problem here, since a Finder copy will just blindly copy the contents, whether or not they make sense.

Problems at any of these levels can cause secondary problems at higher levels. Hardware problems can cause volume data and/or file contents to get garbled, and volume problems can cause things like parts of files getting overwritten or lost. So if you see problems at one level, keep in mind that the root cause might be at a lower level.

Conversely, trying to fix (or just change) things at a higher level than the root cause can cause additional damage. If you've got damaged volume data structures, creating, deleting, or even editing files can cause the damage to snowball. If you have a hardware problem, trying to repair the volume data structures (e.g. with Disk Utility's First Aid feature) might just cause additional secondary problems at that level.

In your situation, the first thing I'd do is make sure any important files/data is backed up (or as sure as possible under the circumstances). If possible, do this while booted from something else, with the suspect volume mounted read-only to avoid further corruption. (That's probably not possible, so don't worry about it too much. But don't make any unnecessary changes on the disk until the backup's done.)

Then and only then, try running hardware tests, like Apple Hardware Test (for models introduced before June 2013) or Apple Hardware Diagnostics (for models introduced after June 2013) (more info here), or a third-party test utility.

If the hardware tests don't find anything wrong, then start looking at the volume data structures. I don't have any experience repairing APFS yet, but I'd try Disk Utility First Aid first (probably booted in recovery mode). Frankly, if that can't fix it, I'd erase the disk (not just the volume) and reinstall/recover from scratch.

Afterward, maintain good ongoing backups in case there's some underlying problem that didn't get detected/fixed.