some basic concepts and information on file systems portions taken and modified from books by andrew...

24
Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

Upload: briana-long

Post on 05-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

Some basic concepts and information on file systems

Portions taken and modified from books by ANDREW S. TANENBAUM

Page 2: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

Essential for long-term information storage:

• It must be possible to store a very large amount of information.

• The information must survive the termination of the process using it.

• Multiple processes must be able to access the information concurrently.

Why do we need files and file Systems

Page 3: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

Think of a disk as a linear sequence of fixed-size blocks and supporting reading and writing of blocks. Questions that quickly arise:

•How do you find information?

•How do you keep one user from reading another’s data?

•How do you know which blocks are free?

Files on disks

Page 4: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

File Naming & Estensions

Page 5: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

Three kinds of files. (a) Byte sequence. (b) Record sequence. (c) Tree.

File Structure

Page 6: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

(a) An executable file. (b) An archive.

File Types and Formats

Page 7: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

Some Common file attributes

Page 8: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

Common system calls relating to files

• Append• Seek• Get Attributes• Set Attributes• Rename

• Create• Delete• Open • Close• Read• Write

Page 9: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

Hierarchical Directory Systems

Page 10: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

Path Names - A UNIX directory tree

Page 11: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

System calls for managing directories:

Directory Operations

• Readdir

• Rename

• Link

• Uplink

• Create

• Delete

• Opendir

• Closedir

Page 12: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

Typical (Unix) File System Layout

Page 13: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

a) Contiguous allocation of disk space for 7 files.

(b) The state of the disk after files D and F have been removed.

Contiguous Allocation

Page 14: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

Linked List Allocation

Page 15: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

Linked List Allocation – File Allocation Table

Page 16: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

I-nodes

Page 17: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

(a) A simple directory containing fixed-size entries with the disk addresses and attributes in the directory entry.

(b) A directory in which each entry just refers to an i-node.

Implementing Directories

Page 18: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

Shared Files

Page 19: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

(a) Situation prior to linking. (b) After the link is created. (c) After the original owner removes the file.

Page 20: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

Operations required to remove a file in UNIX:• Remove the file from its directory.• Release the i-node to the pool of free i-nodes.• Return all the disk blocks to the pool of free disk

blocks.

Journaling File Systems

Log (journal) is kept so that the operation is all or nothing – atomic.

Page 21: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

Abstract layer is added to make all file systems appear to be the same.

Virtual File Systems

Page 22: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

Percentage of files smaller than a given size (in bytes).

Page 23: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

(a) Storing the free list on a linked list. (b) A bitmap.

Keeping Track of Free Blocks

Page 24: Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM

The UNIX V7 File System