Find mount point of an USB device in OSX
In order to share a device between a host and a Docker container, I would like to know the path to the mounting point for a given device, a smartcard reader in this case.
Using ioreg -p IOUSB -t, I can see the device (CCID USB Reader) :
However this does not help me to find on which /dev/. this device is mapped to. The mount command does not give details on non-storage devices.
Here is the result of a ls -l command on the /dev/ directory :
There is no new entry. And I am not sure if io8log* file relate to the USB reader. The mount command output also does not change when plugging on unplugging the USB reader.
According to Where is the mount point for the iPod/iPhone in Mac?, OSX does not use mount non-data device with mouting points but connects directly instead. In that case, is there still a way to share this device with a Docker container ?
How can I get the mount path of a USB device on OSX?
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?
8 Answers 8
The following commands show you information about mounted volumes:
- The well-known Unix mount , showing e.g. /dev/disk5s3 mounted at /Volumes/Foo
- diskutil list shows an overview of all disks and volumes
- diskutil info /dev/disk5s3 shows information about that volume, including a Volume 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:
What about this command:
In the column «Mounted on» you get all the Mount Points of all devices mounted on «/Volumes» , which in my case are almost always USB devices 😉
The grep commands basically skip the hard drive which is mounted on «/» .
In the terminal of my OSX Snow Leopard, I use it for quick overview of the Mount Points of my currently connected USB Devices. If you are only interested in Mount Points and not all the other parameters as UUID etc., this would be in my opinion the more straight forward way rather than «diskutil» with all its information.
USB flash drive not mounting on Mac, how to fix it?
Summary: Don’t know how to fix when USB flash drive is not mounting on Mac? Try these 4 solutions in this page and use iBoysoft Data Recovery for Mac to recover lost data necessarily.
When I plugged in my USB flash drive on macOS High Sierra, I can’t see it in Finder or on the Desktop. So, I went to Disk Utility, it was there. But the USB flash drive was grayed out in Disk Utility and I could not mount it. How can I fix/repair USB flash drive not mounting issue on Mac?
It is user-friendly that Mac will automatically mount the inserted USB flash drives. However, if the USB flash drive is not mounted on Mac, you will lose access to the USB flash drive as well as to the data stored on it. But don’t worry, this page talks about the reasons for this issue, and how to fix «USB flash drive not mounting on Mac» without data loss even if external hard drive is not showing up on Mac .
Why the USB flash drive is not mounting on Mac?
What makes the hard drive not working problems like USB flash drive unmounted on Mac can be various. This is because that this external drive is connected to the Mac computer through USB cable, USB port and many other components. The possible reasons for this issue include:
- Faulty connections like broken cable and wobbly USB port
- File system errors, volume header corruptions, etc. in the USB flash drive
- Disk Utility failure, log file corruption, OS malfunction on this Mac
- Physical damage and other factors
How to fix/repair USB flash drive not mounting issue on Mac?
No matter what results in unmountable USB flash drive, it’s urgent to fix/repair USB flash drive not mounting issue on Mac. Here are 4 solutions to this unmounted USB flash drive issue according to different causes, you can check them one by one.
Solution 1: Check the USB flash drive in System Information
If you plug this USB flash drive into your Mac computer but get no sign that this drive is mounting on Mac, you can check System Information to see if this USB flash drive is showing up.
- Step 1: Go to Utilities and choose System Information.
- Step 2: Double-click on its icon to open it and choose USB in the left sidebar.
- Step 3: Check if your USB flash drive is detected by the system in the right box.
If your USB flash drive is not showing up in the right box, you can try to re-plug it, or change another USB port and cable to connect it.
Solution 2: Check the Finder Preferences
Sometimes, you just can’t find the USB flash drive in Finder and on the desktop, but actually, it is mounted on your Mac and just not showing up. Check the Finder Preferences and see if it will appear.
- Step 1: Click Finder and choose Preferences in the top menu bar.
- Step 2: Check External Disks in General tab so that the USB flash drive can be shown on the desktop.
- Step 3: Go to Sidebar and check External disks so that they can be located in Finder.
Solution 3: Check and repair this USB flash drive with Disk Utility
If you still can’t access your USB flash drive thereafter, you can go to Disk Utility which is a built-in utility to fix disk problems. If it is greyed out in Disk Utility, you can manually mount this USB flash drive.
- Step 1: Go > Utilities > Disk Utility.
- Step 2: Click on View option and choose «Show all devices».
- Step 3: Click on the name of your USB flash drive.
- Step 4: Select Mount in the upper menu bar.
If the Mount button is greyed out and you can’t mount this USB flash drive manually, then there could be some disk errors. Fortunately, you can use First Aid in Disk Utility to repair this unmountable USB flash drive.
- Step 1: Launch Disk Utility.
- Step 2: Choose the grayed-out USB flash drive.
- Step 3: Select First Aid in the top center and click Run.
Solution 4: Fix the unmountable USB flash drive by reformatting
However, if Disk Utility fails to repair this external drive because of serious file system corruption, you can only fix this by reformatting. The thing you need to keep in mind is that reformatting will erase all files on this USB flash drive , which means, you need to make sure an existing file backup. Or you can recover lost data from the unmountable USB flash drive before you fix the USB flash drive not mounting issue on Mac by reformatting.
How to recover lost data from unmounted/unrecognizable USB flash drives?
Can’t open the unmountable USB flash drive but don’t want to lose data? You can still get your files back with USB flash drive data recovery software before you reformat this drive.
As one of the most professional USB data recovery software, iBoysoft Data Recovery for Mac is highly recommended. It can recover lost data from unmountable, unreadable, and corrupted USB flash drive, recover deleted/lost files from emptied Mac trash. Moreover, this software performs well in recovering data from hard drives, external hard drives, flash drives, USB sticks, SD cards, and other storage devices. Data recovery is allowed on macOS 10.14/10.13/10.12 and Mac OS X 10.11/10.10/10.9/10.8/10.7.
Step 1: Recover lost data from unmountable USB flash drive with Mac data recovery software
- Step 1: Download and install iBoysoft Data Recovery for Mac on your Mac.
- Step 2: Connect your USB flash drive to the Mac and launch iBoysoft Data Recovery for Mac.
- Step 3: Select the unmountable USB flash drive and click «Next» button to scan all lost files.
- Step 4: Preview the scanning results by double-clicking, choose files that you want to recover, and click «Recover» button to get lost data back.
Note: In case you lose the recovered files again in the next reformatting step, you’d better save these files to another reliable drive.
Step 2: Reformatting this USB flash drive without data loss
After recovering data from this unmountable USB flash drive, you can reformat this USB flash drive without worrying about losing anything important.
- Step 1: Go > Utilities > Disk Utility.
- Step 2: Click the icon of unmountable USB flash drive on the left part of the window.
- Step 3: Click the Erase button on the top of the Disk Utility window.
- Step 4: Complete the related information(name, format, scheme), then click Erase button.
When the process finished successfully, your USB flash drive will be mountable on the Mac computer again. But the case is, no matter how powerful USB flash drive data recovery software is, the best way to recover files from external drives is to recover them from backups. So, remember to duplicate your files this time.
You may also want to know:
HSD not mounting or seen in Disk Utility? Tutorial to fix SD card not mounting on Mac and recover lost data from unmountable SD card on macOS.