Network File System Andrew File System NetWare Core Protocol Server Message Block Common Internet File System

Similar documents
The Network File System

The Network File System

Maintenance of /etc/fstab in large network Crashed NFS server will make operation blocked

OPS535. NFS Servers and Clients. Advanced TCP/IP Network Administration. Raymond Chan Seneca College of Applied Technology

CSE 265: System and Network Administration

Introduction to the Network File System (NFS)

Introduction to the Network File System (NFS)

Advanced Network and System Administration

NFS Version 4 17/06/05. Thimo Langbehn

NFS Design Goals. Network File System - NFS

CIT 470: Advanced Network and System Administration. Topics. Filesystems and Namespaces. Filesystems

SMB. / / 80-. /,,,, /scalability/ mainframe. / . ",,!. # $ " fail sharing,,. % ,,. " 90-, 12, /.! database.! /DBMS/.

COS 318: Operating Systems. Journaling, NFS and WAFL

COS 318: Operating Systems. NSF, Snapshot, Dedup and Review

DISTRIBUTED FILE SYSTEMS & NFS

Lab #9: Configuring A Linux File Server


Distributed File Systems: Design Comparisons

Network Information Service

Operating Systems Design 16. Networking: Remote File Systems

Take Command Starting Share Files with NFS

Today: Distributed File Systems. File System Basics

Today: Distributed File Systems

Chapter 11: File System Implementation. Objectives

Distributed Systems. Distributed File Systems. Paul Krzyzanowski

File systems: management 1

Chapter 7: File-System

Chapter 11: File-System Interface

Chapter 10: File System. Operating System Concepts 9 th Edition

Administring NFSv4 with Webmin

Operating Systems, Fall

CS3600 SYSTEMS AND NETWORKS

Serviceguard NFS Toolkit A , A and A Administrator's Guide

Sun Certified System Administrator for the Solaris 10 OS Bootcamp

Fuse Extension. version Erick Gallesio Université de Nice - Sophia Antipolis 930 route des Colles, BP 145 F Sophia Antipolis, Cedex France

4. Note: This example has NFS version 3, but other settings such as NFS version 4 may also work better in some environments.

Chapter 11: File-System Interface

DFS Case Studies, Part 1

Distributed File Systems. Jonathan Walpole CSE515 Distributed Computing Systems

Lecture 10 File Systems - Interface (chapter 10)

16 More File-Sharing Services

Porting ZFS file system to FreeBSD. Paweł Jakub Dawidek

NetBackup Copilot for Oracle Configuration Guide. Release 2.7.1

Part Four - Storage Management. Chapter 10: File-System Interface

Veritas NetBackup Copilot for Oracle Configuration Guide. Release 2.7.2

Chapter 11: File-System Interface. Operating System Concepts 9 th Edition

Porting ZFS 1) file system to FreeBSD 2)

Distributed File Systems

7 Distributed File Systems

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture)

Preface to the First Edition Preface to the Second Edition Acknowledgments UNIX Operating System Environment p. 1 UNIX: Past and Present p.

FreeBSD/ZFS last word in operating/file systems. BSDConTR Paweł Jakub Dawidek

Veritas NetBackup Copilot for Oracle Configuration Guide. Release 2.7.3

Veritas NetBackup Copilot for Oracle Configuration Guide. Release 3.1 and 3.1.1

File System. yihshih

Distributed File Systems. File Systems

File-System Interface

Chapter 10: File-System Interface. File Concept Access Methods Directory Structure File-System Mounting File Sharing Protection

File System: Interface and Implmentation

Distributed Systems. Lecture 07 Distributed File Systems (1) Tuesday, September 18 th, 2018

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture)

Distributed File Systems. CS432: Distributed Systems Spring 2017

Disks & File Systems. Dick Gillman, ITSS. 1/19/06 10:20:11 am docs/disks.sxi

Accessing LINUX file systems from CMS. Metropolitan VM Users Association January 24, 2005

Network File System (NFS)

Chapter 11: Implementing File-Systems

Distributed File Systems. CS 537 Lecture 15. Distributed File Systems. Transfer Model. Naming transparency 3/27/09

Chapter 11: File-System Interface

Network File System. Network File System (NFS) NFS Advantages. Network File System Disadvantages

File System and Storage Benchmarking Workshop SPECsfs Benchmark The first 10 years and beyond

Internet Systems Programming

Chapter 10: File-System Interface. Operating System Concepts 8 th Edition

Distributed Systems. 14. Network File Systems. Paul Krzyzanowski. Rutgers University. Fall 2016

