The Unix File system (UFS) Presented by: Gurpreet Singh Assistant Professor Department of School of Computing and Engineering Galgotias University.

Slides:



Advertisements
Similar presentations
The UNIX File System Harry Chen Department of CSEE University of MD Baltimore County.
Advertisements

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. Unix system calls (part 2)
A Guide to Unix Using Linux Fourth Edition
5 Basic utilities When a user logs in to the Linux operating system the directory that they will start in is their home directory. Most users will have.
Introduction to Unix (CA263) File System
Exploring the UNIX File System and File Security
GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi.
6/24/2015B.RamamurthyPage 1 File System B. Ramamurthy.
Linux Linux File System.
The UNIX File System.
Guide To UNIX Using Linux Third Edition
7/15/2015B.RamamurthyPage 1 File System B. Ramamurthy.
Getting Started with Linux Linux System Administration Permissions.
File System and Directory Structure in Linux. What is File System In a computer, a file system is the way in which files are named and where they are.
COMP1070/2002/lec4/H.Melikian COMP1070 Lecture #5  Files and directories in UNIX  Various types of files  File attributes  Notion of pathname  Commands.
Guide To UNIX Using Linux Fourth Edition
Filesystem Hierarchy Standard (FHS) –Standard of outlining the location of set files and directories on a Linux system –Gives Linux software developers.
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
The file structure and related utilities CS240 Computer Science II.
Manage Directories and Files in Linux
Files & Directories Objectives –to be able to describe and use the Unix file system model and concepts Contents –directory structure –file system concepts.
Linux+ Guide to Linux Certification, Second Edition
Managing Files CSCI N321 – System and Network Administration Copyright © 2000, 2011 by the Trustees of Indiana University except as noted.
The UNIX File System. The UNIX File A file is a container for storing information and data. Filename limited to 255 characters. Can’t contain / or NULL.
Chapter Two Exploring the UNIX File System and File Security.
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
UNIVERSITY OF COLOMBO SCHOOL OF COMPUTING IT5501 Systems & Network Administration DEGREE OF BACHELOR OF INFORMATION TECHNOLOGY.
Linux file system "On a UNIX system, everything is a file; if something is not a file, it is a process." Sorts of files (on a Linux system) Directories:
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.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
PacNOG 6: Nadi, Fiji UNIX ™/ /Linux Permissions Hervey Allen Network Startup Resource Center.
Privileges: who can control what Introduction to Unix June 16, 2009 Papeete, French Polynesia Hervey Allen.
1 © 2001 John Urrutia. All rights reserved. Chapter 4 The LINUX Filesystem.
Privileges: who can control what Introduction to Unix May 24, 2008 Rabat, Morocco Hervey Allen.
Managing Files CSCI N321 – System and Network Administration Copyright © 2000, 2007 by the Trustees of Indiana University except as noted.
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control  The Unix file system is set up like a tree branching out from the root.
Linux Commands C151 Multi-User Operating Systems.
Slide: 1 UNIX FILE SYSTEM By:Qing Yang ID: Operating System Research Topic December, 2000.
Linux Filesystem WeeSan Lee. Roadmap Disk Partitions The Filesystem Filesystem Mouting & Umounting File Tree File Type File Permission.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 File-System Interface.
THE FILE SYSTEM Files long-term storage RAM short-term storage Programs, data, and text are all stored in files, which is stored on.
File system In computing, a file system is a method of storing and organizing computer files and the data they contain to make it easy to find and access.
UNIX File System By Vishal Desai. Introduction Basic purpose of file system: Represent and organize the system resources. But UNIX File System also maps.
UNIX filesystem CS 2204 Class meeting 2 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
File System Security ls -l. First Columm d = directory l = symbolic link b = block special file c = character special file p = fifo (or named pipe) special.
Operating System & Administration UNIT-III Introduction to File System.
A Brief Overview of Unix Brandon Bohrer. Topics What is Unix? – Quick introduction Documentation – Where to get it, how to use it Text Editors – Know.
The Unix File System R Bigelow. The UNIX File System The file system refers to the way in which UNIX implements files and directories. The UNIX file system.
Chapter 5 The Filesystem. Computer Center, CS, NCTU 2 Outline  File System Architecture  Pathname  File Tree  Mounting  File Types  inode and file.
LINUX Zhengli Zhu, School of Life Sciences. Outline 1. ABC of Linux 2. Basic orers of Linux 3. Bash Programming.
ORAFACT The Linux File System. ORAFACT Filesystem Support Support for dozens of filesystem types including: Minix, ext2, MS-DOS, UMSDOS, VFAT, NTFS, NFS,
Privileges: who can control what
Permissions: who can control what Unix/IP Preparation Course July 19, 2009 Eugene, Oregon, USA
UBUNTU INSTALLATION
Linux file system "On a UNIX system, everything is a file;
Chapter 6 File Systems CSNB113 SYSTEM ADMINISTRATION
Privileges: who can control what
Exploring the UNIX File System and File Security
File System B. Ramamurthy B.Ramamurthy 11/27/2018.
Security and File Permission
Department of School of Computing and Engineering
Perl Scripting and The File system
The Filesystem Chapter 5.
Software I: Utilities and Internals
Chapter 5 The Filesystem
Chapter 4: The Linux Filesystem
January 26th, 2004 Class Meeting 2
Presentation transcript:

