Lecture 12-File Systems Flashcards

1
Q

What are the Objectives of File System?

A

Allow creation and deletion of files

Allow access to files by symbolic names

Allow the sharing of files where required, but protect files against unauthorised access

Perform automatic management of secondary storage, allocating files to physical blocks

Protect files against system failure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Concept of File?

A

The concept of a file is of a uniform logical view of information storage.

A file is a named collection of related information that is recorded on secondary storage.

It allows data to be stored between processes

It allows us to store large volumes of data

It allows multiple processes to access the data concurrently

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is File Structure and Access?

A

File structure: A file can be stored as
A sequence of bytes. It is up to the program that accesses the file to interpret the byte sequence
A sequence of fixed-length structured records
A tree of variable length records. Each has a key field to be used for record retrieval

File access
Sequential access: good for magnetic tapes
Random access: good for disks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the 3 Directory Structures?

A

One-level system: one root directory contains all files
Two-level system: giving each user a private directory
Hierarchical system: a tree of directories

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the File System Layout?

A

A disk is divided into partitions/volumes, each holds an
independent file system
Section 0 is the Master Boot Record (MBR), used to boot the computer via boot block, which may contain the OS
The super block contains the info about the file system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Contiguous Allocation?

A

Disks are split into blocks of a fixed size, e.g., 1KB
Files are stored in blocks in several ways
Contiguous allocation assigns contiguous blocks to a file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Contiguous Allocation Advantages and Disadvantages?

A

Advantages
Simple to implement: needs to store the first block address and its length

The performance of such an implementation is good.

The read/write heads have to move very little, if at all

Resilient to disk faults: damage to a single block results in only localised loss of data

Allows easy random access.

Disadvantages
Need to “guess” the size of the file when it is first created
Fragmentation: as files are deleted, holes appear; can be overcome by compaction, but this is expensive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is Linked List Allocation?

A

Store a file as a linked list of blocks

Need only to store the first block address in the file descriptor

Each block contains data and a pointer to the next block. The final block contains a null pointer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the Advantages and Disadvantages of Linked List Allocation?

A

Advantages
Every block can be used

No space is lost due to disk fragmentation, except for internal fragmentation in the last block

The file size does not have to be known beforehand.

Disadvantages
Random access is very slow

Space is lost within each block due to the pointer.

Reliability could be a problem—can be alleviated by adding reverse links

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is Linked List with File Allocation Table?

A

Store the pointers in a file allocation table (FAT) in memory

The pointer in a file descriptor points to the location in the FAT representing its first block

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the advantafes and disadvanatges of Linked List with File Allocation Table?

A

Advantages
Does not waste space in the block
Random access is much easier as FAT is in memory

Disadvantages
FAT may be too large to hold in main memory, so has to be held on secondary storage

May require several disk accesses to read all relevant FAT entries

Damage to FAT can cause serious data loss. The solution: store several FAT copies in different areas of the disk

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is I-Nodes in UNIX?

A

Each file has an i-node (index-node) listing all the attributes for the file

The i-node also contains a number of direct pointers to disk blocks. Typically there are ten direct pointers

In addition, there are three indirect pointers. These pointers point to further data structures which eventually lead to a disk block address

The first of these pointers is a single level of indirection, the next pointer is a double indirect pointer and the third is a triple indirect pointer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the implementation of directories?

A

MS-DOS: a directory entry is 32 bytes long

UNIX: a directory entry has an i-node no. and filename
All its attributes are stored in the i-node
All i-nodes have a fixed location on the disk, so locating an i-node is simple and fast

How well did you know this?
1
Not at all
2
3
4
5
Perfectly