Getting your data corrupted can be devastating, especially if you do not have a backup of your important files. Whether it is a work document or a memorable photo, losing access to critical files can lead to permanent data loss.
Of course, there are several ways you can try to recover corrupted data and there are also third-party tools that make the process a lot easier. But if the corrupted file is located in a folder or a directory with thousands of other files, how do you find it? How do you know that there are no other corrupted files along with it?
Trying to single out a corrupted file can be problematic because you’ll never know if the file is corrupted unless you try to open it. Finding a corrupted file among 10 or 20 documents is manageable, but what if you need to sort out hundreds or thousands of files? Some users don’t even know that there are corrupted files in their drive until they try to copy the folder.
When a user tries to copy a corrupted file to another drive or another location, it will result in an error because the file is no longer accessible. There have been several users who reported not being able to complete the copying process because some of the files being copied are corrupted.
Whether you’re trying to copy a folder or an entire directory, as long as there is a single corrupted file in that batch, the copying processes will automatically stop once it encounters the corrupted file and will no longer proceed. This leads to copying failure, which frustrates a lot of Mac users.
There are also several instances when the entire drive is corrupted or the Mac user account is corrupted, which presents a more serious problem. The more files are involved, the more complicated the process will be because you’ll need to deal with a bigger number of possible corruptions.
Why Do Files and Drives Get Corrupted
There are so many reasons that can cause your files to get corrupted, and here are just some of them:
- The file was not properly saved
- The file was saved using the wrong format
- The file was affected by a malware infection
- The computer crashed or lost power while a process related to the file is running
- There are bad sectors on the hard drive or save location
- The file was incompatible with the application used to open it
These are just some of the elements that can cause file corruption. Regardless of what the cause is, trying to recover these corrupted files is not that of a big issue. But trying to copy data from a corrupted disk or a corrupted user account on Mac is more challenging.
How to Copy Data from a Corrupted Drive or Folder
When there is a corrupted file from a drive or folder you want to copy, trying to find that faulty file manually is impossible, especially if you need to comb through thousands of files. If this is the case, here are some methods to copy the files successfully to another drive or folder:
Method 1: Use Carbon Copy Cloner.
Carbon Copy Cloner or CCC is a backup application for macOS that allows you to clone drives, create a bootable backup, and copy files. But what you don’t know is that CCC is also equipped with a scanning tool that detects whether the files being copied are healthy or not. When CCC comes across a corrupted file, it triggers a notification that includes the name of the problematic document. Once you’ve figured out which file causes the problem, you can simply delete the file and proceed with the copy process.
Method 2: Repair Volume using DiskUtil Command
If you think your hard drive is corrupt, you need to verify it first before rapairing. To do this, follow the instructions below:
- Open Disk Utility from the Finder > Go > Utilities folder.
- Write down the disk name.
- Open Terminal from the Utilities folder.
- Type in the following command: diskutil verifyVolume /Volumes/DriveName
- Change DriveName with the disk name that you wrote down.
- If you get the message below, it means that you need to repair your hard drive:
The volume X was found corrupt and needs to be repaired
- To repair the volume, type in the following command in the Terminal:
diskutil repairVolume /Volumes/DriveName
- Change DriveName with the disk name that you wrote down.
- Wait for the process to be completed and then try to copy the files again.
Method 3: Run the FSCK Command.
File System Consistency Check (FSCK) is a built-in command line tool that you can launch via the Terminal app to try and repair your corrupt partition or drive. But before you run this command, you must find out first which partition you want to repair.
To use this command, follow the steps below:
- Open the Terminal app from the Finder > Go > Utilities folder.
- Type in this command, then press Enter: diskutil list
- You will be presented with a list of connected drives along with partition details.
- Identify the corrupt drive from the list and write down the /dev/disk#.
- Now type in either of this command:
- sudo fsck_hfs -r -d /dev/disk2 – to run the repair on entire drive
- sudo fsck_hfs -r -d /dev/disk2s1 – to repair only s1 partition in disk2
- Press Enter to execute the command and wait for fsck to complete the scan and repair the errors.
- If the boot partition of your drive is corrupted, restart your Mac via single-user mode by pressing the power button while holding down the Command + S keys.
- Type in this command in the Terminal: /sbin/fsck –fy
How to Copy Data from a Corrupted User Account on Mac
If your user account got corrupted and you can no longer access your files, you can use any of the methods below:
Method 1: Copy the Files Manually.
If you’re trying to copy an entire drive or folder but it keeps getting interrupted because there are corrupted files included, these are the steps you can take:
- In Finder, navigate to the /Users folder and look for the old account home folder.
- Select that folder, right-click, then choose Get Info.
- Click on the lock icon and type in your admin password to make changes to that folder.
- Scroll down to the bottom and look for the Sharing & Permissions section.
- Add your user account to the permissions and set the files to read only.
- Close the window.
- Open the folder or drive whose files you want to copy.
- Press Command + A, then press Command + C if you want to copy everything or select the files manually.
- Press Command + V to paste the files into your current user’s home folder.
The permission is set to read only so that when you drag the files, it will make a copy. When you try to move the files, they will retain the old user’s permissions and won’t be accessible on the new drive or folder.
Method 2: Use Terminal.
If you’re comfortable with using command lines, you can try this method using the Terminal. To do this:
- Launch Terminal from Finder > Go > Utilities.
- Type in the following command, then press Enter: cp -Rfv sourcefile destinationfile
- cp – copy
- R – maintains file hierarchies
- f – if an existing destination file cannot be opened, remove it and try again
- v – verbose mode, displays files transferred as it progresses
- sourcefile – data you want to copy
- destinationfile – directory or drive you want to copy to
This command does not ignore errors or corrupted files, but the “f” flag forces through them and only copies the intact data. When you see the progress through the verbose flag, you will get an error message that says data not copied due to I/O error when it encounters corrupted data. Once the error message is displayed, the command moves on to the next file even without any user input.
Method 3: Use a Third-Party Data Recovery Tool.
If you don’t want to trouble yourself with the methods above or for some reason, the steps above don’t work, your next option is to use a data recovery software. There are a lot of data recovery software available on the Mac App Store, but you need to choose one that does the work thoroughly. Some of the best data recovery tools for Mac include EaseUS Todo Backup, Disk Drill, Data Rescue 5, Recoverit, and Stellar Data Recovery Professional. Most of these apps are easy to use and work well in recovering corrupted data.
Data loss is a serious problem and the most common cause is corruption. If your files, folders, or your drive gets corrupted and you don’t have a reliable backup, getting access to your important files can be tricky. If you’re not sure what to do, you can try any of the methods above to see which one would work for you. If you’re not successful, you can use third-party data recovery tools instead.