This course is for those wanting to learn basic to intermediate topics in Solaris 10 system administration.

Enhancing NFS Cross-Administrative Domain Access

Chapter 12 Distributed File Systems. Copyright 2015 Prof. Amr El-Kadi

Clustered Data ONTAP NFS Best Practice and Implementation Guide

Chapter 10: File-System Interface

Fusepy Documentation. Release Giorgos Verigakis

System Administration. NFS & Web Servers

Filesystems Lecture 11

System Administration HW5 - Micro Computer Center. yihshih / lctseng

Managing NFS with Autofs

Chapter 10: File-System Interface

Distributed File Systems

Pintos Project 4 File Systems. November 14, 2016

OPERATING SYSTEM. Chapter 12: File System Implementation

Filesystems Lecture 13

Operating Systems 2010/2011

Today: Distributed File Systems. Naming and Transparency

Chapter 11: File-System Interface. Long-term Information Storage. File Structure. File Structure. File Concept. File Attributes

Cloud Computing CS

NFSv4 Peach Pit User Guide. Peach Fuzzer, LLC. v3.7.50

Today: Distributed File Systems!

Chapter 11: Implementing File Systems

Chapter 11: File-System Interface. File Concept. File Structure

Tales from the North. System Administration of a Geographically Disperse Network. Dwayne Hart

SunSoft SOLARIS NFS/TCP. Mike Eisler. Motivations Requirements Design Implementation War Stories Future Work. Solaris NFS/TCP Slide 1

Chapter 10: File System

File Systems. What do we need to know?

Transcription:

Network File System Andrew File System NetWare Core Protocol Server Message Block Common Internet File System

Share filesystem to other hosts via network NFS History Introduced by Sun Microsystems in 1985 Originally designed for diskless client-server architecture

Including Mounting Protocol Mount Server Daemons that coordinate basic file service Diagnostic utilities

NFS (RFC1094) NFSv2 (RFC1094, March 1989) Synchronous write V2 NFS server must commit each modified block to disk before replying to NFS client Cause long delay when there is a NFS write operation NFSv3 (RFC1813, June 1995) Asynchronous write Provide increase performance and better support for large files NFSv4 (RFC3530, April 2003) Stateful protocol

Sun s ONC distributed computing standards NFS client RPC Transport Layer Transport Layer UDP: Lack congestion control TCP: become more suitable

NFS Server Export sharing filesystem System dependent Waiting for mount request mountd (rpc.mountd) daemon Waiting for file access request nfsd (rpc.nfsd) daemon

Exporting filesystem 1. Edit export configuration file Each line is what to export and how 2. Reload related daemons System Exports info file How to reload FreeBSD /etc/exports /etc/rc.d/mountd reload Linux /etc/exports /usr/sbin/exportfs -a Solaris /etc/dfs/dfstab /usr/sbin/shareall SunOS /etc/exports /usr/sbin/exportfs -a

Exporting filesystem /etc/exports White-space separated Format: directory-list options-list client-list Option -ro -alldirs -maproot=user -mapall=user Description Exports read-only, default is (read-write) Allow any subdirectory to be mounted Maps root to the specified user. Maps all UIDs to the specified user. Client hostname netgroup Description Host name (ex: mailgate ccserv) NIS netgroups -network -mask -network 140.113.235.0 -mask 255.255.255.0

Example of /etc/exports /raid -alldirs maproot=root csmailgate backup /raid -alldirs maproot=nobody network 140.113.235 mask 255.255.255.0 /home -ro -mapall=nobody network 140.113.235.0 mask 255.255.255.0 /usr/src /usr/obj maproot=0 bsd_cc_cs Reload daemons # /etc/rc.d/mountd reload

Exporting filesystem /etc/exports Format: directory client-list-with-option Ex: /home1 bsd5(ro) Client hostname @netgroup Description Host name (ex: mailgate ccserv) NIS netgroups ipaddr/mask CIDR-style specification (ex: 140.113.235.2/24) Wild cards *? FQND with wild cards (ex: bsd*.cs.nctu.edu.tw)

Option ro,rw rw=list root_squash no_root_squash all_squash subtree_check no_subtree_check anonuid=xxx anongid=xxx secure insecure noaccess Description Read-only, Read-write (default) Hosts in the list can do rw, others ro only Maps UID 0 and GID 0 to the value of anonuid and anongid (default) Allow root access Maps all UID and GID to anonymous one Check that the accessed file is in the appropriate filesystem and in the exported tree. Disables subtree checking Related to root_squash Related to root_squash Require remote access from privileged port Allow remote access from any port Prevent access to this dir and it s subdir

