Mount NFS/SMB Shares in Terminal so they appear on Desktop

Joined
May 11, 2007
Messages
5
Reaction score
0
Points
1
How do I mount NFS/SMB Shares in Terminal using the command line in Mac OS 10.3 so the mount appears on the desktop?

I tried the following, but I get an error that the that the directory does not exist.

sudo mount nfsserver:/exported/path /private/mnt

I tried creating the /private/mnt dir, I can access the content when I mount in the /private/mnt dir, but it does not show up on the desktop. Please show me what to do to get this to work. I do not want to use the finder to connect to the nfs share.

Let me know where to edit so the mount will automatically appear on boot. Thanks
 
Joined
Oct 27, 2005
Messages
4,702
Reaction score
404
Points
83
How do I mount NFS/SMB Shares in Terminal using the command line in Mac OS 10.3 so the mount appears on the desktop?

I tried the following, but I get an error that the that the directory does not exist.

sudo mount nfsserver:/exported/path /private/mnt

I tried creating the /private/mnt dir, I can access the content when I mount in the /private/mnt dir, but it does not show up on the desktop. Please show me what to do to get this to work. I do not want to use the finder to connect to the nfs share.

Let me know where to edit so the mount will automatically appear on boot. Thanks

Is this what you're referring too?

Automatically mount SMB shares on login

To mount a SMB share with the Finder, the classical technique is to go to the Network directory, then to WORKGROUP, then to MACHINE, and then to choose a SHARE. But I want this to be done automatically when I log in. My technique is to run a shell script at login. Using 10.3.0 to 10.3.2, you can simulate the behaviour of the Finder by using this shell command:
cd /Network/WORKGROUP/MACHINE/SHARE

This comment is worth noting:

Dunno why people are always coming up with new ways to automount smb at startup. It doens't really get any more simple than mounting your smb once, then dragging the icon AT THE TOP OF THE MOUNTED DRIVES WINDOW into the Login Items PrefPane. It seems to require the icon at the top of the mounted drives icon as opposed to the icon off the desktop, etc. Seems like the only way that you can actually capture the login info so you don't have to enter it each time is using that icon.

Having read the 2nd half of the above, I must add that I just dragged the Mounted Share icon from my desktop and it worked fine.
 
OP
I
Joined
May 11, 2007
Messages
5
Reaction score
0
Points
1
I want to mount an nfs share in the terminal so the mounted share appears on the Desktop.
 
Joined
Oct 27, 2005
Messages
4,702
Reaction score
404
Points
83
I want to mount an nfs share in the terminal so the mounted share appears on the Desktop.

Automount NFS on MacOS X

NFS from Mac OS X

To mount from the terminal:

Use this command:

sudo mount -o -P nfsserver:/exported/path /private/mnt

Make sure you use the –P option because NFS communicates through a privileged port, and the Mac default is to try a non-privileged port.

That command should mount your drive on your desktop, or you can access it through the terminal: cd /private/mnt


Mac OS X as an NFS Client
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top