Thursday, February 12, 2009

file server in linux

1.1) FILE SYSTEM:
A file system is usually a structure of files and directories that exists on a single device (such as a hard disk partition or CD-ROM). A Linux file system refers to the entire directory structure (which may include file systems from several disks or NFS resources), beginning from root (/) on a single computer. A shared directory in NFS may represent all or part of a computer’s file system, which can be attached (from the shared directory down the directory tree) to another computer’s file system.
1.2) CENTRALIZED SHARING:
Most networked computers are on the network in the first place so that users can share information. Some users need to collectively edit documents for a project, share access to spreadsheets and forms used in the daily operation of a company, or perform any number of similar file-sharing activities. It also can be efficient for groups of people on a computer network to share common applications and directories of information needed to do their jobs. By far the best way to accomplish the centralized sharing of data is through a file server.
A centralized file server can be backed up, preserving all stored data in one fell swoop. It can focus on the tasks of getting files to end users, rather than running userapplications that can use client resources. And a centralized file server can be used to control access to information — security settings can dictate who can access what.
Linux systems include support for each of the most common file server protocols in use today. Among the most common file server types in use today are the Network File System (NFS), which has always been the file-sharing protocol of choice for Linux and other UNIX systems, and Samba (SMB protocol), which is often used by networks with many Windows and OS/2 computers
2) NFS FILE SERVER
Instead of representing storage devices as drive letters (A, B, C, and so on), as they are in Microsoft operating systems, Linux systems connect file systems from multiple hard disks, floppy disks, CD-ROMs, and other local devices invisibly to form a single Linux file system. The Network File System (NFS) facility enables you to extend your Linux file system in the same way, to connect file systems on other computers to your local directory structure.
An NFS file server provides an easy way to share large amounts of data among the users and computers in an organization. An administrator of a Linux system that is configured to share its file
2.1) STEPS TO SET UP NFS
Systems using NFS has to perform the following tasks to set up NFS:
1. Set up the network. If a LAN or other network link is already connecting the computers on which you want to use NFS, you already have the network you need.
2. Choose what to share on the server. Decide which file systems on your Linux NFS server to make available to other computers. You can choose any point in the file system and make all files and directories below that point accessible to other computers.
3. Set up security on the server. You can use several different security features to suit the level of security with which you are comfortable. Mount-level security lets you restrict the computers that can mount a resource and, for those allowed to mount it, lets you specify whether it can be mounted read/write or read-only. With user-level security, you map users from the client systems to users on the NFS server so that they can rely on standard Linux read/write/execute permissions, file ownership, and group permissions to access and protect files. Linux systems that support Security Enhanced Linux (SELinux), such as Fedora and Red Hat Enterprise Linux, offer another means of offering or restricting shared NFS files and directories.
4. Mount the file system on the client. Each client computer that is allowed access to the server’s NFSshared file system can mount it anywhere the client chooses. For example, you may mountfile system from a computer called maple on the /mnt/maple directory in your local file system. After it is mounted, you can view the contents of that directory by typing ls /mnt/maple. Then you can use the cd command below the /mnt/maple mount point to see the files and directories it contains.
2.3) Getting started NFS:
While nearly every Linux system supports NFS client and server features, NFS is not always installed by default. You’ll need different packages for different Linux systems to install NFS. Here are some examples:
· Fedora Core and other Red Hat Linux systems:
You need to install the nfs-utils package to use Fedora as an NFS server. There is also a graphical NFS Configuration tool that requires you to install the system-config-nfs package. NFS client features are in the base operating system. To turn on the nfs service, type the following:
# service nfs start
# chkconfig nfs on

· Debian:

To act as an NFS client, the nfs-common and portmap packages are required;
for an NFS server, the nfs-kernel-server package must be added. The following apt-get command line (if you are connected to the Internet) installs them all. Then, after you add an exported file system to the /etc/exports file (as described later), you can start the nfs-common and nfs-kernel-server scripts, as shown here:
# apt-get install nfs-common portmap nfs-kernel-server
# /etc/init.d/nfs-kernel-server start
# /etc/init.d/nfs-common start
· Gentoo
With Gentoo, NFS file system and NFS server support must be configured into the kernel to use NFS server features. Installing the nfs-utils package (emergenfs-utils) should get the required packages. To start the service, run rc-updateand start the service immediately:

# emerge nfs-utils
# rc-update add portmap default
# rc-update add nfs default
# /etc/init.d/nfs start
The commands (mount, exportfs, and so on) and files (/etc/exports, /etc/fstab, and so on) or actually configuring NFS are the same on every Linux system I’ve encountered.

No comments:

Post a Comment