Hot answers tagged

106

The best solution I've found today (2017) is to use Homebrew and Cask to install osxfuse and sshfs: brew install --cask osxfuse brew install sshfs And then: sshfs username@hostname:/remote/directory/path /local/mount/point -ovolname=NAME It works! :-)


99

Use the open(1) command and a URL: open 'smb://username:password@server/share' Pros: Creates the mount point in /Volumes for you. Cons: Requires the Finder to be running.


91

I'd recommend checking if fsck is holding your disk hostage upon connection. This was it for me. Running ps aux | grep fsck revealed: root 2587 7.3 0.1 4363584 21780 ?? U 10:56PM 2:22.54 /System/Library/Filesystems/exfat.fs/Contents/Resources/./fsck_exfat -y /dev/rdisk2s1 So the solution was a sudo kill -9 2587 (insert your PID ...


37

Most non-App Store software applications are delivered as a DMG file. A DMG file (with the file extension .dmg) is a file whose content looks just like a small disk. The DMG is downloaded to your Downloads folder and is opened (automatically or by double clicking). Since the content looks like a small disk, Finder mounts it as if it were a real disk. You ...


28

For those encountering the same problem: hdiutil attach -imagekey diskimage-class=CRawDiskImage -nomount filename then mount it as you like. Source: https://serverfault.com/questions/174909/mount-block-file-on-osx


27

You want to run diskutil coreStorage unlockVolume <UUID>, where the UUID is the Logical Volume UUID associated with your encrypted disk, /dev/disk3. You can get the lvUUID by running diskutil cs list in the terminal and looking for the output related to /dev/disk3. The identifier is a long string that would look something like this 'B807C2A0-577F-...


27

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 ...


27

If your ExFAT drive is not mounting, here is the solution. sudo pkill -f fsck fsck was holding the disk hostage. A quick ps aux | grep fsck revealed that indeed it was hijacking the disk/volume as soon as it was plugged in. sudo pkill -f fsck (or just kill with the PID if you prefer) immediately allowed the volume to be mounted. Then to make the hard ...


24

You need to use /dev/disk4 in place of just disk 4 in your command. It should read like this diskutil partitionDisk /dev/disk4 1 GPT HFS+ newdisk R


22

I use binchunker to convert .bin/.cue files to a single .iso file on my Mac. You can obtain binchunker via Homebrew or Macports. Here's some more info from the manpage: bchunk - CD image format conversion from bin/cue to iso/cdr SYNOPSIS bchunk [-v] [-p] [-r] [-w] [-s] <image.bin> <image.cue> <basename> DESCRIPTION bchunk ...


18

When using OS X, it's usually more advisable to use diskutil for disk-related activities. TL;DR: To mount a volume/disk by identifier: diskutil mount /dev/diskXsY # mounts just that volume diskutil mountDisk /dev/diskX # mounts the whole disk To mount a volume by UUID: diskutil mount [Volume/Partition UUID] To mount a volume by label: ...


17

Try using mount -u -w: sudo mount -u -w /Volumes/YourDriveName -u modifies the status of an already mounted filesystem. -w mounts a filesystem as read-write.


16

This applescript will close them for you. Paste it into Script Editor and then Save as an application. Then grant access to that application in (System Preferences > Security & Privacy > Accessibility) Then you can use an application like ControlPlane https://www.controlplaneapp.com/ to run the application on wake thus closing them all automatically! ** ...


16

There are access control restrictions on that directory. You can inspect those from the command line: ls -lOe / (That's a capital letter O and not a zero 0) I would suggest mounting your volume to another directory - either /tmp or $TMPDIR rather than messing with the restrictions that are designed to prevent what you have - an actual directory with actual ...


15

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 ...


15

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% /...


15

This is the conventional way for installing software on macOS. The software is provided on an Apple Disk Image (the .dmg file), the purpose of which is to emulate a physical disk (CD, floppy, etc.) and provide compression if needed (like a ZIP archive). This is functionally very similar to an ISO file (used a lot on Windows) but very different in nature (...


14

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


14

From man diskutil: unmount | umount [force] device Unmount a single volume. Force will force-unmount the volume (less kind to any open files; see also umount (8)). unmountDisk | umountDisk [force] device Unmount an entire disk (all volumes). Force will force-unmount the volumes (less kind to any open files; see also umount (8)). ...


14

The following is what I use to mount Samba shares via launchd: /usr/bin/osascript -e "try" -e "mount volume \"smb://guest@${host}\"" -e "end try" Using osascript's mount means any keychain access needed is done "automagically", there's no progress indicator or Finder window, and the command waits for the mount to be available before proceeding (try it with ...


14

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 ...


13

Using AppleScript is convenient because it stores your passwords in the Keychain. Bash function: function mymount { osascript <<EOF mount volume "smb://user@fqdn1/volume1" mount volume "smb://user@fqdn2/volume2" EOF } Invoke ‘mymount’ from bash, enter passwords via the standard Keychain popup, and if all goes well the requested volumes will be ...


13

This is funny because it's actually really really simple. Rename it to a .dmg extension, as a DMG is a raw image too. In contrast to the above solution, this will work on dd rips of entire drives in addition to partitions.


13

The content type of the second partition is wrong. Instead of FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF it has to be 53746F72-6167-11AA-AA11-00306543ECAC. To edit the content type you have to boot to Internet Recovery Mode and use gpt. Additionally the fourth partition will be removed (probably the "deleted" partition). Please check that it doesn't contain any ...


13

Just when I was about to give up, format the drive and lose my data, somehow I was able to fix the drive so I am posting what exactly I did in terminal for the benefit of other people who might come across this post and have the same problem. I hope this will be helpful to somebody: Admins-MacBook-Pro:~ admin$ diskutil mount /dev/disk3 Volume on disk3 ...


12

OS X has a mechanism, called the Disk Arbitration framework, through which programs can control what happens when disks are inserted or ejected. It also provides an opportunity to intercept a disk insertion event and prevent the usual automatic mounting behaviour. To change the behaviour, though, requires a third-party utility, since the Disk Arbitration ...


11

Try with DAEMON Tools Lite for Mac, you can download here: http://www.daemon-tools.cc/products/dtMacLite This software has figured out how to trick the computer to thinking a DVD is mounted and I don't know if you can re-implement it via the command line tool vndevice you mentioned.


11

Get the device number of the RAM disk: diskutil list (e.g. disk3) Add some content to the RAM disk 😉. Unmount the volume: diskutil umount disk3 Mount the RAM disk read-only: diskutil mount readOnly /dev/disk3. Apply the disk number according to your environment! unmount/mount works for an HFS+ disk (in case of a RAM disk)/volume or an APFS volume only ...


10

I have spent quite a bit of time figuring out automounts of NFS shares in OS X... Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible: /etc/auto_master (see last line): # # Automounter master map # +auto_master # Use directory service /net -hosts -nobrowse,hidefromfinder,nosuid /home ...


10

According to Topher Kessler article on CNET, you can add an entry to /etc/fstab, specifying the noauto option. Such an entry might look like this: UUID=791E37B4-82A3-37E7-9F15-3C39359126B4 none hfs rw,noauto The UUID may be obtained by looking for the Volume UUID line that is printed when you run diskutil info /Volumes/volume name.


Only top voted, non community-wiki answers of a minimum length are eligible