Willjwade mentioned this Mac OS X (or is it really Darwin?) utility called disktool. With disktool, without sudo, you can list recognized disks, mount disks, and unmount attached disks/partitions with it. Unfortunately there is no man page (in 10.2.8) but if you type disktool with no parameters it. Feb 19, 2018 11) Quit Terminal. Now, the next time you restart, or unplug the drive in the case of an external drive, that volume will not be mounted. All you have to do is launch Disk Utility, select the grey, disabled volume, and click the Mount button. You should be.
Mounting Drive From Terminal Mac Os X
Being a unix-like system, OS X includes the SSH remote login service that can be used to administer a system from the command line. Such remote access is convenient to have, as it will allow you to change settings, manage files and folders, and otherwise use your system without needing to be right in front of it. It also communicates over an encrypted connection so you can be sure communications with your system are secured.
In addition to allowing you to log into your system and controlling it through the Terminal, the SSH protocol allows for transfer of files to and from the remote system through the SFTP (secured FTP) protocol. This is generally done with a dedicated FTP client like Cyberduck that supports the SFTP protocol, but you can also use a technology called “File System in Userspace” or FUSE, to manage this connection as a locally-mounted storage volume.
In general, to host a storage format as a mounted drive, OS X will need to have support for it coded in the OS X kernel. This is the case with Apple’s HFS+ format, and FAT32, as well as NTFS which Apple supports in read-only mode; however, FUSE provides a behind-the-scenes interface that routes a number of storage programmable routines to the system for access as a drive-like storage medium. For instance, if you have several cloud-based storage accounts, you can write a small program (called a FUSE client or plug-in) that will interface all of these services with FUSE, and have them mount as a single volume on the system in a similar way as if you had plugged in a USB drive.
Mount A Drive Mac Terminal
While many of the implementations of FUSE (such as combining cloud-based storage for access as a local drive) are experimental and fun, there are some exceptionally useful and well-tested uses that can be beneficial. With regards to the SSH and SFTP connection, one of the more practical uses of FUSE is to handle the SFTP connection so files on a remote system can be directly accessed in the Finder or by other programs.
Mount Drive From Terminal Mac
- Download and install FUSE, followed by installing SSHFS, both of which can be obtained from the OS X FUSE site
- Create a folder on your Mac that you want to use as the mount point (I recommend a folder called “mount” directly within your home directory)
- Open the Terminal and run a command similar to the following to mount a remote folder at the new folder you would like to use as the mount point:
As you can imagine, this might be cumbersome to always do, so if you find yourself using this approach for securely accessing your remote files, then you can use the tool called “Macfusion” to store common server settings and mount them without needing to type in the command manually.
When mounted, the FUSE drive will show instead of your mount folder, and clicking it will reveal the files and folders at the remote path that you specified.
When done, you will be able to open the mounted drive on your Mac and access the files on the remote server directly. When finished, you can right-click and eject the drive as you would with any mounted volume. Finally, this approach does circumvent OS X’s default handling of drives and networked volumes, so you will not see the drive appear in your Finder sidebar and will instead have to locate it manually in your home folder or at the top-level of the filesystem.
Lastly, keep in mind that this technology has its limits. Being managed in Userspace means you have to be logged in for it to work, and then the drive will only be accessible to the account that is managing it. In addition, you might encounter limited performance and perhaps stability issues with some FUSE plugins that have not been fully tested, but overall with SSHFS and other popular options you should have a robust way to access your files.