• No se han encontrado resultados

Using NFS to Share RHEL 6 Folders with Remote Linux and UNIX Systems

N/A
N/A
Protected

Academic year: 2018

Share "Using NFS to Share RHEL 6 Folders with Remote Linux and UNIX Systems"

Copied!
5
0
0

Texto completo

(1)

Using NFS to Share RHEL 6 Folders with Remote

Linux and UNIX Systems

From Techotopia

Red Hat Enterprise Linux 6 provides two mechanisms for sharing files and with other systems on a network. One approach is to use technology called Samba. Samba is based on Microsoft Windows Folder Sharing and allows RHEL 6 systems to make folders accessible to , and also to access folder shares from RHEL 6. This approach can also be used to between other Linux and UNIX based systems as long as they too have Samba support installed and configured. This is by far the most popular approach to sharing folders in heterogeneous

. The topic of folder sharing using Samba is covered in Sharing Files between RHEL 6 and Windows Systems with Samba.

Another option, which is targeted specifically at sharing folders between Linux and UNIX based systems, uses technology called Network (NFS). NFS allows the file system on one Linux computer to be accessed over a network connection by another Linux or UNIX system. NFS was originally developed by Sun Microsystems in the 1980s and remains the standard mechanism for sharing of remote Linux/UNIX file systems to this day.

NFS is very different to the Windows SMB technology used by Samba. In this chapter we will be looking at network based sharing of folders between RHEL 6 and other UNIX/Linux based systems using NFS.

Ads by Google NFS NFS the Run Linux Systems NFS World

0

Previous Table of Contents Next

Displaying RHEL 6 Applications Remotely (X11 Forwarding)

Sharing Files between RHEL 6 and

with Samba

Purchase and download the full PDF and ePub versions of this RHEL 6 eBook for only $9.99

PDF/ePub edition contains 40 chapters and over 250 pages.

Windows Systems

folders

Windows systems Windows based

share folders

network environments

File System

resource sharing

(2)

Ensuring NFS Services are running on RHEL 6

The first task is to verify that the NFS services are installed and running on your RHEL 6 system. This can be achieved either from the command line, or using the graphical services tool.

Begin by confirming that the NFS service is installed by running the following command from a terminal window:

If the rpm command reports that the package is not yet installed, it may be installed using the yum command:

To verify that the NFS services are running from the command-line, run the following command from a terminal window:

If the services are running you will see output similar to the following:

If the service is not running, invoke it using the following command:

Configuring the RHEL 6 Firewall to Allow NFS Traffic

Contents

1 Ensuring NFS Services are running on RHEL 6 2 Configuring the RHEL 6 Firewall to Allow NFS

Traffic

3 Specifying the Folders to be Shared 4 Accessing Shared RHEL 6 Folders

5 Mounting an NFS Filesystem on RHEL System

Startup

6 Unmounting an NFS Mount Point

rpm –q nfs-utils

su –

yum install nfs-utils

su -

/sbin/service nfs status

rpc.mountd (pid 3617) is running...

nfsd (pid 3614 3613 3612 3611 3610 3609 3608 3607) is running... rpc.rquotad (pid 3601) is running...

(3)

Next, the firewall needs to be configured to allow NFS traffic. To achieve this, run the Firewall Configuration tool by selecting the System -> Administration -> Firewall menu option. If the firewall is enabled, make sure that the check box next to NFS4 is set and then click on Apply and OK.

Specifying the Folders to be Shared

Now that NFS is running and the firewall has been configured, we need to specify which parts of the RHEL 6 file system may be accessed by remote Linux or UNIX systems. Whilst previous versions of RHEL included a graphical tool called system-config-nfs, unfortunately this tool has been removed in RHEL 6. The good news is that this task can still be easily achieved by manually editing the appropriate configuration file.

The file that needs to be edited is /etc/exports, which will need to be created and modified to export directories for access by remote systems via NFS. The syntax for an export line in this file is as follows:

In the above line, <export> is replaced by the directory to be exported, <host1> is the name or IP address of the system to which access is being granted and <options> represents the restrictions that are to be imposed on that access (read only, read write etc). Multiple host and options entries may be placed on the same line if required. For example, the following line grants read only permission to /datafiles to a host with the IP address of 192.168.2.38:

The use of wildcards in permitted in order to apply an export to multiple hosts. For example, the following line permits read write access to /home/demo to all external hosts:

A full list of options supported by the exports file may be found by reading the exports man page:

