Quiz 9 Flashcards
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
Keep a supporting structure such as a free block bitmap
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
Change the current offset within the file
A superblock is a special type of inode used to store a very large file (true or false)
false
When successful, the open() system call returns a ____ descriptor, i.e., an integer identifying that particular open file.
file
The superblock should be stored at a predictable offset on the disk so the OS can find it easily. (True or False)
True
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()
__4__ close()
__2__ lseek()
__3__ read()
__1__ open()
A bitmap is a simple way to keep track of which disk blocks are free (T of F)
True
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 data structure used to keep track where files are stored on disk
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
Point to a disk location which stores additional disk pointers, thus allowing larger file sizes
The strace utility can be used to generate a list of all system calls issued during the execution of a process (t of f)
True
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
Pointers to blocks storing the file
File metadata
Access control information
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.
__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.
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
In a process-specific data structure in memory
The maximum size of a file in a Linux system is 60KB due to inode limitations (true or false)
False
An ______ is a data structure typically used to store the metadata for a given file, including its location on disk.
inode