Thank you for the useful replies.
I did several clones of the drive to mechanical hard drives.
Then, I tried a network reinstall of OS X, as it seem possible to repair/replace the system files while keeping the user data.
Despite the defective sectors, I hoped the system could reinstall itself by writing to remaining healthy memory cells, but unfortunately the drive has about 240 Mb of defective sectors and the reinstall failed.
So, I cloned the SSD again to a healthy 500GB mechanical drive, removed the SSD from the MacBook air, and booted on the external mechanical drive. The reinstall failed too.
In the disk utility, I can see three discs and volumes :
1) "Macintosh HD > Macintosh HD"
2) "disk2 > OS X Install ESD"
3) disk3 > OS X Base system
I tried verifying the "Macintosh HD" disk, as well as its permissions.
(I verified also other volumes, which are healthy.)
Verifying permissions of "Macintosh HD" showed several errors:- Different permissions for several subfolders of /usr/libexec/cups
expected drwxr-xr-x, currently dr-xr-xr-x
- Opening error 22 : "Invalid argument" on usr/libexec/efiupdater
- Opening error 22 : "Invalid argument" on usr/libexec/smcupdater
- Different permissions for several folders:
-- Applications/Safari.app/Con...index.html
-- Library/Printers/(and subfolders)
expected lrwxr-xr-x or drwxr-xr-x, currently -rw-r--r-- or dr-xr-xr-x
- Different groups for several folders : Library/Printers/..., Library/Java, Library/Preferences...
expected 80, currently 0
The
"Repair disk permissions" button remains disabled.
When veryfing the disk, the strings (here translated in English) are:
Quote:
(...)
The volume (here the GUID) appears to be OK.
The exit code from checking the storage system is 0.
Checking the file system.
Checking the HFS Plus journaled file system.
Checking the excess block system.
Checking catalogue file.
Invalid node structure.
The volume Macintosh HD could not be fully verified.
The exit code from checking the file system is 8.
Error: This disk must be repaired. Click on "Repair disk".
Unfortunately the "Repair disk" button remains disabled.Maybe I cannot repair because the drive is mounted and I'll try again repairing by connecting it to another MacBook.
If this doesn't work, I hope I can change permissions or ownership with commands like chmod and chown.
Concerning
DiskWarrior, I did not try it but seems nice from what I read.
Does anyone knows if it uses file system and permission verification algorithms from Mac OS (for instance through libraries) or does it brings different independent algorithms?
Thanks.