Example of /etc/exports /home1 sun*.cs.nctu.eud.tw(rw) /home2 @sun_cc_cs(ro) dragon(rw,no_root_squash) /home cspc1(rw,all_squash,anonuid=150,anongid=100) /ftp/pub (ro,insecure,all_squash) /users *.xor.com(rw) /users/evi (noaccess) Run /usr/sbin/exportfs # /usr/sbin/exportfs a Maintain /var/lib/nfs/xtab table which is read by mountd

Exporting filesystem /etc/dfs/dfstab Each line will execute share command to export one NFS [format] share F nfs o option-list directory Ex: share F nfs o rw=ccbsd5.csie.nctu.edu.tw /home2 Run shareall command % /usr/sbin/shareall Client Description hostname netgroup IP networks DNS domains Host name (ex: mailgate ccserv) NIS netgroups @CIDR-style specification (ex: @140.113.235.2/24).xxx.yyy any host within the domain (ex:.nctu.edu.tw)

Option ro,rw ro=list, rw=list root=list anon=xxx anongid=xxx nosub nosuid Description Read-only to all, Read-write to all Hosts in the list can do ro/rw Lists hosts permitted to access this filesystem as root. Otherwise, root access from a client is equivalent to by nobody Specify the UID to which root is remapped. Default is nobody Related to root_squash Forbids clients to mount subdirectories Prevents setuid and setgid from being created

nfsd daemon Handle NFS file access request from NFS clients Number of nfsd is important Too small, some NFS request may be not served Too large, load will be high In FreeBSD Specify nfsd options in /etc/rc.conf nfs_server_enable="yes" nfs_server_flags="-u t n 4" nfsd(8), nfsiod(8)

NFS Client Mount NFS filesystem first Access file under NFS filesystem mount command [format] Ex: mount [-o options] host:directory mount-point % mount t nfs ccbsd4:/home/www /home/nfs/www /etc/fstab (/etc/vfstab in Solaris) % mount -a -t nfs (FreeBSD, Linux) % mount -a -F nfs (Solaris) # Device Mountpoint FStype Options Dump Pass# dragon:/usr/man /usr/man nfs ro,bg,soft 0 0 ccserv:/spool/mail /var/mail nfs rw,bg,intr 0 0

NFS mount flags Flag Systems Description ro or rw S,L,F Mount the NFS as ro or rw bg S,L,F If failed, keep trying in background hard S,L If server down, access will keep trying until server comes back soft S,L,F If server down, let access fail and return error intr, nointr S,L,F Allow/Disallow user to interrupt blocked access retrans=n S,L,F # of times to repeat a request before error return timeo=n S,L,F Timeout period of requests (tens of seconds) rsize=n S,L,F Set read buffer size to n bytes wsize=n S,L,F Set write buffer size to n bytes vers=n S Selects NFS v2 or v3 nfsv3,nfsv2 F Selects NFS v2 or v3 proto=prot S tcp or udp tcp L,F Select TCP. UDP is default mount_nfs(8)

Client side daemons that enhance performance biod (block I/O daemon, or called nfsiod) Perform read-ahead and write-behind caching

nfsstat Display NFS statistics % nfsstat s (display statistics of NFS server) % nfsstat c (display statistics of NFS client) cshome:~ -lwhsu- nfsstat -s Server Info: Getattr Setattr Lookup Readlink Read Write Create Remove 122903379 44946452 236493933 86636 207570824 123929056 4639946 4706741 Rename Link Symlink Mkdir Rmdir Readdir RdirPlus Access 1452831 851435 14512 474270 400621 1551728 763208 349261427 Mknod Fsstat Fsinfo PathConf Commit 40152 27594331 33528 257 87440831 Server Ret-Failed 125315642 Server Faults 0 Server Cache Stats: Inprog Idem Non-idem Misses 0 319 0 4343904 Server Write Gathering: WriteOps WriteRPC Opsaved 123928555 123929056 501

showmount % showmount e cchome show the hosts s export list % showmount a List all mount points bsd4:~ -lwhsu- showmount -e csdisk0 Exports list on csdisk0: /disk0/distfiles 140.113.235.0/255.255.255.0 /disk0/alpha 140.113.235.0/255.255.255.0 /disk0/iso 140.113.235.0/255.255.255.0 showcsdisk0 [~] -lwhsu- showmount -a All mount points on csdisk0: 140.113.168.126:/disk0/alpha 140.113.17.0/255.255.255.0:/disk0/linuxhome 140.113.17.41:/disk0/linuxhome 140.113.17.41:/disk0/linuxhome/packages 140.113.209.0/255.255.255.0:/disk0 140.113.209.63:/disk0/WWW 140.113.23.0/255.255.255.0:/disk0/ISO 140.113.23.20:/disk0/ISO 140.113.235.0/255.255.255.0,140.113.235.102:/disk0/alpha...

