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 ...
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% /...
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 ...
Open Terminal.app and run df -h /:
% df -h /
Filesystem Size Used Avail Capacity Mounted on
/dev/disk1s2 111Gi 75Gi 36Gi 68% /
On my machine my OS drive is on /dev/disk1s2. With this information you can use the Disk Utility app and find out what physical drive your OS is on:
Using diskutil from command line you're OS drive will be ...
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
"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.
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 ...
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?
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 ...
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 ...
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 ...
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 ...
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 ...
It's not absolutely required, but I'd say it's strongly recommended. The type of volume corruption it reported isn't as serious as most other types, but my recommendation is the same: don't mess around, fix it now.
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 ...
Usually NTFS volumes don't contain UUIDs. The visible UUID in diskutil is derived from the NTFS Volume Serial Number.
Get the disk identifier of your backup disk and the volume:
Unmount the external disk:
diskutil umountDisk /dev/disk1
Copy the NTFS superblock:
sudo dd if=/dev/disk1s4 of=~/Desktop/superblock bs=512 count=1
Change the mod ...
You can simply change UUID by partition format/erase.
1) Format disk to Mac OS Extended using built-in Disk Utility
2) If you need windows partition, format disk to exFAT after you have done first step (for some reason you need two steps for windows partition)
You can check if UUID changed by listing all UUID numbers:
find /Volumes -maxdepth 1 -mindepth ...