Docsity

File Systems - Applied Operating System - Lecture Slides, Slides of Computer Science

Partial preview of the text

Download File Systems - Applied Operating System - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

File Systems

Chapter 6

6.1 Files 6.2 Directories 6.3 File system implementation 6.4 Example file systems

Long-term Information Storage

1. Must store large amounts of data

2. Information stored must survive the

termination of the process using it

3. Multiple processes must be able to access

the information concurrently

File Types

(a) An executable file (b) An archive

File Access

  • Sequential access
    • read all bytes/records from the beginning
    • cannot jump around, could rewind or back up
    • convenient when medium was mag tape
  • Random access
    • bytes/records read in any order
    • essential for data base systems
    • read can be …
      • move file marker (seek), then read or …
      • read and then move file marker

Memory-Mapped Files

(a) Segmented process before mapping files

into its address space

(b) Process after mapping

existing file abc into one segment creating new segment for xyz

Directories

Single-Level Directory Systems

  • A single level directory system
    • contains 4 files
    • owned by 3 different people, A, B, and C

Hierarchical Directory Systems

A hierarchical directory system

Directory Operations

1. Create

2. Delete

3. Opendir

4. Closedir

5. Readdir

6. Rename

7. Link

8. Unlink

Implementing Files (2)

Storing a file as a linked list of disk blocks

Implementing Directories (1)

(a) A simple directory

fixed size entries disk addresses and attributes in directory entry

(b) Directory in which each entry just refers to an i-node

Shared Files (2)

(a) Situation prior to linking

(b) After the link is created

(c)After the original owner removes the file

Disk Space Management (2)

(a) Storing the free list on a linked list (b) A bit map

File System Reliability (1)

  • A file system to be dumped
    • squares are directories, circles are files
    • shaded items, modified since last dump
    • each directory & file labeled by i-node number File that has not changed

File System Reliability (3)

  • File system states (a) consistent (b) missing block (c) duplicate block in free list (d) duplicate data block