Jump to content

Mount Disks — Mount and unmount disk partitions


Recommended Posts

8 minutes ago, sepulchra said:

Apologies this is such a pain.

 

No need to apologise, not your fault!

 

8 minutes ago, sepulchra said:

That undefined volume is always connected and this all started after a fresh boot.

 

Alright, that does suggest something became wonky from macOS’ side. I should’ve started by suggesting the reboot but thought we might get it worked around another way. In retrospect that wouldn’t be desirable, because it would mean you wouldn’t see the drive anyway which wouldn’t be what you want. All this makes it very hard to debug. But again, not your fault, diagnosing hardware by talking over the internet is quite a challenge.

 

8 minutes ago, sepulchra said:

I will reboot, revert, and report back.

 

Also try disconnecting it and connecting it back, or making other interactions in general. It seems that for some reason macOS is not correctly seeing/reporting one or more of the partitions.

Link to comment

I think I do owe you an apology because this is clearly some kind of edge case. I have another M1 machine running 14.5 and I should have tested that earlier in this process. The workflow from the gallery is working fine on that machine (M1 MBP). Let me do some more investigating on my M1 mac studio and see what I can find. Again. Sorry for making you spin your wheels. 

Link to comment
3 hours ago, vitor said:

 

No, but that’s to be expected. jq looks to be designed specifically with that in mind and do one thing: handle JSON. So any general solution will have to be more verbose. The advantage being that they’re bundled with macOS instead of being an external dependency like jq.

That's fair.

 

As an example I'd like to remove the dependency on jq in my Moby Games workflow: https://www.alfredforum.com/topic/21983-moby-games-workflow/

 

Link to comment

That uses jq a lot, so rather than try to make some commands use something else, I’d instead rewrite it in osascript (JavaScript). To replace the curl command, you can use something like this:

 

function curlMoby(gameTitle, apiKey) {
  const task = $.NSTask.alloc.init
  const stdout = $.NSPipe.pipe

  task.executableURL = $.NSURL.fileURLWithPath("/usr/bin/curl")
  task.arguments = [
    "--get",
    "--data-urlencode", "format=normal",
    "--data-urlencode", "limit=9",
    "--data-urlencode", `title=${gameTitle}`,
    "--data-urlencode", `api_key=${apiKey}`,
    "https://api.mobygames.com/v1/games"
  ]
  task.standardOutput = stdout
  task.launchAndReturnError(false)

  const dataOut = stdout.fileHandleForReading.readDataToEndOfFileAndReturnError(false)
  const stringOut = $.NSString.alloc.initWithDataEncoding(dataOut, $.NSUTF8StringEncoding).js

  return JSON.parse(stringOut)
}

 

Which should return an object from the upstream JSON which you can then manipulate normally, construct the Script Filter object from there then JSON.strigify it. It does assume some basic knowledge of JavaScript for the next part (that code uses the Objective-C bridge, which you shouldn’t need to use for the rest of the workflow).


That is, naturally, untested. I don‘t have an API key to confirm, and don’t feel too comfortable that the data has to be sent as a string in that key=value format, but I haven’t checked the API to see if there’s an alternate way to do it.

Link to comment
2 hours ago, vitor said:

Also try disconnecting it and connecting it back, or making other interactions in general. It seems that for some reason macOS is not correctly seeing/reporting one or more of the partitions.

Well reseating connections didn't work. updating the OS to 14.5 didn't work, but moving that one volume to a different thunderbolt port did the trick.

Link to comment
48 minutes ago, sepulchra said:

but moving that one volume to a different thunderbolt port did the trick.

 

Huh. Have you tried connecting another disk to that port and seeing what happens?

Link to comment
6 minutes ago, vitor said:

 

Huh. Have you tried connecting another disk to that port and seeing what happens?

still works as intended with another drive in that port.. Well that is weird one. And know as an audio person who troubleshoots hardware, i did each step "one at a time" to chase it. When i finish my deadline today, i'll move that original volume back and see if it recurs. What an odd one!

Link to comment
  • 2 weeks later...

Hey @vitor!

First, thanks for all of the great work you contribute to Alfred and the community. Second, should this workflow mount encrypted disks and trigger the standard password prompts for the disk as you would get if you mounted the disk through Disk Utility or diskutil in the shell? I ask because in my testing, my encrypted external drives are detected by the workflow, but it silently fails to mount them and encryption seems to be the common factor.  The drives work fine with Disk Utility and diskutil commands. 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...