Distributed File Systems Objectives –to understand Unix network file sharing Contents –Installing NFS –How To Get NFS Started –The /etc/exports File –Activating.

Slides:



Advertisements
Similar presentations
Basic Unix system administration
Advertisements

Distributed Storage March 12, Distributed Storage What is Distributed Storage?  Simple answer: Storage that can be shared throughout a network.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts Amherst Operating Systems CMPSCI 377 Lecture.
Chapter 10: File-System Interface
Linux+ Guide to Linux Certification, Second Edition Chapter 14 Network Configuration.
Chapter 10: File-System Interface
NFS. The Sun Network File System (NFS) An implementation and a specification of a software system for accessing remote files across LANs. The implementation.
Network File Sharing Chapter 18. Chapter Goals Understand concepts of network file sharing Understand NFS server setup Understand NFS client setup Understand.
NETWORK FILE SYSTEM (NFS) By Ameeta.Jakate. NFS NFS was introduced in 1985 as a means of providing transparent access to remote file systems. NFS Architecture.
Network File System (NFS) in AIX System COSC513 Operation Systems Instructor: Prof. Anvari Yuan Ma SID:
NFS – Network File System WeeSan Lee
Network File System Joe Paulowskey Joe Paulowskey Susan Mulholland Joe Woulfe.
Network File System CIS 238. NFS (Network File System) The most commercially successful and widely available remote file system protocol Designed and.
Joshua Caltagirone-Holzli
1 Network File System. 2 Network Services A Linux system starts some services at boot time and allow other services to be started up when necessary. These.
Remote Disk Access with NFS
NFS Server Setup NFS SERVER SETUP. Network File Service NFS Server Setup Allows to share Directories between UNIX Systems Daemons: netfs, nfs, nfslock.
Chapter 11: Creating and Managing Shared Folders BAI617.
Linux Installation and Administration – Lesson 5 Tutor: George Papamarkos Topic: Devices in Linux.
Networked File System CS Introduction to Operating Systems.
1 Network File Sharing. 2 Module - Network File Sharing ♦ Overview This module focuses on configuring Network File System (NFS) for servers and clients.
1 COP 4343 Unix System Administration Unit 15: file server – ftp – nfs.
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
Unix Basics Chapter 4.
CSC 322 Operating Systems Concepts Lecture - 4: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
New SA Training Topic 8: File System Access  Our organization uses a variety of services for accessing files on remote systems  WWW  FTP  CIFS/SMB.
Linux+ Guide to Linux Certification, Second Edition Chapter 14 Network Configuration.
Distributed File Systems Objectives –to understand Unix network file sharing Contents –Installing NFS –How To Get NFS Started –The /etc/exports File –Activating.
Linux Services Muhammad Amer. 2 xinetd Programs  In computer networking, xinetd, the eXtended InterNET Daemon, is an open-source super-server daemon.
Chapter Two Exploring the UNIX File System and File Security.
CIT 470: Advanced Network and System Administration
What is a Distributed File System?? Allows transparent access to remote files over a network. Examples: Network File System (NFS) by Sun Microsystems.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 Chapter 10: File-System.
Centralized logins with NIS Eric Stolten Tim Meade Mark Sidnam.
10.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles 10.4 File System Mounting A file system must be mounted before it can be accessed.
Sys Admin Course NFS and SAMBA Fourie Joubert. Sys Admin Course NFS NFS is the Network File System It allows Linux systems to share a file system, or.
NFS : Network File System SMU CSE8343 Prof. Khalil September 27, 2003 Group 1 Group members: Payal Patel, Malka Samata, Wael Faheem, Hazem Morsy, Poramate.
Manage Directories and Files in Linux. 2 Objectives Understand the Filesystem Hierarchy Standard (FHS) Identify File Types in the Linux System Change.
Chapter Two Exploring the UNIX File System and File Security.
Chapter 3 & 6 Root Status and users File Ownership Every file has a owner and group –These give read,write, and execute priv’s to the owner, group, and.
1 Linux Networking and Security Chapter 5. 2 Configuring File Sharing Services Configure an FTP server for anonymous or regular users Set up NFS file.
Network File System Campus-Booster ID : **XXXXX Copyright © SUPINFO. All rights reserved NFS.
NFS Network File System. NFS (Network File System) Network file systems allow us to share files between users on different systems, often with different.
Sun Network File System Presentation 3 Group A4 Sean Hudson, Syeda Taib, Manasi Kapadia.
GLOBAL EDGE SOFTWERE LTD1 R EMOTE F ILE S HARING - Ardhanareesh Aradhyamath.
Filesystem Management and Backups. 2 Section Overview Devices and Files Filesystem Management Network Filesystems Backups.
Linux Operations and Administration
ITEC 502 컴퓨터 시스템 및 실습 Chapter 10-2: File Systems Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.

