03 - Operating Systems & Applications | 02. Filesystems Flashcards

1
Q

What is the filesystem?

A

The filesystem is the data structure used by the operating system to store and retrieve data.

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

What does the filesystem do?

A

This is a software abstraction that allows developers to manipulate data without having to be concerned with the minutiae of how each storage device works.

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

T/F | This data is organized into files that are units of storage used to describe a self-contained piece of data. Each file has a format depending on what that file contains. This is indicated by the file’s extension that follows the file’s name.

A

TRUE

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

What are some common file extensions?

A

.txt
.doc
.jpg

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

What is the file extension .txt a file type for?

A

.txt for text files

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

What is the file extension .doc a file type for?

A

.doc for Microsoft Word files

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

What is the file extension .jpg a file type for?

A

.jpg for image files encoded using the JPEG compression algorithm

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

What happens after files are created?

A

Files are organized into directories

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

What is a directory?

A

A directory is a data structure that contains references to files and other directories. They are typically organized in a hierarchical tree structure called a directory tree.

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

What are some examples of a directory tree?

A

User > Download > cat.jpg

User > Photos > Grand Canyon > familypicture.jpg

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

T/F | Not only is it expected that files will hold important data, but it is also assumed that a certain amount of metadata is kept to manage these files.

A

TRUE

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

What does the file control block hold?

A

The file control block holds all of this metadata for the file, including file permissions, owners, sizes, and create, modified, and access times.

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

Alongside bookkeeping metadata, files can also have attributes that indicate special behavior. What are some common attributes?

A
  1. Hidden
  2. Immutable
  3. Compressed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is an immutable attribute?

A

Immutable: Cannot be modified or deleted.

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

What is a hidden attribute?

A

Hidden: Cannot be viewed by default in file managers.

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

What is a compressed attribute?

A

Compressed: The file is in a compressed form to save space.

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

Within the file permission are controls for what?

A

Three main actions that can be performed on a file.

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

What are the three main actions that are performed on a file?

A
  1. Reading
  2. Writing
  3. Executing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What does it look like in the real world when a file is saved onto a hard drive?

A

Within a hard disk drive is a spinning platter with a thin magnetic coating. A pointy head that looks like a thin fountain pen moves over this platter to etch data into the platter by adjusting the direction of the magnetic field at an incredibly precise location.

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

On physical hardware, what is the smallest chunk of physical storage?

A

The smallest chunk of this physical storage is called a sector. It is the smallest unit of storage for the physical drive and its size is determined by a balance between excessive metadata and wasting space.

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

T/F | Smaller sectors require more information to index the entire drive?

A

TRUE
Smaller sectors require more information to index the entire drive, like a librarian trying to organize millions of small pamphlets. This ruins performance for finding files as well as creates substantial overhead for documenting the location and content of each sector.

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

What are some drawbacks to larger sector sizes of a physical drive?

A

For example, if saving a file that has a size of 512 bytes and the sector size is 4096 bytes, the entire sector is written and used, effectively wasting 3584 bytes of space.

23
Q

In software filesystems, what are used to represent groupings of sectors?

A

Blocks are used to represent groupings of sectors. This is used as an abstraction so that the operating system and all of the applications that reside on it can have a common block size to target instead of needing to accommodate whatever arbitrary sector size is chosen by the hardware manufacturer.

24
Q

How many layers are there to a filesystem?

A

6 Layers

25
Q

What are the layers of a filesystem from most user-facing application down to the bottom for hardware devices?

A

Application Programs

Logical File System

File-Organization Module

Basic File System

IO Control

Devices

26
Q

What is the purpose of the filesystem layer Application Programs?

A

Application Programs - The day to day programs that are run by the user, like web browsers and text editors.

27
Q

What is the purpose of the filesystem layer Logical File System?

A

Logical File System - The system that manages the file control blocks containing the metadata of files such as file permissions, owners, sizes, and access times. Simplifies the access to files for applications regardless of how the underlying filesystem or hardware organizes them.

