What is a file?
A named collection of related information recorded on secondary storage.
What determines the meaning of information in a file?
Its creator and user.
How are a file’s information and structure determined?
By its creator, depending on the file type.
Which attributes are typical for a file?
Name, identifier, type, location, size, protection, and creation, modification, and use time, date, and user identification.
What two steps are required to create a file?
Find space in the file system and add an entry to the directory.
What advances after each file read or write operation?
The file-position pointer advances after each operation.
What happens when a file is truncated?
Its contents are released and its length is reset to zero, while its attributes are preserved.
What file structure must an operating system support to load and run programs?
An executable-file structure.
How does sequential access process file information?
In order, one record after another.
Which operations advance the file pointer in sequential access?
Read-next and write-next operations.
How does direct access identify a file block to read or write?
By specifying its block number.
Which operations can file protection control?
Reading, writing, executing, appending, deleting, and listing.
What does an access-control list associate with each file or directory?
User names and their permitted access types.
Which user classes does a compact file-protection scheme define?
Owner, group, and universe.
What access may the three permission fields encode as rwx bits?
Read, write, and execute access.
Which structures are stored on disk for each file system?
A boot control block and volume control block per volume, a directory structure, and a file control block per file.
Which structures are kept in memory by a file system?
A mount table, directory-structure cache, system-wide and per-process open-file tables, and buffers for blocks being read or written.
What does opening a file create in a process's open-file table?
An entry pointing to the file's system-wide open-file-table entry.
What happens to a file control block when a file is opened?
It is copied into the system-wide open-file table if needed.
How does a linear-list directory find a file entry?
By performing a linear search.
What information does a linear-list directory store in each entry?
A file name and a pointer to its data blocks.
What does a hash-table directory compute from a file name?
A value used to return a pointer to the corresponding name in a linear list.
How does contiguous allocation store a file on disk?
In a consecutive run of disk blocks.
What file-location details does a contiguous-allocation directory entry record?
The starting block and allocated length.
Which access methods does contiguous allocation support?
Sequential and direct access.
What disk-seek requirement does contiguous allocation usually have?
It usually requires few disk seeks.
Which strategies commonly choose a free hole in contiguous allocation?
First-fit and best-fit.
How does linked allocation represent a file across disk blocks?
Each block points to the next, while the directory records the first and last blocks.
What fragmentation and growth benefits does linked allocation provide?
It avoids external fragmentation and lets files grow as free blocks become available without disk compaction.
How does linked allocation handle sequential access?
It supports sequential access efficiently.
Why is direct access inefficient in linked allocation?
Finding a particular block requires following pointers from the beginning.
What does indexed allocation store in each file’s index block?
The addresses of the file’s data blocks.
What address does the directory store for an indexed-allocation file?
The address of its index block.
In indexed allocation, what does the ith index-block entry point to?
The ith file block.
What fragmentation does indexed allocation avoid?
External fragmentation.
How do magnetic disks organize information on platter surfaces?
Platter surfaces are divided into tracks and sectors.
What forms a cylinder on a magnetic disk?
Tracks at the same arm position.
Which two components make up magnetic-disk positioning time?
Seek time and rotational latency.
Why can an SSD outperform a magnetic disk?
It has no moving parts, seek time, or rotational latency.
How does SSD reliability compare with magnetic disks?
SSDs can be more reliable than magnetic disks.
What does disk scheduling select when a drive or controller is busy?
Which pending disk I/O request to service next.
How far does SSTF move the head for the example queue starting at cylinder 53?
236 cylinders.
What does SCAN do after moving the disk arm from one end to the other?
It reverses direction.
What distinguishes C-SCAN from SCAN when the arm returns across the disk?
C-SCAN does not service requests on the return trip.
What does low-level formatting create on a blank magnetic disk?
Sectors containing a header, data area, and trailer.
What are the two steps for preparing a disk for file storage?
Partitioning it into cylinder groups, then logically formatting it with initial file-system structures.
How is a text file organized?
As characters arranged into lines and possibly pages.
How is a source file organized?
As functions containing declarations followed by executable statements.
What can a loader do with code sections in an executable file?
Bring them into memory and execute them.
How does a file name differ from its identifier?
A name is human-readable; an identifier is a unique, usually numeric, non-human-readable file-system tag.
What does a file’s location attribute record?
The device and location where the file is stored.
What does seeking change without necessarily performing I/O?
The current file-position pointer.
What does the system-wide open-file table store?
Process-independent file information and an open count.
What commonly indicates a file’s type to users and the operating system?
Its file extension.
How does index access locate a file block?
It searches an index of pointers and follows the relevant pointer.
How does an operating system decide access under an access-control list?
It checks whether the requesting user is listed for the requested operation, then allows or denies access.
What drawback do per-file passwords create for users?
Users must remember multiple passwords.
What happens if a shared password for all files is discovered?
Protection becomes all-or-none.
How can duplicate file copies help after accidental file-system destruction?
They can provide reliability through backups such as disk-to-tape copies.
What is the UFS volume control block called?
The superblock.
Where is NTFS volume information stored?
In the master file table.
What happens to the system-wide open count when a file is closed?
It is decremented after the per-process entry is removed.
What happens when a file's system-wide open count reaches zero?
Updated metadata is written back and the system-wide entry is removed.
How can a deleted linear-list directory entry be handled?
It can be marked unused, linked to a free-entry list, or replaced by the last entry as the directory shrinks.
How does a chained-overflow hash table resolve collisions?
It stores each hash entry as a linked list and adds colliding entries to that list.
Which blocks does a contiguous file of n blocks starting at b occupy?
Blocks b through .
How does compaction reduce external fragmentation in contiguous allocation?
It relocates files to create one large free region.
What can preallocating a file’s final size cause?
Internal fragmentation that wastes space.
What overhead can clustering reduce in linked allocation, and what can it increase?
Clustering reduces pointer overhead but can increase internal fragmentation.
What can a damaged pointer do to a linked-allocation file?
It can mislink the file into the free-space list or another file.
What are partial solutions to damaged pointers in linked allocation?
Doubly linked lists or storing file names and relative block numbers in blocks.
What does each file-allocation table entry represent?
It points to the next block in a file, with a special value marking the final block.
How does indexed allocation’s pointer overhead compare with linked allocation’s?
It is generally greater.
How can indexed allocation support large files?
By linking index blocks, using multilevel indexes, or combining direct and indirect inode pointers.
In the combined inode scheme, what do the first 12 pointers address?
Direct data blocks.
With 4 KB blocks and 12 direct pointers, how much file data can the combined scheme directly access?
48 KB.
What determines disk bandwidth?
Bytes transferred divided by the time from the first service request to completion of the last transfer.
What causes a head crash on a magnetic disk?
A disk head damages a platter’s magnetic surface.
How does SSD cost per megabyte compare with hard disks?
SSDs are more expensive per megabyte.
In what order does FCFS service disk requests?
Arrival order.
How far does FCFS move the head for the stated queue starting at cylinder 53?
640 cylinders.
Why can SSTF cause starvation?
Nearby requests may indefinitely delay a request farther from the current head position.
Where do LOOK and C-LOOK reverse or wrap around?
At the final request in the current direction.
How large is a sector’s data area usually?
512 bytes.
What information can a sector’s header and trailer contain?
The sector number and an error-correcting code.
What does a disk controller do with an error-correcting code during writes and reads?
It stores the code when writing and recalculates it when reading to detect corruption.
What can initial file-system structures include?
Maps of free and allocated space and an empty directory.
How can grouping blocks into clusters affect efficiency?
It can improve efficiency.
What distinguishes raw I/O from logical formatting?
Raw I/O accesses logical blocks without file-system structures; logical formatting creates those structures for file-based use.
Answer 34 questions on File Systems and Storage Management.
1. Which description best defines a file in an operating system?
2. Two files contain different kinds of data and have different internal organizations. What best explains this difference?
Go over the full study guide for File Systems and Storage Management.
Read the study guide →Upload your class notes and Revizly writes your flashcards in about a minute.
Flashcard maker