lsof is indeed your best bet. The fastest and easiest way would be this :-
sudo lsof /Volumes/myDrive
It can take a couple minutes to run, but once it's complete, it gives you a list of open files on the disk. The output will look something like this:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mds 89 root 19r DIR 52,3 ...
Have you tried $ diskutil unmount /Volumes/Diskname ?
Or $ diskutil unmount force /Volumes/Diskname ?
As the manpage points out:
Due to the complex and interwoven nature of Mac OS X, umount may fail often. It is recommended that
diskutil(1) (as in, "diskutil unmount /mnt") be used instead.
If your volume has spaces in the name, be sure to ...
The accepted answer only works when the NFS server allows connections on non-reserved ports (i.e. >1024).
The exports man pages say it:
exportfs understands the following export options: secure
This option requires that requests originate on an Internet port less
than IPPORT_RESERVED (1024). This option is on by default. To turn it
off, specify ...
As Apple replied to the ticket referenced in mattdwen's Open Radar link above, as of macOS Sierra 10.12,
you can no longer create items in /Volumes unless root.
Further, my best understanding of the AppleScript mount volume command is that it doesn't have a way to specify the mount point and consequently it only mounts volumes under /Volumes through the ...
Set an entry in /etc/fstab as directed here. To summarize.
Open Disk Utility, unmount the relevant volume.
Click on the volume you're trying to mount, and click the "info" button. Note down the drive's File System UUID, which should look something like 5E85BA88-7C74-34A9-8CE6-267C752CE2BA. I'm just gonna use 123abc as shorthand for it.
Open up /etc/fstab ...
In Finder, press cmd + k and enter the path to the NFS server/share:
For me this mounted as /Volumes/users-1 (but I already had /Volumes/Users mounted).
iMac21:~ user$ df -h /Volumes/users-1
Filesystem Size Used Avail Capacity iused ifree %iused Mounted on
192.168.7.5:/nas/users 5.4Ti 4.8Ti 292Gi 95% 261121 366027775 0% /...
Sometimes symbolic links may not be suitable for your needs.
In that cases you can use bindfs - a FUSE filesystem for mounting a directory to another location.
Install it with homebrew:
brew install bindfs
And then bind one folder to another:
bindfs /Volumes/Data/ContentA ~/ContentA
Let's assume you are mounting/attaching your Data drive as usual which will result in paths like /Volumes/Data/ContentA and /Volumes/Data/ContentB. You can now do either of:
create symbolic links via Terminal running the following commands in a Terminal window:
ln -s /Volumes/Data/ContentA ~/ContentA
ln -s /Volumes/Data/ContentB ~/ContentB
create aliases ...
I just wanna say thanks to @mixel - that is THE WAY to do it, I actually wanted to mount the iCloud Drive as a volume, so that it appears on the desktop.
Installation of bindfs did not go that easy on Sierra, I had to do the following:
brew cask install osxfuse
brew install homebrew/fuse/bindfs
and then in my case I might add that the handy relevant ...
"So my initial question is can I some how mount a drive to a specific folder, Like I would normally do in linux?"
Absolutely. The caveat is that the user who is mounting the volume must be the mount-point owner. You do NOT need to be root or use sudo to mount a disk.
The first thing is to identify your raw device. diskutil list will do that nicely.
You could try the donationware application "What's Keeping me?" that shows what process/application is using the volume/folder/file.
This program is certified by the developer for Mac OS X 10.6 Snow Leopard, but the RoaringApps page for this application lists it as working fine on OS X 10.7 Lion and OS X 10.8 Mountain Lion.
About What's Keeping Me?
This is normal. These programs have been downloaded as virtual disk or .dmg files.
For example Mendeley Desktop is a program supplied as Mendeley-Desktop-1.19.4-OSX-Universal.dmg file. When you open the downloaded file by default you will see it appear on your desktop and as a removable drive in Finder.
Once you have dragged the application to ...
No, it is not possible (to my knowledge, at this time) to boot into one of the other operating systems from a disk image stored on another partition.
What I have done in the past is make a third partition that I use to share files between the two. I make both boot partitions large enough to store the most important things and then a third ...
I've had this message despite being sure there are no open files on the volume. I checked this with Why Not Unmount, a GUI tool that can indicate open files on a disk.
In my case, it was a sign that the file system is corrupt. Running Disk Utility (or if that wasn't enough, DiskWarrior) solved the problem and made the disk ejectable again.
Upgrades and deletions with subsequent recreation of volumes in a multi-volume container leave the container untouched and new (more) "file system UUID" specific folders are created for each volume in the shared "Recovery" volume. Those folders each include a close to 500 MB BaseSystem.dmg
These older folders are not cleared by the system.
To remove the ...
This is basically like if you had mounted a USB disk (or a CD Rom for older people) with the intaller on it. Hence the eject sign on the side. Once you're done installing, you can hit the eject button, that will "unmount" the drive. It should then disappear from where it was (in your case, the desktop).
To remove all entries from the GPT and MBR tables, open the Disk Utility application and do the following.
Select your disk.
Select Partition tab.
Set Partition Layout to "1 Partition".
Set Format to "Free Space".
Click on the Option... button and select "Master Boot Record".
Click Ok to close the pop up window.
Click the Apply button.
The image below ...
Instead of a default/classical Mac volume like your iMac, your MacBook Pro contains a CoreStorage volume.
Booted to Windows, CoreStorage volumes cannot be mounted and consequently the contained files can't be read - until now.
You would need to revert the CoreStorage volume wrapper that contains HFS+ back to a straight HFS+ volume to regain read-only ...
Both the command line solution and What's Keeping Me work great.
To recap, command line in terminal is:
lsof | grep /Volumes/myDrive
The GUI application is What's Keeping Me, available at Hamsoft Engineering.
Screenshots of both with the same search going on.
I prefer the command line just slightly, as it's always there with you. On the other hand, What'...
NOTE: fseventer works until OS X 10.10 Yosemite and the developer's page http://www.fernlightning.com meanwhile got offline. Hence the product links were removed. With brew cask install fseventer it may still be available on elder macOS versions.
There is a GUI alternative to the CLI app lsof:
fseventer is a great file system access monitoring utility for ...
You can find the information in /var/log/system.log (or using the Console application). But the information is not kept forever.
Aug 4 07:34:34 ******** kernel: hfs: mounted External on device disk3
Aug 4 07:34:44 ******** kernel: hfs: mounted Time Machine on device disk5
and and a DMG
Aug 5 07:53:25 ******** kernel: hfs: mounted ...
I had this same problem too, I solved by this step
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *121.3 GB disk0
1: EFI EFI 314.6 MB disk0s1
This site has instructions on how to convert your drive to APFS.
Restart the Mac into Recovery Mode.
Launch Disk utility.
Click-select your named boot volume. (Not the physical drive above it.)
In the Disk Utility Edit menu, select “Convert to APFS
More detailed instructions are given in the link above.
To Disable Automount
Getting the UUID
The first thing you will need is the volume's UUID (universal unique identifier) number, which can be found by opening Disk Utility, selecting the volume of interest, and then pressing Command+I or clicking the blue information button in the Disk Utility toolbar. In the window that appears, locate and copy the UUID, ...
This is described in comments, but it ought to be put into an answer. In MacOS 10.11.6 (and probably later versions), you can use
diskutil mount -mountPoint /dev/disk5s1 ~/mount
Unlike using mount, it's not necessary to specify the filesystem type, at least for hfs type disks (all that I have tried).
I found that I had to sudo to root to do this either ...
You can use a cronJob and an apple Script
unMount a disk with AppleScript :
set mountedDiskName to "AirPort Time Capsule"
set diskIsMounted to false
tell application "System Events" to set diskNames to name of every disk
if mountedDiskName is in diskNames then
set diskIsMounted to true
if diskIsMounted then
// put a sleep or a ...