jeudi 19 novembre 2020

Manipulating SD card

 If you are stucked with a SD card that you cannot format, try this solution:

Open terminal

diskutil list

Search your disk. It will appear as a diskx disk with some partitions, for example s1 and s2

Try:

sudo diskutil eraseVolume free free disk2s2

and 

sudo diskutil eraseVolume free free disk2s1

After you can format the SD card.

Take care, this procedure will erase the content of your SD card.


lundi 2 novembre 2020

photoanalysisd and photo

It you cannot eject a shared volume or if your shared volume is always mounted, perhaps it is based on photoanalysisd that analyzed your photos.
Check which software is using your disk with:
First, search for the name or your volumes using
ls /Volumes/
Then, look what software is using the volume MyDrive
sudo lsof /Volumes/myDrive

For what it's worth (and with all the usual disclaimers about potentially making your mac unstable by disabling system services), here's some commands that will manipulate this service and services like it. Note the $UID in the command, that's just a bash shell variable that will resolve to some number. That's your numeric UID. You just run these commands from a Terminal command line. No special privileges needed.
If you want to disable it entirely, the first command stops it from respawning, and the second kills the one that is currently running:
launchctl disable gui/$UID/com.apple.photoanalysisd
launchctl kill -TERM gui/$UID/com.apple.photoanalysisd
(If you kill it without disabling it will die, but a new one will respawn and pick up where the old one left off)
I don't have this problem myself, so I can't try these next two commands. They're relying on good ole UNIX signals. You could theoretically suspend and resume the process like this ("STOP" and "CONT" are stop and continue):
launchctl kill -STOP gui/$UID/com.apple.photoanalysisd
launchctl kill -CONT gui/$UID/com.apple.photoanalysisd
It seems that there is another process that do the same:
launchctl disable gui/$UID/com.apple.photolibraryd
launchctl kill -TERM gui/$UID/com.apple.photolibraryd


It does not work with macOS Catalina (: