Quiz 9 Flashcards

1
Q

How can an OS quickly find free space to allocate for a new file?

Scan the disk to identify which blocks are set to 0

Consult the page table

Scan the inode table to figure out which blocks are free

Keep a supporting structure such as a free block bitmap

A

Keep a supporting structure such as a free block bitmap

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

What is the lseek() function used for?

Change the current offset within the file

Determining where a file is saved within the filesystem

Close a file when it reaches a given size

Finding a file within the file system

A

Change the current offset within the file

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

A superblock is a special type of inode used to store a very large file (true or false)

A

false

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

When successful, the open() system call returns a ____ descriptor, i.e., an integer identifying that particular open file.

A

file

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

The superblock should be stored at a predictable offset on the disk so the OS can find it easily. (True or False)

A

True

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

Suppose I want to open a file, position the offset at byte 5 in the file, read 2 bytes, and close the file. In which order should I issue the appropriate system calls?

____ close()
____ lseek()
____ read()
____ open()

A

__4__ close()
__2__ lseek()
__3__ read()
__1__ open()

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

A bitmap is a simple way to keep track of which disk blocks are free (T of F)

A

True

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

What is a file system?

A data structure used to keep track where files are mapped in memory

A data structure used to keep track where files are stored on disk

A particular type of file, such as executable or script

A record keeping track of which disk blocks store an individual file

A

A data structure used to keep track where files are stored on disk

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

What are indirect pointers used for in an inode?

Point to a disk location which stores additional disk pointers, thus allowing larger file sizes

Point to a memory address at which a file is mapped

Point to the location of files stored on other nodes on the network

Point to the disk location which stores the inode table

A

Point to a disk location which stores additional disk pointers, thus allowing larger file sizes

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

The strace utility can be used to generate a list of all system calls issued during the execution of a process (t of f)

A

True

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

Check all the information that is typically stored in an inode

Pointers to blocks storing the file

File metadata

Flag describing whether the file is swapped

Access control information

A

Pointers to blocks storing the file

File metadata

Access control information

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

Match the concept to the correct definition
1. Sector
2. Block

____
Minimum granularity at which the disk can be read/written. Size defined by the disk hardware.
____
Region of disk used to store content from the same file. Size defined by the Operating System.

A

__1__
Minimum granularity at which the disk can be read/written. Size defined by the disk hardware.
__2__
Region of disk used to store content from the same file. Size defined by the Operating System.

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

Consider an open file. Where does the OS keep track of the current offset within the file?

Within the file itself

In a process-specific data structure in memory

The OS does not keep track of this information

In a protected area on disk

A

In a process-specific data structure in memory

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

The maximum size of a file in a Linux system is 60KB due to inode limitations (true or false)

A

False

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

An ______ is a data structure typically used to store the metadata for a given file, including its location on disk.

A

inode

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