I have a backup script that backs up some data to a USB device. The problem I have is that OSX sometimes changes the expected mount path. For example if some file is locked under the expected mount path, OSX mounts it on another path. A USB device named 'BACKUP' can be mounted at /Volumes/BACKUP-1 instead of /Volumes/BACKUP.
Is there a way to finding out the current mount path of a USB device in the OSX Terminal? Something like 'mount_path BACKUP' (command is fake) which would then return '/Volumes/BACKUP-1' or nothing if the device was not mounted?
Best Answer
The following commands show you information about mounted volumes:
mount
, showing e.g./dev/disk5s3
mounted at/Volumes/Foo
diskutil list
shows an overview of all disks and volumesdiskutil info /dev/disk5s3
shows information about that volume, including aVolume UUID
that can be used to uniquely identify that volume.You can query
diskutil info
by using the volume's UUID:Sample command output on my system: