Chapter VIIII File Systems Review Questions and Problems

Slides:



Advertisements
Similar presentations
More on File Management
Advertisements

1 CMPT 300 Introduction to Operating Systems File Systems Sample Questions.
Chapter 4 : File Systems What is a file system?
File Systems.
G53OPS Operating Systems Graham Kendall File Systems.
Chapter 11: File System Implementation
File System Implementation
Operating Systems File Systems (in a Day) Ch
File System Implementation CSCI 444/544 Operating Systems Fall 2008.
Ceng Operating Systems
Chapter 12: File System Implementation
04/07/2010CSCI 315 Operating Systems Design1 File System Implementation.
The Design and Implementation of a Log-Structured File System Presented by Carl Yao.
Chapter IX File Systems Jehan-François Pâris
1 File System Implementation Operating Systems Hebrew University Spring 2010.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
Problems discussed in the review session for the final COSC 4330/6310 Summer 2012.
File System Implementation Chapter 12. File system Organization Application programs Application programs Logical file system Logical file system manages.
OSes: 11. FS Impl. 1 Operating Systems v Objectives –discuss file storage and access on secondary storage (a hard disk) Certificate Program in Software.
Chapter VIIII File Systems Review Questions and Problems Jehan-François Pâris
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
1 File Systems: Consistency Issues. 2 File Systems: Consistency Issues File systems maintains many data structures  Free list/bit vector  Directories.
File System Implementation
A FAST FILE SYSTEM FOR UNIX Marshall K. Mckusick William N. Joy Samuel J. Leffler Robert S. Fabry CSRG, UC Berkeley.
Solutions for the First Quiz COSC 6360 Spring 2014.
UNIX File System (UFS) Chapter Five.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems File systems.
CS 3204 Operating Systems Godmar Back Lecture 21.
11.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles 11.5 Free-Space Management Bit vector (n blocks) … 012n-1 bit[i] =  1  block[i]
Solutions for the First Quiz COSC 6360 Fall 2014.
File System Performance CSE451 Andrew Whitaker. Ways to Improve Performance Access the disk less  Caching! Be smarter about accessing the disk  Turn.
COSC 3330/6308 Second Review Session Fall Instruction Timings For each of the following MIPS instructions, check the cycles that each instruction.
Part III Storage Management
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 3: Windows7 Part 3.
Day 28 File System.
File System Consistency
File System Examples Unix Fast File System (FFS)
Today topics: File System Implementation
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Chapter 11: File System Implementation
Chapter 11: File System Implementation
FileSystems.
AN IMPLEMENTATION OF A LOG-STRUCTURED FILE SYSTEM FOR UNIX
Day 27 File System.
Chapter 11: File System Implementation
Filesystems.
The UNIX File System Jerry Breecher Contains sections on:
Solution to the Fourth COSC 6360 Quiz for Fall 2013
Review.
Lecture 45 Syed Mansoor Sarwar
Chapter 11: File System Implementation
File Systems Directories Revisited Shared Files
File Systems Implementation
Chapter 3: Windows7 Part 3.
Chapter 11: File System Implementation
Introduction to Operating Systems
CSE 451: Operating Systems Autumn 2004 BSD UNIX Fast File System
File Management – Implementation
Printed on Monday, December 31, 2018 at 2:03 PM.
Overview: File system implementation (cont)
CSE 451: Operating Systems Winter Module 15 BSD UNIX Fast File System
Chapter IX File Systems
Chapter 14: File-System Implementation
Chapter 11: File System Implementation
File System Implementation
File system : Disk Space Management
File System Performance
Chapter 12: File-System Implementation CSS503 Systems Programming
The Design and Implementation of a Log-Structured File System
Presentation transcript:

Chapter VIIII File Systems Review Questions and Problems Jehan-François Pâris jfparis@uh.edu

Mount What is the purpose of the UNIX mount operation? To install a new device driver in the kernel To construct a single directory tree crossing disk partition boundaries To install a shared library

Mount What is the purpose of the UNIX mount operation? To install a new device driver in the kernel To construct a single directory tree crossing disk partition boundaries To install a shared library

Mount What is the main advantage of that mount operation? It speeds up file accesses It hides from the user actual file locations on disk

Mount What is the main advantage of that mount operation? It speeds up file accesses It hides from the user actual file locations on disk

File Organization Savvy UNIX users try to pick the best block size for each of their files TRUE FALSE

File Organization Savvy UNIX users try to pick the best block size for each of their files TRUE FALSE: All files in the same disk partition have the same block size

Protection What is the main advantage of access control lists over tickets? They are more flexible They are faster They are always encrypted

Protection What is the main advantage of access control lists over tickets? They are more flexible They are faster They are always encrypted

Protection What is the main advantage of tickets over access control lists? They are more flexible They are faster They are always encrypted

Protection What is the main advantage of tickets over access control lists? They are more flexible They are faster They are always encrypted

Protection What is the best way to combine access control lists and tickets? Use ____________________ for long term access control and ____________________ for short term access control

Protection What is the best way to combine access control lists and tickets? Use access control lists for long term access control and tickets   for short term access control

Protection Why?

Protection Why? To take advantage of the higher flexibility of access control lists and the lower cost of tickets

Protection Give examples of access control lists and tickets in the UNIX file system

Protection Give examples of access control lists and tickets in the UNIX file system nine-bit file modes file descriptors

Protection Which are the major advantage and the major disadvantage of the UNIX implementation of access control lists?

Protection Which are the major advantage and the major disadvantage of the UNIX implementation of access control lists? Major advantage: They occupy very little space Major disadvantage: They are much less flexible than full ACLs because only system administrators can create or modify user groups

Protection Which users can do what with a file having these protection bits? -rw-rw-r--

Protection Which users can do what with a file having these protection bits? -rw-rw-r– Owner of file and members of the group associated with the file can read and modify the file Everybody else can just read it

Block sizes Which issues should we consider when selecting the block size of a disk partition?

Block sizes Which issues should we consider when selecting the block size of a disk partition? Larger block sizes speed up data transfers Smaller block sizes minimize internal fragmentation

Block sizes Why is it so important to minimize internal fragmentation in a file system? Because most file systems have many very small files Using 8 KB blocks to store a 4KB file wastes 50% of the disk space

Block sizes Why is it so important to minimize internal fragmentation in a file system? Because most file systems have many very small files Using 8 KB blocks to store a 4KB file wastes 50% of the disk space

File sizes What is the maximum file size in a 32-bit system?

File sizes What is the maximum file size in a 32-bit system? Four megabytes because a 32-bit unsigned integer can address 232 bytes

Addressing file contents A BSD file system has 12 direct block addresses and 8 KB blocks? How many bytes can be addressed Directly from the i-node? With one level of indirection? With two levels of indirection?

Addressing file contents 1 2 3 4 5 6 7 8 9 10 11 12 13 b/4 block addresses b/4 indirect block addresses . . . Twelve direct blocks b/4 indirect blocks b/4b/4 double indirect blocks Block size b  4KB 29

Addressing file contents 1 2 3 4 5 6 7 8 9 10 11 12 13 b/4 block addresses b/4 indirect block addresses . . . Twelve direct blocks b/4 indirect blocks b/4b/4 double indirect blocks Block size b = 8KB 30

Addressing file contents 1 2 3 4 5 6 7 8 9 10 11 12 13 2K block addresses 2K indirect block addresses . . . Twelve direct blocks b/4b/4 double indirect blocks Block size b = 8KB 96 KB b/4 indirect blocks 31

Addressing file contents 1 2 3 4 5 6 7 8 9 10 11 12 13 2K block addresses 2K indirect block addresses . . . Twelve direct blocks b/4b/4 double indirect blocks Block size b = 8KB 96 KB 2K blocks = 16MB 32

