Lecture 43 Syed Mansoor Sarwar

Slides:



Advertisements
Similar presentations
Concepts about the file system 2. The disk structure 3. Files in disk – The ext2 FS 4. The Virtual File System (c) 2013, Prof. Jordi Garcia.
Advertisements

Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 11: File-System Interface File Concept Access Methods Directory Structure.
Chapter 10: File-System Interface
File System Interface CSCI 444/544 Operating Systems Fall 2008.
Dr. Kalpakis CMSC 421, Operating Systems. Fall File-System Interface.
1 File Management (a). 2 File-System Interface  File Concept  Access Methods  Directory Structure  File System Mounting  File Sharing  Protection.
04/02/2004CSCI 315 Operating Systems Design1 File System Interface.
CIS 240 Introduction to UNIX Instructor: Sue Sampson.
Introduction to Unix (CA263) File System
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 10: File-System Interface.
2000 Copyrights, Danielle S. Lahmani UNIX Tools G , Fall 2000 Danielle S. Lahmani Lecture 12.
Exploring the UNIX File System and File Security
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition File-System Interface.
04/05/2010CSCI 315 Operating Systems Design1 Virtual Memory Wrap-up; File System Interface.
Chapter 10: File-System Interface
10.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 10: File-System Objectives To discuss file-system design tradeoffs, including.
Linux Linux File System.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 11: File-System Interface File Concept Access Methods Directory Structure.
Guide To UNIX Using Linux Third Edition
File Concept l Contiguous logical address space l Types: Data: numeric, character, binary Program: source, object (load image) Documents.
04/07/2010CSCI 315 Operating Systems Design1 File System Implementation.
03/30/2007CSCI 315 Operating Systems Design1 Virtual Memory cont’d.; File System Interface.
Guide To UNIX Using Linux Fourth Edition
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 10: File-System Interface.
Linux Installation and Administration – Lesson 5 Tutor: George Papamarkos Topic: Devices in Linux.
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Silberschatz, Galvin and Gagne  Operating System Concepts File Concept Contiguous logical address space Smallest user allocation Non-volatile.
Chapter Two Exploring the UNIX File System and File Security.
1 Interface Two most common types of interfaces –SCSI: Small Computer Systems Interface (servers and high-performance desktops) –IDE/ATA: Integrated Drive.
Chapter 11 File Sharing. Sharing Techniques Duplicate files Common login Setting appropriate access permissions on shared files Common group for team.
Page 110/17/2015 CSE 30341: Operating Systems Principles Acyclic-Graph Directories  Have shared subdirectories and files.
10.1 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 11: File-System Interface File Concept Access Methods Directory Structure File-System.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 Chapter 10: File-System.
Page 110/19/2015 CSE 30341: Operating Systems Principles Chapter 10: File-System Interface  Objectives:  To explain the function of file systems  To.
1 CMSC421: Principles of Operating Systems Nilanjan Banerjee Principles of Operating Systems Acknowledgments: Some of the slides are adapted from Prof.
Manage Directories and Files in Linux. 2 Objectives Understand the Filesystem Hierarchy Standard (FHS) Identify File Types in the Linux System Change.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 11: File-System Interface File Concept Access Methods Directory Structure.
Linux+ Guide to Linux Certification, Third Edition
1 © 2001 John Urrutia. All rights reserved. Chapter 4 The LINUX Filesystem.
System Administration – Part 2. Devices in UNIX are files: A device can be accessed with different file names All device files are stored in /dev or its.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 10: File-System Interface File Concept.
Silberschatz and Galvin  Operating System Concepts Module 10: File-System Interface File Concept Access :Methods Directory Structure Protection.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 File-System Interface.
The Unix File system (UFS) Presented by: Gurpreet Singh Assistant Professor Department of School of Computing and Engineering Galgotias University.
14.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 10 & 11: File-System Interface and Implementation.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 10: File-System Interface.
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.
Lecture Topics: 11/29 File System Interface –Files and Directories –Access Methods –Protection –Consistency.
Access Methods File store information When it is used it is accessed & read into memory Some systems provide only one access method IBM support many access.
Operating Systems Files, Directory and File Systems Operating Systems Files, Directory and File Systems.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 11: File-System Interface File Concept Access Methods Directory Structure.
Instructor: Umar KalimNUST Institute of Information Technology Operating Systems File System Interface.
BILKENT UNIVERSITY DEPARTMENT OF COMPUTER TECHNOLOGY AND INFORMATION SYSTEMS CTIS156 INFORMATION TECHNOLOGIES II FILES AND FILE SYSTEM STRUCTURE.
Linux Filesystem Management
Chapter 13: File-System Interface
Chapter 6 File Systems CSNB113 SYSTEM ADMINISTRATION
Module 10: File-System Interface
Chapter 11: File-System Interface
UNIX Filesystem and Hierarchy
Lecture 45 Syed Mansoor Sarwar
Exploring the UNIX File System and File Security
File system(conti..) Lecture November 2018.
Chapter 11: File-System Interface
Lecture 44 Syed Mansoor Sarwar
Chapter 10: File-System Interface
Directory Structure A collection of nodes containing information about all files Directory Files F 1 F 2 F 3 F 4 F n Both the directory structure and the.
Department of School of Computing and Engineering
Chapter 10: File-System Interface
Module 10: File-System Interface
Lecture 4: File-System Interface
Presentation transcript:

Lecture 43 Syed Mansoor Sarwar Operating Systems Lecture 43 Syed Mansoor Sarwar

