Hot answers tagged

77

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


62

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.


45

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


26

All volumes, including DMGs, are mounted in /Volumes. You can get a list of mounted volumes by typing ls /Volumes in Terminal. You can navigate to a Disk Image using cd /Volumes/nameOfImage.


24

The hdiutil command-line utility gives you more flexibility, and is extensively documented in man hdiutil. Something like this should do: hdiutil attach -mountpoint ~/myMountPoint mySparsebundle.dmg


21

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


20

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


19

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


16

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


16

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


14

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.


13

Much better to do this: sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.UserNotificationCenter.plist Which will just stop the UserNotificationCenter service from running, leaving your system files intact! beware: as noted in the comments, this will disable all system notifications, including those when programs request access to system ...


13

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


13

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


12

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


12

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


11

The likely most robust solution is to create a launchd job with the StartOnMount property set to -boolean YES: StartOnMount <boolean> This optional key causes the job to be started every time a filesystem is mounted. This is how Time Machine does it (see /System/Library/LaunchDaemons/com.apple.backupd-attach.plist).


11

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


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

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


10

There is an update from Apple. When connecting to a server that requires a user name and password, macOS Sierra 10.12 or later asks you to click Connect, even when the name and password have been saved in your keychain. This helps you to avoid transmitting login credentials to a server you didn't intend to connect to. If you want to disable this ...


9

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


9

You can use hdiutil to mount a disk image that is protected with a passphrase. hdiutil attach -agentpass /path/to/image.dmg That should attempt to mount the disk image, prompting you for the passphrase. If it's encrypted with a public key, you can pass that using option -pubkey.


9

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.


9

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


9

In Terminal type, man mount and press enter. It says: The system maintains a list of currently mounted file systems. If no arguments are given to mount, this list is printed. So, in Terminal type, mount and press enter.


8

You should be able to use Disk Arbitrator to do most of what you want. Certainly requirement 1 is met and you should be able to achieve most of 2 with it too.


8

Instead of installing ext4fuse yourself, try using homebrew to install it. (This is the method recommended by the developer.) Read the developer's install page here. Incidentally, if you're from Linux you're probably used to using apt-get to install things. Homebrew describes itself as "The missing package manager for OS X", and makes it a lot easier to ...


8

There is another option - bindfs. It requires you to install FUSE but provides an alternative to using NFS. You may need to compile from source but I see it's available in MacPorts too.


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