NFS server Edit /etc/rc.conf nfs_server_enable="yes" nfs_server_flags="-u t n 4" NFS client nfs_client_enable="yes"

Problems of /etc/fstab Maintenance of /etc/fstab in large network Crashed NFS server will make operation blocked Crashed NFS server will make other local partitions unavailable automount daemon Mount filesystems when they are referenced and unmount them when they are no longer needed Supply a list of replicated filesystems to replace important but crashed NFS servers Transparent to users Products automount (from SUN Micro), simple and concise amd (from Jan-Simon Pendry), complicated but more powerful

Three kinds of configuration files (map) Direct map Indirect map Master map Provide information about filesystems that are to be automounted List which direct and indirect maps that automount should pay attention to Difference between direct and indirect All mount points in indirect map has common directory defined in master map

Example of automount maps Master /net auto.net -rw, intr /- auto.direct -ro, intr Indirect WWW -rw,soft,nosuid,vers=2 vega:/home/www mail -rw,soft,nosuid,quota ccserv:/spool/mail ftp -ro,soft,nosuid ftp:/home/ftp direct /vlsi/vlsi1 -rw,soft,nosuid scorpio:/vlsi1 /vlsi/vlsi2 -rw,soft,nosuid scorpio:/vlsi2

Master map /etc/auto.master (Linux) /etc/auto_master (Solaris) Restart automounter when you change the maps /etc/init.d/autofs {start stop} (Solairs) /etc/init.d/autofs {start stop reload status} (Linux)

Replicated filesystem There are several identical NFS and I would like to mount anyone of them Constrain Read-only These replicated filesystem should be truly identical Automounter will choose a server based on its own idea of which one is the best /usr/man -ro chimchim:/usr/man band:/usr/man /www/data -ro ccbsd4,altair:/www/data

Advantages over automount Sends keep alive queries to remote servers at regular intervals and maintains a list of servers that are accessible Return an operation would block rather than hanging Not proprietary source code Offer another mount types that are not supported by automount Map syntax is more generic Provide a query-and-manipulation tool, amq

Flexible map syntax One map used by many machines Contain conditions that control which parts of map entry are activate Selector variable /defaults type:=nfs;fs:=${autodir}/${key};opts:=nfsv3,rw, \ grpid,quota,intr,soft,nodev,nosuid,resvport, \ timeo=10,retrans=5,nqnfs mail rhost:=ccserv;rfs:=/spool/mail ftp raid1 rhost:=ftp;rfs:=/home/ftp host==cchome;type:=ufs;dev:=/dev/da0s1e\ host!=cchome;type:=nfs;rhost:=cchome;rfs:=/${key};\ opts:=nfsv3,rw,grpid,soft,nodev,nosuid,resvport drongo host==magpie;type:=link;fs:=/${key} \ host!=magpie;type:=nfs;rhost:=magpie;rfs:=/${key}

Selector arch autodir domain host key map os Option rhost rfs type fs opts remopts Description Architecture of the current machine Default directory under which to mount filesystems Local NIS domain name Local hostname Volume name being resolved Name of mount map being used Operating System Description Remote host on which the volume lives Remote filesystem name Type of mount, nfs or ufs (local disk) Local mount point Mount options Options to use if server is nonlocal

Starting amd # amd -a /tmp_mnt -l syslog -x fatal, error, user /net auto.home /etc/rc.conf: amd_enable="yes" /etc/rc.d/amd start Stopping amd # kill -15 <amd_pid> /etc/rc.d/amd stop options Description -x Sets run-time logging options, such as fatal, error, user, warn, info, -r Restart existing mounts -l Log file name or syslog -a Specify alternative location for mount points /net auto.home Sets the automount directory The map files

Remount without kill amd Unmount such mounted partition # umount /amd/magpie Delete such virtual /net/dir # rm /net/magpie cd /net/dir # cd /net/magpie amd in FreeBSD /etc/rc.conf amd_enable="yes" amd_flags="-a /amd -c 1800 -d cs.nctu.edu.tw -l /var/log/amd.log -x all /net auto.home"