CSC414 “Introduction to UNIX/ Linux” Lecture 6. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
Distributed File Systems Group A5 Amit Sharma Dhaval Sanghvi Ali Abbas.
Introduction to AFS IMSA Intersession 2003 An Overview of AFS Brian Sebby, IMSA ’96 Copyright 2003 by Brian Sebby, Copies of these slides.
Network File System Peter DSouza. NFS  Allows machines to mount a disk partition on a remote machine as if it were a local drive  Other systems similar.
Basic UNIX system administration CS 2204 Class meeting 14 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
ORAFACT The Linux File System. ORAFACT Filesystem Support Support for dozens of filesystem types including: Minix, ext2, MS-DOS, UMSDOS, VFAT, NTFS, NFS,
DFS Design and Implementation Yang Wang. Review Characteristics of a DFS: a. Dispersed clients b. Dispersed files c. Multiplicity of Users d. Multiplicity.
CIT 470: Advanced Network and System Administration
Distributed File Systems
CIT 470: Advanced Network and System Administration
Automount NFS.
Exploring the UNIX File System and File Security
IS3440 Linux Security Unit 4 Securing the Linux Filesystem
NFS.
Automount NFS.
CIT 470: Advanced Network and System Administration
The Network File System
Chapter 15: File System Internals
Created By : Asst. Prof. Ashish Shah, J. M
The Network File System
Network File System (NFS)
Presentation transcript:

Distributed File Systems Objectives –to understand Unix network file sharing Contents –Installing NFS –How To Get NFS Started –The /etc/exports File –Activating Modifications The Exports File –NFS And DNS –Configuring The NFS Client –Other NFS Considerations Practical –to share and mount NFS file systems Summary

DFS: An Overview Unix distributed filesystems are used to –centralise administration of disks –provide transparent file sharing across a network Three main systems: –NFS: Network File Systems developed by Sun Microsystems 1984 –AFS: Andrew Filesystem developed by Carnegie-Mellon University Unix NFS packages usually include client and server components –A DFS server shares local files on the network –A DFS client mounts shared files locally –a Unix system can be a client, server or both depending on which commands are executed

Overview of NFS Developed by Sun Microsystems 1984 Independent of operating system, network, and transport protocols. Now available on many platforms including: –Linux, Windows, OS/2, MVS, VMS, AIX, HP-UX…. Restrictions of NFS –stateless open architecture –Unix filesystem semantics not guaranteed –No access to remote special files (devices, etc.) Restricted locking –file locking is implemented through a separate lock daemon

MOUNT The NFS Protocol Stack RPC XDR TRANSPORT, NETWORK, LINK & PHYSICAL LAYERS NFS biodstatd lockd mountdnfsd server client statd lockd

The NFS Client NFS clients access network shared directories using the mount command NFS mount options: rw/roread-write (default) or read-only hardretry mount operation until server responds (default) or soft try mount once and allow to timeout retrans &transmission and timeout parameters for soft mounted operations timeout bgafter first mount failure, retry mount in the background intrallow operations on filesystems to be interrupted with signals Use /etc/fstab to make NFS mounts permanent a02:/tmp /mnt/nethome nfs soft 0 0 Manually mounting /tmp as /mnt/nethome on local host from a02: # hostname a01 # mount –o rw,soft -t nfs a02:/tmp /mnt/nethome # hostname a01 # mount –o rw,soft -t nfs a02:/tmp /mnt/nethome

Exercise - Using mount with NFS What command will mount /usr/share from mash4077 on the local mount point /usr/share? How do I check what filesystems are mounted locally? Make a static mount in a01 ”/mnt/nethome” of exported ”a02:/tmp” in /etc/fstab: Manually mount exported a02:/usr/share as read only on a01: # # # # # #

The NFS Server Solaris type’s The share command is used to share directories on the network –any directory can be exported –subdirectories of an exported directory may not be exported unless they are on a different disk –parents of an exported directory may not be exported unless they are on a different disk –only local filesystems can be exported Share options: ro/rwshare readonly or read/write (default) for all clients rw= host [: host ]...allow only the named hosts to write, no access to others ro= host :[ host ]...readonly access to the named hosts, no access to others root= host :[ host ]...allow root access from named hostsonly anon=-1deny access to unknown users # share -F nfs -o ro=rosies /home/hawkeye