28
Q

What is the purpose of the filesystem layer File-Organization Module?

A

File-Organization Module - The component responsible for organizing the software blocks of the filesystem. Simplifies hardware differences between storage devices for the logical file system.

29
Q

What is the purpose of the filesystem layer Basic File System?

A

Basic File System - Communication layer between software block layout and hardware sector layout. Schedules IO requests and manages resource blocks for file-organization module.

30
Q

What is the purpose of the filesystem layer IO Control?

A

IO Control - The low-level software drivers that can communicate with the storage device’s controller. Understands how to manipulate the physical device to read and write data.

31
Q

What is the purpose of the filesystem layer Devices?

A

Devices - The mechanisms of the physical storage devices. For example, the motors and controls that do the physical act of storing data within the medium, be it changing the magnetic state of spinning disks or altering the placement of electrons in flash storage.

32
Q

T/F | In file operations, a file can be manipulated in a variety of ways.

A

TRUE. In fact, Unix built upon this to create an operating system where everything is treated as a file.

33
Q

What is Unix?

A

Unix is a family of operating systems that are all derived from the original AT&T Unix developed at Bell Labs in 1969.

34
Q

What are some simple command line file operations?

A

touch
ls
echo
>
cat
rm

35
Q

What does the command line file operation “touch” do?

A

New empty files are commonly created using the touch command.

36
Q

What does the command line file operation “ls” do?

A

The contents of a directory can be listed using the ls command. (Be sure to type a lowercase “L” as in “list” and not the number 1.)

37
Q

What does the command line file operation “echo” do?

A

A string of text can be output to the terminal using the echo command. This is useful in coordination with the > operator that redirects the text output to a file.

38
Q

What does the command line file operation “>” do?

A

The > operator that redirects the text output to a file.

39
Q

What does the command line file operation “cat” do?

A

A file can be output and read using the cat command.

40
Q

What does the command line file operation “rm” do?

A

A file can be deleted using the rm command.

41
Q

What is a string in computer science?

A

In computer science, sequences of characters are referred to as strings. Strings can be any length and can include any character such as:

Letters
Numbers
Symbols
Whitespace (spaces, tabs, new lines)
They are usually contained within a pair of ‘single quotes’ or “double quotes”.

Here are some examples of strings:

message = “Hello, world!”
username = “@sonnynomnom”
old_password = “Tr0ub4dor&3”
new_password = “correcthorsebatterystaple”

42
Q

T/F | In directory operations directories give a hierarchy to files.

A

TRUE

43
Q

What are some simple direction operation commands?

A

mkdir
ls
rm
-r

44
Q

What does the directory operation “mkdir” do?

A

New empty directories can be created using the mkdir command. This can also create directories within existing directories, called sub-directories.

45
Q

What does the directory operation “ls” do?

A

The contents of a directory can be listed using the ls command.

46
Q

What does the directory operation “rm” do?

A

A directory can be deleted using the rm command

47
Q

What does the directory operation “-r”do?

A

A directory can be deleted using the rm command with the -r recursive flag to also delete any files it may contain.

48
Q

A directory created within an existing directory is called what?

A

A sub-directory

49
Q

What is the data structure used by operating systems to store and retrieve data?

A

Filesystems

50
Q

T/F | The building blocks of the filesystems are the filesystems themselves.

A

TRUE.

The building blocks of the filesystem are the files themselves. A file is a unit of storage used to describe a self-contained piece of data.

51
Q

How can we tell what type of format a file is in?

A

As indicated by the file extension following their name.

52
Q

T/F | Files do not have permissions.

A

FALSE
Files have permissions that determine which users and groups can read, write, and execute that file.

53
Q

T/F | Directories are the data structure that contains references to just files.

A

FALSE
Directories are the data structure that contains references to files as well as other directories. Both files and directories can be created, opened, written, listed, and deleted using a wide variety of commands.

54
Q

T/F | The file system itself is organized in a collection of abstract layers.

A

TRUE.