Name

mount — stdin  stdout  - file  -- opt  --help  --version

Synopsis

mount [options] partition dir

The mount command, like diskutil, makes a disk partition available and accessible on the Mac. Unlike diskutil, however, mount can work with remote systems such as Windows share drives or NFS. It has the same functionality as the Finder’s “Connect to Server...” feature in the Go menu.

Suppose you have a Windows server, myserver, with a share named Work, and your login name on that server is jones. To mount the share on your Mac in a directory mydir, run:

mkdir mydirmount -t smbfs //jones@myserver/Work mydir
Password: *******

After you enter jones’s password, the Windows share is mounted in mydir, ready for use:

ls mydir
file1.txt  file2.doc  ...emacs mydir/file1.txt                   Edit a remote file

To unmount the Windows share, use the umount command:

umount mydir

If the same filesystem were served by NFS (Network File System) instead of a Windows share, the command would be:

mount -t nfs myserver:/Work mydir

Useful options

-t type

Declare that the mounted device has a particular filesystem type. Some common values are hfs for the Macintosh Hierarchical File System, ufs for UNIX filesystems (the default), smbfs for Microsoft Windows shares, and nfs for Network File System. For a complete list, list the directory /sbin for programs whose names begin with mount_:

ls /sbin/mount_*
/sbin/mount_afp  /sbin/mount_cd9660  ...

Each suffix after mount_ represents a value of -t.

-r

Mount the filesystem read-only. ...

Get Macintosh Terminal Pocket Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.