1

I have been using an old HDD with a SATA-USB cable for a few months now on a Mac Mini (running macOS Mojave 10.14.6; HDD has one EFI partition and one other partition with Journaled HFS, unencrypted). I was using it regularly everyday. But now weird issues have started popping up - sometimes it doesn't mount, sometimes it doesn't open in Finder (blank window), sometimes it hangs in Finder for a long time etc.

What I have tried so far:

  1. Changed the USB-SATA cable as I read that's a common issue. It didn't help.

  2. Used Disk Utility to try and repair the disk and volume. It didn't work as it couldn't unmount the Volume. Manually unmounting also didn't work as macOS showed the spinning wheel for a long time. Was able to run Disk Utility successfully from Recovery and view the files in Terminal. But Finder still didn't show the files or hung when the disk was accessed.

  3. Tried to access the files on the disk from the Terminal. But both cd /Volumes/Backup and ls -la /Volumes/Backup command give a Permission Denied error.

  4. Again went to Recovery, scanned and repaired the disk with Disk Utility and tried to determine the owner of the files through the recovery Terminal. The command ls -la /Volumes/Backup listed the owner user and group of all the directory and files as _Unknown (some of the dot files had root and wheel as the user and group respectively). So I tried to regain ownership of the files and directory I had created with chown -R 501:staff /Volumes/Backup/AllTheDirectories. This was successful.

  5. But in macOS, Finder still had issues and the Get Info window however still listed root, wheel, System, Everyone as users / groups under 'Sharing and Permission'. So I removed root, wheel and System and added my username here with 'read & write' privilege. Finder still had issues, and commands in Terminal trying to view the directories on the disk gave a Permission Denied error.

  6. I went to Recovery again, ran Disk Utility again, and this time removed all the old ACL in all files and directories on the disk with chmod -RN /Volumes/Backup/. After this, trying to view the files on the disk in Terminal again gives ls: Backup: Permission denied. With sudo, the command executes without error. But, it doesn't show any files or directory except .Trashes. (However, Terminal in Recovery shows all the files and directories are still there).

The issue crops up even if macOS is booted into Safe Mode. I can use Recovery to backup all the files (I tested by using tar to save some of the files to another disk and it worked fine). But I am very curious to know what exactly is the issue that macOS cannot display the files in Finder or Terminal.

(In between, I had also tried the enableOwnership option with diskutil but it didn't help.)

What is the problem here and how can I fix this?

Update:

I tried removing the ACL and chown'ing the files again through Recovery, and now noticed a new behaviour - while previously Finder used to freeze when opening the disk (or only displayed the main directory and files and freeze if you tried to open any Folder or file), it now displays all the Folders on the disk correctly. I can also open the Folders and view the contents. But opening any files in a Folder gives the following error:

The file “2021-03-25 - For EC.png” could not be opened. It may be damaged or use a file format that Preview doesn’t recognise.

The file however isn't damaged - if I copy it to another disk from Recovery, I can open it fine. At the same time, while I can browse the files on Finder now, Terminal still gives a "Permission Denied" error for ls command on the disk, and using it with sudo doesn't show any directory or files except .Trashes (as I have previously mentioned too).

sfxedit
  • 1,712
  • How old is old? To me, it sounds like the disk is failing. Since you were able to back it up and will lose no data, have you try to reformat and repartition to see how it behaves afterwards? IMHO, you should replace the disk and move on. Also, what kind of Mac and which macOS? – IconDaemon Dec 02 '22 at 22:46
  • Around 5 years, I think. It's the old Apple HDD that I replaced with another and have been using as portable disk for more than a year now. I do plan to reformat it. But I'd like to know what the issue is - it works in Recovery probably because root is the user there. In which case there is some permission / ACL issue that is preventing it from working even with admin users on normal boot. That should be fixable. – sfxedit Dec 02 '22 at 23:09
  • 1
    Have you granted the Terminal app Full Disk Access in the Security & Privacy preferences (see this question)? Note that this is independent of normal file permissions, so changing those has no effect on privacy restrictions. Also, permissions can be confusing in Recovery mode because your user account doesn't exist there, so it can't tell who owns your files. And I recommend against changing permissions in Finder, because it does weird things with unix vs ACL permissions (use chmod instead). – Gordon Davisson Dec 03 '22 at 00:44
  • @GordonDavisson Yes, Terminal app has full disk access. I will try chown once more. – sfxedit Dec 03 '22 at 01:01
  • The simplest way to deal with permissions on any external drive [except a Time Machine drive] is to just Get info & set it to ignore ownership. For HFS drives, there's never been anything better than DiskWarrior for fixing them [less useful these days as it can't handle APFS] & it's not cheap. I'd back it up before playing with it any further. – Tetsujin Dec 03 '22 at 07:20
  • @Tetsujin The option "ignore ownership" is enabled but it doesn't help. Please also read the updates I have posted to the question. – sfxedit Dec 05 '22 at 00:33
  • @Tetsujin This wasn't a Time Machine backup disk - I don't use Time Machine because I share your negative opinion about it. I don't believe DiskWarrior can help me here as this seems to be some permission issue (root from Recovery can access all data on disk without issue) and Diskwarrior no longer repairs permissions on newer macOS. – sfxedit Dec 06 '22 at 03:27
  • Ah, sorry - I went off on the wrong tack :\ – Tetsujin Dec 06 '22 at 08:27

0 Answers0