More on Shared Directories Add a line to /etc/dfs/dfstab to share a directory permanent –each line in this file is simply the share command required –commands in this file are executed by the nfs script in /etc/init.d Use unshare to stop sharing a directory Use dfshares to look at your shared resources –can specify other hosts on command line Use dfmounts to look at who has mounted your shares –can specify other hosts on command line # dfshares RESOURCE SERVER ACCESS TRANSPORT /home/hawkeye mash # dfmounts RESOURCE SERVER PATHNAME CLIENTS /home/hawkeye mash4077 /home/hawkeye rosies # dfshares RESOURCE SERVER ACCESS TRANSPORT /home/hawkeye mash # dfmounts RESOURCE SERVER PATHNAME CLIENTS /home/hawkeye mash4077 /home/hawkeye rosies

Exercise - Sharing Directories Write down the commands to do the following? # share /usr/share readonly for all clients # share /etc readonly for rosies and tokyo and read/write for seoul # list the files containing the permanent shares # two commands showing what your host has shared # check who has mounted your shared directories # check who has mounted directories on rosies # share /usr/share readonly for all clients # share /etc readonly for rosies and tokyo and read/write for seoul # list the files containing the permanent shares # two commands showing what your host has shared # check who has mounted your shared directories # check who has mounted directories on rosies

NFS under BSD systems NFS uses different commands for BSD systems Mount directories using mount as for SVR4 Share directories using exportfs Permanently share directories using /etc/exports –one line per shared directory –use access= host instead of ro= host Look at network shares using showmount # cat /etc/exports /home/hawkeye ro=rosies /etc rw=seoul,access=rosies,tokyo # exportfs -a # showmount -e export list for mash4077: /home/hawkeye rosies /etc seoul,rosies,tokyo # cat /etc/exports /home/hawkeye ro=rosies /etc rw=seoul,access=rosies,tokyo # exportfs -a # showmount -e export list for mash4077: /home/hawkeye rosies /etc seoul,rosies,tokyo

Installing NFS, RedHat Linux Check if NFS is installed with rpm Check if RPC portmap package installed rpm # rpm -qa | grep nfs redhat-config-nfs nfs-utils # rpm -qa | grep nfs redhat-config-nfs nfs-utils # rpm -qa | grep portmap portmap # rpm -qa | grep portmap portmap

How To Get NFS Started Activate the 3 nessesary servers for NFS at boot –NFS server demon –NFS file locking –RPC portmap Start the NFS server –With sysconfig Check that ther services for NFS is running with rpcinfo # chkconfig --level 35 nfs on # chkconfig --level 35 nfslock on # chkconfig --level 35 portmap on # chkconfig --level 35 nfs on # chkconfig --level 35 nfslock on # chkconfig --level 35 portmap on # service nfs start # rpcinfo -p localhost program vers proto port tcp 111 portmapper udp 111 portmapper udp 2049 nfs udp 2049 nfs udp 1024 nlockmgr udp 1024 nlockmgr udp 1024 nlockmgr udp 1042 mountd tcp 2342 mountd udp 1042 mountd tcp 2342 mountd udp 1042 mountd tcp 2342 mountd # rpcinfo -p localhost program vers proto port tcp 111 portmapper udp 111 portmapper udp 2049 nfs udp 2049 nfs udp 1024 nlockmgr udp 1024 nlockmgr udp 1024 nlockmgr udp 1042 mountd tcp 2342 mountd udp 1042 mountd tcp 2342 mountd udp 1042 mountd tcp 2342 mountd

The /etc/exports File, static shares Sample exports file Some options in exports file Squash changes remote identity to selectable local identity RedHat uses another format in /etc/exports than BSD system’s # cat /etc/exports /data/files *(ro,sync) /home /24(rw,sync) /data/test *.my-site.com(rw,sync) /data/database /32(rw,sync) # cat /etc/exports /data/files *(ro,sync) /home /24(rw,sync) /data/test *.my-site.com(rw,sync) /data/database /32(rw,sync) ro read only accessrw read and write access syncwrite when requestedwdelay wait for sync hide dont show subdirs that is exported of other export no_all_squash remote uid’s & gid’s become equal of client root_squash remote root uid become anonymous on the client no_root_squash remote root equals to local root user ro read only accessrw read and write access syncwrite when requestedwdelay wait for sync hide dont show subdirs that is exported of other export no_all_squash remote uid’s & gid’s become equal of client root_squash remote root uid become anonymous on the client no_root_squash remote root equals to local root user

