Hot answers tagged

104

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! :-)


90

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.


79

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

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


25

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


25

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


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

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


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

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


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

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


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

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


13

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


12

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.


11

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


11

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


11

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


10

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


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

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


10

As mentioned by another user on StackOverflow, you can use an NFS mount do to this. However, it requires a little bit of one-time setup. First, you'll need to set up an /etc/exports file (if you haven't done so already). $ sudo tee -a /etc/exports <<< "/ -alldirs -mapall=$USER localhost" Secondly, you'll need to start the rpc and nfsd services. $...


10

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.


10

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.


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


10

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


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