Addressing file contents 1 2 3 4 5 6 7 8 9 10 11 12 13 2K block addresses 2K indirect block addresses . . . Twelve direct blocks b/4b/4 double indirect blocks Block size b = 8KB 96 KB 2K blocks = 16MB 4GB - 16MB – 98 KB 33

Addressing file contents Directly from the i-node, we can access the first 12 blocks of the file, that is, 12x8 KB =96 KB As one block can contain 8K/4 = 213/4 = 211 block addresses, we can access 211 blocks, that is, 211x8 KB = 211x213 B = 224 B = 16MB of data with one level of indirection

Addressing file contents With two levels of indirection, we should be able to access 8K/4 = 213/4 = 211x211 = 222 block addresses, that is, 222x8 KB = 222x213 B = 235 B = 32 Since file sizes cannot exceed 4GB, we can only access 4 GB – 16MB -96 KB

Block sizes again Why did the designers of BSD FFS picked a minimum block size of 4 KB?

Block sizes again Why did the designers of BSD FFS picked a minimum block size of 4 KB? Because it is the smallest block size that eliminates the need for a third level of indirection

Block sizes again Why did the designers of BSD FFS introduced block fragments?

Block sizes again Why did the designers of BSD FFS introduced block fragments? To reduce internal fragmentation: fragments can be used to store small files (less than 4 KB) and the tail end of larger files

Cylinder groups What is the main advantage of introducing cylinder groups in FFS?

Cylinder groups What is the main advantage of introducing cylinder groups in FFS? It reduces seek times: since each cylinder group contains both i-nodes and data blocks, we can store the first few blocks of large files and all the blocks of regular files closer to their i-nodes

Metadata updates When you create a new file, in which order should the blocks containing (a) the new directory entry and (b) the new i-node be written to disk?

Metadata updates When you create a new file, in which order should the blocks containing (a) the new directory entry and (b) the new i-node be written to disk? We should write first the block containing the new i-node and then the block containing the new directory entry

Metadata updates When you delete an existing file, in which order should the blocks containing (a) the deleted directory entry and (b) the reclaimed i-node be written to disk?

Metadata updates When you delete an existing file, in which order should the blocks containing (a) the deleted directory entry and (b) the reclaimed i-node be written to disk? We should write first the block containing the deleted directory entry and then the block containing the reclaimed i-node

Metadata updates How does FFS ensure that all metadata updates are written to disk in the right order?

Metadata updates How does FFS ensure that all metadata updates are written to disk in the right order? It uses blocking writes: metadata ordering is enforced by ensuring that a metadata update cannot proceed until the previous one has completed

Metadata updates What is the main drawback of this solution?

Metadata updates What is the main drawback of this solution? They occasion too many seeks and, as a result, significantly degrade the performance of the file system

Journaling file systems Which are the respective advantages and disadvantages of Journaling file systems doing synchronous log updates? Journaling file systems doing asynchronous log updates? Justify your answers

Journaling file systems Journaling file systems doing synchronous log updates commit to the log each individual update This guarantees that no metadata updates will be lost when the system crashes, but makes them slower than journaling file systems doing asynchronous log updates

Journaling file systems Journaling file systems doing asynchronous log updates what until their update buffer is full before committing these updates to the log. This reduces the number of log writes and makes them faster than journaling file systems doing synchronous log updates. It also means that metadata updates will be lost if the system crashes before the update buffer is committed to the log

UNIX Directories Describe the contents of a UNIX directory entry.

UNIX Directories Describe the contents of a UNIX directory entry. A UNIX directory entry contains a file name the i-node number of the file associated with that file name

Mapped files Which are the main advantages and disadvantages of mapped files?

Mapped files Which are the main advantages and disadvantages of mapped files? Mapped files speed up file accesses by replacing all read and write system calls by mere function calls They make it very difficult to know the exact size of files (in bytes)