Activating Modifications The Exports File Re-reading all entries in /etc/exports file –When no directories have been exported to NFS, then the "exportfs -a" command is used: After adding share(s) to /etc/exports file –When adding a share you can use the "exportfs -r" command to export only the new entries: Deleting, Moving Or Modifying A Share –In this case it is best to temporarily unmount the NFS directories using the "exportfs -ua" command followed by the "exportfs -a" command. Termporary export /usr/src to host # exportfs -a # exportfs -r # exportfs -ua # exportfs -a # exportfs -ua # exportfs -a # exportfs /usr/src –o rw

Configuring The NFS Client Ensure Portmap Is Running –Clients need portmap only to be running If not, start portmap Temporary mount nfs shares on client umount temporaty mounted nfs shares on client Show exported shares on server # rpcinfo -p localhost # /etc/init.d/portmap start # mkdir /mnt/nethome # mount –t nfs :/home /mnt/nethome # mkdir /mnt/nethome # mount –t nfs :/home /mnt/nethome # umount /mnt/nethome # showmount --exports

Mount ”nfs-shares” at boot in client Make entries in /etc/fstab Some /etc/fstab mount options Mount all unmounted –If you made changes on live system in fstab, you can mount all unmounted filesystem with: mount –a #/etc/fstab #Directory MountPoint Type Options Dump FSCK :/data/files /mnt/nfs nfs soft 0 0 #/etc/fstab #Directory MountPoint Type Options Dump FSCK :/data/files /mnt/nfs nfs soft 0 0 automount this when mount –a is used defaults (rw suid dev exec auto nouser async) userallow regular users to mount/umount syncuse syncron I/O most safe soft skip mount if server not responding hardtry until server responds retry=minutes bg/fg retry mounting in background or foreground automount this when mount –a is used defaults (rw suid dev exec auto nouser async) userallow regular users to mount/umount syncuse syncron I/O most safe soft skip mount if server not responding hardtry until server responds retry=minutes bg/fg retry mounting in background or foreground

NFS security NFS is inherently insecure –NFS can be run in encrypted mode which encrypts data over the network –AFS more appropriate for security conscious sites User IDs must be co-ordinated across all platforms –UIDs and not user names are used to control file access –mismatched user id's cause access and security problems Fortunately root access is denied by default –over NFS root is mapped to user nobody # mount | grep "/share" mail:/share on /share # id uid=555(hawkeye) gid=501(hawkeye) # touch /tmp/hawkeye # ssh mail ls -l /tmp/hawkeye -rwxr-xr-x 2 soonlee sonlee 0 Jan 11 11:21 /share/hawkeye # mount | grep "/share" mail:/share on /share # id uid=555(hawkeye) gid=501(hawkeye) # touch /tmp/hawkeye # ssh mail ls -l /tmp/hawkeye -rwxr-xr-x 2 soonlee sonlee 0 Jan 11 11:21 /share/hawkeye

NFS Hanging Run NFS on a reliable network Avoid having NFS servers that NFS mount each other's filesystems or directories Always use the sync option whenever possible Mission critical computers shouldn't rely on an NFS server to operate Dont have NFS shares in search path

NFS Hanging continued File Locking –Known issues exist, test your applications carefullý Nesting Exports –NFS doesn't allow you to export directories that are subdirectories of directories that have already been exported unless they are on different partitions. Limiting "root" Access –no_root_squash Restricting Access to the NFS server –You can add user named "nfsuser" on the NFS client to let this user squash access for all other users on that client

Other DFS Systems RFS: Remote File Sharing –developed by AT&T to address problems with NFS –stateful system supporting Unix filesystem semantics –uses same SVR4 commands as NFS, just use rfs as file type –standard in SVR4 but not found in many other systems AFS: Andrew Filesystem –developed as a research project at Carnegie-Mellon University –now distributed by a third party (Transarc Corporation) –available for most Unix platforms and PCs running DOS, OS/2, Windows –uses its own set of commands –remote systems access through a common interface (the /afs directory) –supports local data caching and enhanced security using Kerberos –fast gaining popularity in the Unix community

Summary Unix supports file sharing across a network NFS is the most popular system and allows Unix to share files with other O/S Servers share directories across the network using the share command Permanent shared drives can be configured into /etc/fstab Clients use mount to access shared drives Use mount and exportfs to look at distributed files/catalogs