You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Script to open PRO - Data volume of disk partition in Catalina

How would I compose a script that would mount the PRO - Data drive from Disk utility on the desktop?


If I have on a usb partitioned external drive, the disk utility looks like this:


INTERNAL

APPLE SSD

Container disk1

Macintosh HD

Macintosh HD - Data



EXTERNAL

Mercury Elite Drive

partition a

partition b

partition c

partition d

partition e

Container disk 3

PRO

PRO - Data


Thanks

Mac Pro

Posted on Oct 13, 2019 1:57 AM

Reply
Question marked as Top-ranking reply

Posted on Oct 19, 2019 11:12 PM

Conceptually, nothing looks wrong with your commands, although you appear to be mounting different drives than discussed in your original post (PRO FULL and PRO FULL - DATA are both on disk3).


I'm also a little confused by the fact that the container for disk3 is disk2s10, but you have another volume on disk2 that is a standard HFS volume. I guess, technically, there's nothing against doing that, but it's not typical in my experience.


That said, what happens when you do run your commands? does either volume mount? neither? any error messages?

Similar questions

14 replies
Question marked as Top-ranking reply

Oct 19, 2019 11:12 PM in response to mrokloricred37

Conceptually, nothing looks wrong with your commands, although you appear to be mounting different drives than discussed in your original post (PRO FULL and PRO FULL - DATA are both on disk3).


I'm also a little confused by the fact that the container for disk3 is disk2s10, but you have another volume on disk2 that is a standard HFS volume. I guess, technically, there's nothing against doing that, but it's not typical in my experience.


That said, what happens when you do run your commands? does either volume mount? neither? any error messages?

Oct 14, 2019 12:22 PM in response to mrokloricred37

If you know the device ID you can use the command line utility diskutil to mount the drive.

Device IDs are typically in the form of /diskxsy where x is the disk index and y is the partition number.


You can use diskutil list to get a list of attached devices along with their device IDs:


diskutil list | awk '/Pro - Data/ {print $NF}'


which you can then pass to diskutil mount via xargs:


diskutil list | awk '/Pro - Data/ {print $NF}' | xargs diskutil mount


You can run this command in the Terminal/shell, or via AppleScript's do shell script command.

Oct 14, 2019 10:00 PM in response to Camelot

I hope you will forgive my remedial knowledge of this.

If a given mac and its drives stay constant, doesn't the device id stay the same? Could I get this info off of disk utility i.e. disk3s5 which would be PRO-FULL ?


I understand that I need to learn much more, but with this info what would the AppleScript be? I also understand if this is asking a bit much, and may not be a request that one might not want to answer, but rather have the questioner learn more!

Thanks, hope you understand.


Oct 15, 2019 10:28 AM in response to mrokloricred37

Device IDs are not considered persistent. This is true across Mac OS versions, and especially true for external drives.


For example, in the current OS version, disk0 is the internal physical drive but it holds a container ('virtual drive') that is your (possibly-encrypted, possibly RAIDed) OS volume that is mounted as disk1. Older OS versions would have just mounted disk0, so your boot drive could be disk0 or disk1 depending on the OS version.


More importantly, with external drives, they are labelled in the order they are mounted. Since you explicitly indicated this is an external drive, it could be disk2 today (the first externally-attached drive), or it could be disk3 or disk4 if other drives have been attached. The likelihood of this depends entirely on your environment - if you never attach/detach other drives, USB keys, network mounts, etc. then your device IDs are likely to be more consistent. However, since it's not guaranteed, I'd recommend going with the above approach that dynamically identifies the device ID.

Oct 18, 2019 4:47 PM in response to Camelot

Unfortunately, I have tried to get this to work unsuccessfully. The name of the disk in question is in Container 3 (disc3) and its name is PRO FULL. It is paired with PRO FULL - DATA (disk3s1) (the new Catalina format as I am sure you are aware). When you say if you know the device ID: if I do a get info on the PRO FULL am I looking for the UUID? The disk PRO FULL is disk3s2 FWIW. I "simply :((((" want to mount and in separate Applescipt UNMOUNT the PRO FULL external. Honestly, with my remedial knowledge, I have gotten nowhere with this. Could I ask for more remedial help?

Thanks much

Oct 18, 2019 10:53 PM in response to mrokloricred37

Just post the output of diskutil list and it should be pretty clear.


Both volumes will be associated with disk3, but they will have different slice (partition) numbers - e.g. disk3s1 and disk3s2


Note that these are only needed to mount individual partitions on the drive. If you want to mount all partitions you can just diskutil mountdisk disk3, and if you want to unmount a volume, use the Finder (tell application "Finder" to eject disk "PRO FULL")

Script to open PRO - Data volume of disk partition in Catalina

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.