© Copyright Virtual University of Pakistan Agenda for Today Review of the previous lecture Directory Structures Links in UNIX/Linux File System Mounting File Sharing File Protection 3 December 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Review of Lecture 42 Review of the previous lecture File Concept File Types File Operations Access Methods Directories Directory Operations Directory Structure 3 December 2018 © Copyright Virtual University of Pakistan

Acyclic-Graph Directories Have shared subdirectories and files. 3 December 2018 © Copyright Virtual University of Pakistan

Acyclic-Graph Directories Two different names (aliasing) If dict deletes count  dangling pointer Solutions: Backpointers, so we can delete all pointers Link count solution 3 December 2018 © Copyright Virtual University of Pakistan

General Graph Directory 3 December 2018 © Copyright Virtual University of Pakistan

General Graph Directory How do we guarantee no cycles? Allow only links to files not subdirectories Every time a new link is added use a cycle detection algorithm to determine whether it is OK Garbage collection 3 December 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Links in UNIX Two types of links: Hard links Soft (symbolic) links The ln command ln [options] existing-file new-file ln [options] existing-file-list directory Examples: ln -/prog1.c ~/courses/OS/programs/prog1_hard.c ln –s ~/courses/OS/programs/prog2.c ~/prog2_soft.c 3 December 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Hard Links ~ prog1.c 12345 courses OS programs prog1_hard.c 12345 3 December 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Soft Links ~ prog2_soft.c 98765 courses Contents of prog2_soft.c ~/courses/OS/programs/prog2.c OS programs prog2.c 45678 3 December 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Links in UNIX Hard links A directory entry for the existing file is created—there is still only one file Both entries have the same inode number Link count is incremented by one in the inode for the file No hard links to directories No hard links across file systems File is removed from the file system only if its hard link count is 0 3 December 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Links in UNIX Soft (symbolic) links A file of type ‘link’ is created, which contains the pathname for the existing file as specified in the ln command The existing file and the new (link) files have different inode numbers When the existing file is removed, you have a ‘dangling pointer’ to it in the link file May have soft links to directories May have soft links across file systems 3 December 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan File System Mounting A file system is best visualized as a tree, rooted at /. /dev, /etc, /usr, and other directories in the root directory are branches, which may have their own branches, such as /etc/passwd, /usr/local, and /usr/bin. 3 December 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan File System Mounting Filling up the root file system is not a good idea, so splitting /var from / is a good idea. Another common reason to contain certain directory trees on other file systems is if they are to be housed on separate physical disks, or are separate virtual disks, or CDROM drives. 3 December 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan File System Mounting Mounting makes file systems, files, directories, devices, and special files available for use at a particular location Mount point is the actual location from which the file system is mounted and accessed. 3 December 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan File System Mounting You can mount a file or directory if you have access to the file or directory being mounted and write permission for the mount point Types of mounts: Remote mount Local mount 3 December 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan File System Mounting Remote mounts are done on a remote system on which data is transmitted over a telecommunication line Local mounts are mounts done on your local system 3 December 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Mounting in UNIX All files accessible in a Unix system are arranged in one big tree, the file hierarchy, rooted at /. These files can be spread out over several devices. The mount command serves to attach the file system found on some device to the big file tree. Conversely, the umount command will detach it again. 3 December 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Mounting in UNIX mount -t type device dir Tells the kernel to attach the file system found on device (which is of type type) at the directory dir The previous contents (if any) and owner and mode of dir become invisible As long as this file system remains mounted, the pathname dir refers to the root of the file system on device. 3 December 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Mounting in UNIX Existing Tree Unmounted Filesystem 3 December 2018 © Copyright Virtual University of Pakistan

New Tree after Mounting Filesystem Mounting in UNIX New Tree after Mounting Filesystem 3 December 2018 © Copyright Virtual University of Pakistan

File System Space Usage On SuSE Linux $ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/hda3 74837584 11127072 59908892 16% / tmpfs 257948 12 257936 1% /dev/shm /dev/hda1 19976 6960 11985 37% /boot inbox:/var/spool/mail 66602516 3319996 59899232 6% /var/spool/mail upfile1a:/usr1.a 230044816 70533680 147825456 33% /usr1.a upfile2a:/usr2.a 230044816 118228296 100130840 55% /usr2.a upibma:/usr3.a 16713676 804252 15039103 6% /usr3.a upfile4a:/usr4.a 230044816 14594384 203764752 7% /usr4.a $ 3 December 2018 © Copyright Virtual University of Pakistan

File System Space Usage On Solaris 2 $ df -v Mount Dir Filesystem blocks used free %used / /dev/dsk/c0t12d 7557677 2484225 4997876 34% /proc /proc 0 0 0 0% /etc/mntta mnttab 0 0 0 0% /dev/fd fd 0 0 0 0% /var/run swap 510103 22 510081 1% /tmp swap 683241 173160 510081 26% /oldexport /dev/dsk/c0t8d0 4668856 4229110 393058 92% /export/ho /dev/dsk/c0t12d 23684712 21714309 1733556 93% $ 3 December 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan File Sharing Sharing of files on multi-user systems is desirable. Sharing may be done through Duplicating files Common login for members of a team Setting appropriate access permissions Common groups for members of a team Links 3 December 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Recap of Lecture Directory Structures Links in UNIX/Linux File System Mounting File Sharing 3 December 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Operating Systems Lecture 43 Syed Mansoor Sarwar 3 December 2018 © Copyright Virtual University of Pakistan