The Unix File system (UFS) Presented by: Gurpreet Singh Assistant Professor Department of School of Computing and Engineering Galgotias University

Introduction File: logically a container for data. Filesystem: represent and organize the system’s storage resources.

Introduction Cont’d Some portions of a file tree are handled by traditional disk based implementation; others are fielded by separate drivers within the kernel. A complicated factor in UNIX filesystems is that they tend to support more than one type of disk-based file systems.

Main Components Namespace: a way of naming and arranging things in a hierarchy. API (Application Programming Interface) : a set of system calls for navigating and manipulating nodes. Security Model: protection mechanism to enable sharing. Implementation: code that ties the logical model to the actual disk.

Pathnames Unix organizes files in a single hierarchy. It starts at root directory /. It continues through an arbitrary number of subdirectories. List of directory to be traversed to locate a file forms the pathname. No restriction on depth of filesystem.

/ binvmunix hostspasswd etcdevusr locallib A directory tree

Pathnames Cont’d Pathnames can be either absolute (starting at the root directory) or relative (starting at the current directory). Each component of a pathname can not be more than 255 characters in length. To access a file with pathname longer than 1023 characters, “cd” to an intermediate directory and use a relative pathname. No restrictions on naming of files except they are limited in length and must not contain the “/” character or nulls. The space character is supported. Quote the file name containing spaces: % more “My Excellent file.txt”

Mounting One file system is configured to be the “root file system” and its root directory becomes the “system root directory”. Other file systems are attached to the root file system by mounting each new file system onto a directory in the root file system. That “mounted on” directory is also called the “mount point”. The previous contents of the mount point become inaccessible.

Mounting one filesystem to another / usr sys dev etc bin / local adm users bin fs0 fs1 usr /

Unmounting File systems are detached with the unmount command. In order to unmount a file system: 1) No files or process should be open or running. 2) If a file system contains executable programs, they must not be running.

Unmounting Cont’d Do not use command unmount –f. It forces a busy filesystem to be unmounted and may cause crash. Earlier versions : a) lockfs –h dir to “hard lock” the file system. b) unmount it normally. To determine exactly what the offending processes are, run ps with a list of the PIDs returned by fuser.

To find out why a file system is busy, run the fuser -c dir command. Example: % fuser -c /usr /usr: 157tom 315ctom …… c: a process that has a current directory on the filesystem. o: an open file. t: a running program. m: a mapped file (shared libraries usually). r: a process whose root directory is on the file system. Unmounting Cont’d

Organization of the File Tree Root file system contains the root directory and a minimal set of files and subdirectories. File containing the kernel is called unix or vmunix, and it resides in either the root directory or in a subdirectory such as /kernel or /stand. Part of the root filesystem are: /dev -- for device files. /etc -- for critical system files. /sbin and /bin -- for important utilities. /tmp -- for temporary files.

Organization of the File Tree Cont’d Some systems keep shared libraries and the C preprocessor in the /lib directory. Others have moved this into /usr/lib. /usr contains most of the user programs and online manuals etc. /var provides a home for spool directories, log files, accounting information etc. Home directories of users should be kept on different file systems and mounted beneath /usr.

File Types Regular Files. Directories. Character Device Files. Block Device Files. UNIX domain sockets. Named pipes (FIFOs). Symbolic links. A few systems do not support UNIX domain sockets and named pipes.

File Types Cont’d Directories Current directory:. Parent directory:.. Create:mkdir Delete:rmdir (empty directory) Delete:rm -r (nonempty directory)

File Types Cont’d Character and block device files Create:mknod Delete:rm Unix domain sockets Create:socket() Delete:rm or unlink()

File Types Cont’d Named pipes Create:mknod Delete:rm Symbolic links Create:ln -s Delete:rm

File Attributes Mode: 9 permission bits control who can read, write and execute the contents of the file. 3 bits affect the operation of executable programs. the 12 bits can be changed by the owner of the file or the superuser by using the chmod command. 16-bit word 12 bits together with 4 bits of file type information. The 4 file type bits are set when the file is first created and can’t be changed

File Attributes Cont’d The setuid and setgid bits: bits with octal values 4000 and They allow programs to access files and processes that would be otherwise off-limits to the user that runs them. The sticky bit: octal value If this bit is set, most UNIX systems don’t allow you to delete them unless You are superuser, the owner of directory, or the owner of the file. The permission bits: remaining 9 bits are permission bits. There are sets of permissions for the owner, group owner and everyone else.

File Attributes Cont’d use ls -l to view file attributes. Example: % ls -l /bin/sh -rwxr-xr-x 1 root bin Sep /bin/sh -regular file rwxr-xr-xthree sets of permission bits 1link count for the file rootowner of the file bingroup owner of the file 85924size of the file in bytes Sep the date of last modification /bin/shname of the file

File Attributes Cont’d chmod: changes the permissions on a file. chown: changes a file's ownership. chgrp: changes a file’s group ownership. umask: asigns the default permissions.

Thanks