For the purposes of this chapter, we will configure the /etc/exports file as follows:

Once configured, the directories must first be exported using the exportfs command:

It is also possible to view the current share settings from the command-line using the exportfs tool:

The above command will generate the following output: <export> <host1>(<options>) <host2>(<options>)...

/datafiles 192.168.2.38(ro)

/home/demo *(rw)

man exports

/tmp *(rw,sync)

/vol1 192.168.2.21(ro,sync)

/usr/sbin/exportfs -a

(4)

Accessing Shared RHEL 6 Folders

The may be accessed from a remote system either by mounting them manually from the command-line, or browsing to them using the Nautilus . Keep in mind that it may also be necessary to configure the firewall on the remote system to allow NFS traffic.

To mount a remote folder from the command line, open a terminal window and create folder where you would like the remote folder to be mounted:

Next enter the command to mount to the remote folder (in this example we use rhel6 as the remote hostname and /tmp as the remote path - modify these to match your environment):

The remote /tmp folder will then be mounted on the local system. Once mounted, the /home/demo/demo-folder will contain the remote folder and all its contents.

Mounting an NFS Filesystem on RHEL System Startup

It is also possible to configure a RHEL system to automatically mount a remote file system each time the system starts up. This is achieved by editing the /etc/fstab file. To do this load the /etc/fstab file into your favorite editor as super user:

When loaded, it will likely look something like the following:

To mount, for example, a folder with the path /tmp which resides on a system with the IP address 192.168.2.21 in the local folder with the path /nfsmount (note that this folder must already exist) add the following line to the fstab file:

Next time the system reboots the /tmp folder located on the remote RHEL system will be mounted on the local /nfsmount mount point. All the files in the remote folder can then be accessed as if they reside on the local hard disk drive.

Unmounting an NFS Mount Point

/vol1 192.168.2.21

/tmp <world>

mkdir /home/demo/demo-folder

su -

mount rhel6:/tmp /home/demo/demo-folder

su -

gedit /etc/fstab

/dev/mapper/vg_rhel6-lv_root / ext4 defaults 1 1 UUID=4a9886f5-9545-406a-a694-04a60b24df84 /boot ext4 defaults 1 2 /dev/mapper/vg_rhel6-lv_swap swap swap defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0

192.168.2.21:/tmp /nfsmount nfs shared folders

(5)

This page was last modified 21:05, 15 December 2010.

Copyright 2011 Techotopia.com. All Rights Reserved.

Once a remote file system is mounted using NFS it can be unmounted using the unmount command with the local mount point as the command-line argument. For example, to unmount our example filesystem mount point requires the use of the following command:

Retrieved from

"http://www.techotopia.com/index.php/Using_NFS_to_Share_RHEL_6_Folders_with_Remote_Linux_and_UNIX_Systems" su -

umount /nfsmount

eBookFrenzy.com

Purchase and download the full PDF and ePub versions of this RHEL 6 eBook for only $9.99

PDF/ePub edition contains 40 chapters and over 250 pages.

Previous Table of Contents Next

Displaying RHEL 6 Applications Remotely (X11 Forwarding)

Sharing Files between RHEL 6 and Windows Systems with Samba

Special

Airfare

Deals

Route From Route From

Delhi - Mumbai Rs.3,790 Delhi - Hyderabad Rs.4,156

Mumbai - Kolkata Rs.4,334 Mumbai -Chennai Rs.3,790

Delhi - Bangalore Rs.4,471 Chennai - Delhi Rs.4,284

Referencias

Documento similar

This is due to the will of the micro-retailers to remain small and the fact of not having enough resources to deal with this type of structure and (6)

Correlated mutation is also another method based on sequence and evolution (61). c) Protein structure: Similarly to protein sequence, structure can be used to

It is interesting to highlight in both systems (global features-based and time functions-based systems) the case when the systems are trained and tested with DS3 and DS2 devices (DS3

In 2015, my group developed the asymmetric synthesis of cyclopropanes with a quaternary center, using a one pot reaction resulting in excellent enantioselectivities

Also, using previous results on radical extensions, we are able to characterise cubic fields which are radical extensions and show by an example that this result can not be extended

By using this filter, we considered the multiple parameters involved and avoid the simplification we will submit the sample to, if we had exclusively applied some of the

(1991) “Remote sensing and geographical information systems as applied to mountain hazard analysis and environmental

The prevalent approach is to combine the scores provided by the different biometric systems using a user-independent fusion function (also referred to as global approaches