Thursday, February 23, 2006

Mounting Remote File Share

On Linux you can mount remote file share under your file system and then you can access them as they are in your local file system.

File can be shared using different types (NFS, Samba etc.)

Before you mount any remote file share you should complete the following steps.

1) Create a mount point on your local file system.
eg:
#mkdir /mnt/fileshare
2) Find out the remote file share type ( NFS, SMB etc)
3) Remote file share name (Server name and share name)
eg:
Server name: public.valista.com ShareName: public Type:samba

Then you can use the mount command to mount the remote file share.

# mount -t filesystemtype -o options

For more information about mount command
# man mount

Now if you would like to mount public.valista.com/public under /mnt/fileshare

#mount //public.valista.com/public /mnt/fileshare -t smbfs -o defaults,umask=0022

If you want to this mount point permanent edit the file /etc/fstab adding the following line

//public.valista.com/public /mnt/fileshare smbfs defaults,umask=0022 0 0

Now if you type
#ls -l /mnt/fileshare

You can see the shared files on public.valista.com/public file share

******************************************************
If you would like to browse remote samba share on your file browser. Type the command

#nautilus smb://fileserver.valista.com/public

No comments: