You'd better recover missing files from empty folders on the external hard drive before you run the fsck command to check and repair the drive. It can't answer the question definitely whether fsck will erase the drive data but there is no need to take risks.
When the external hard drive is corrupted, the files could disappear from the external hard drive, to fix a corrupted external HDD on Mac, you can try First Aid and FSCK in Terminal. However, just as the system message says "repairing the partition map might erase disk0s1 (y/n)", such major operations may cause further data loss on your external hard drive, therefore, it is recommended to recover data from a corrupted external hard drive on Mac in the first step.
As long as the lost/deleted data hasn't been overwritten, it is possible to get files back from the corrupted hard drive. You can try professional data recovery software such as iBoysoft Data Recovery for Mac to scan for lost files on the drive and recover wanted files. Here's how:
- Download, install, and run iBoysoft Data Recovery for Mac on your computer.
- Connected the corrupted hard drive where the folders are empty.
- Choose Storage Device under Data Recovery.
- Select the corrupted external HDD and click Search for Lost Data.
- View recoverable files after filtering files using various categories.
- Select the desired files and click Recover to save them somewhere else.
After getting files off the corrupted external HDD, you can continue running fsck on the drive without data loss and enter Y when it prompts the message "repairing the partition map might erase disk0s1 (y/n)." In case it doesn't work, you may need to format the external hard drive on Mac to repair the drive.