1/84
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is the primary purpose of a file system?
to enable persistent data storage and organize, protect, and manage stored info
True or False: A file is a randomly generated collection of data in storage
false, a file is logically named unit of persistent storage
Name two examples of storage media where file systems operate
hard disks, SSDs, or tapes
what are the methods of identifying file types
file extensions, magic numbers, file attributes, file contents analysis
file control block (FCB)
a structure that maintains file attributes and location info
what happens when an FCB is loaded into memory
it becomes a file descriptor, temporarily allocated by the OS to manage an active file
what are the 2 ways to access file
sequential access or random access, depending on the storage medium
What is sequential access in file systems
file are read/written one record at a time, in order; tapes and pipes
What is random access in file systems
enabled by disk-based storage, allowing direct access to any part of a file (seek operations)
Sequential access tapes are widely used for backups (T/F)
true
why is tape storage still used
longevity and archival stability
In UNIX systems, what structure is equivalent to Windows' FCBs?
innodes
Linux links don’t allow a single file to exist in multiple directories (T/F)
false, they do allow via file system links
innode
a data structure that stores file metadata, excluding name and content
What major change happened to file system organization as time-sharing systems evolved
Introduction of per-user directories and nested directories
what is a link in UNIX
a pointer to a filethat allows multiple directory entries to reference the same file.
2 types of links
hard and symbolic (soft)
How is a hard link different from a symbolic link
Hard link → Same inode, direct reference to data.
Symbolic link → Stores path to another file.
files in UNIX systems can be created with what commands
touch, cat, echo
when does linking and unlinking occur?
when a file is created, hard link is established; when a file is deleted, it’s unlinked
Name one restriction of hard links
they can’t span across different file systems
What happens to a file when its link count drops to zero
the file is permanently deleted
POSIX
defines standards for Unix-based operating systems, enabling cross-platform software development
True or False: POSIX defines exactly how every operating system must implement file operations
false, it defines the standards, but OSs can add extensions
files are stored on disks using 4 primary allocation methods:
contiguous, linked, chained, and indexed
which file allocation methods use hybrid methods
chained indexed and multi-level indexed
file allocation relies on 4 operations:
Read block at index “k”
Write block at index “k”
Allocate a block
Deallocate a block
in Unix, directories are organized in what structure?
hierchical, with the root directory at the top
What character separates directory elements in Unix paths
A forward slash (/)
True or False: In Windows, paths use a forward slash (/)
False — Windows uses a backslash ()
absolute path
a path that starts from the root directory
What does ".." (dot-dot) refer to in Unix
the parent directory
What does "." (single dot) represent in Unix
the current directory
True or False: Relative paths are always defined starting from the root
false, relative paths start from the current directory
absolute vs relative paths
absolute - defined in relation to the root directory
relative - defined in relation to the current directory
in-line approach
stores attributes and names sequentially; rigid structure (fixed positions)
What is the main drawback of in-line directory naming
fragmentation when renaming or deleting files
reference-based approach
separates attributes (fixed size) from names (variable size)
How does a reference-based naming system help file management
it separates file names from attributes and allows flexible name changes, reducing fragmentation
what are common directory data structures
linear list, linked lists, b-trees, and hash tables
unix file system mounting process
root file system is automatically mounted
mount table structure updated
file system checks
True or False: Windows requires manual filesystem mounting by users
false, windows mounts filesystems automatically; unix typically requires manual mounting
What is filesystem mounting
attaching a filesystem to the system’s directory tree, making it accessible
virtual filesystem (VFS)
An abstraction layer that hides filesystem-specific details from userspace programs; acts as the interface between users and file systems
VFS operates between …
upper and lower layer
VFS upper layer
system call layer where a userspace process traps into the kernel to request a service
accessed with libc wrapper function
VFS lower layer
contains functions pointers
allows VFS to delegate operations
glue between application requests and filesystem-specific actions
VFS connects userspace programs with filesystems using what
callback functions like read() and write()
file objects in VFS
represents an open file, containing data such as flags and offset
dentry (directory entries)
linkes inodes to file names, acting as the connector between filesystem elements
What is stored in a dentry cache (dcache)
mappings from paths to dentries to speed up file lookup
True or False: Dentries store file data content
false, they store name-to-inode mappings, not data
What does the struct filesystem_type in VFS describe
the type of supported filesystem (e.g., ext4, NTFS)
What happens before a filesystem can be mounted
it must be recognized by the kernel (registered filesystem type)
What is an inode in Unix/Linux
a structure storing metadata abt a file (not the file’s name or content)
What problem does inode use solve for large files
manages fragmentation by tracking which blocks store file pieces
What is a superblock in a filesystem
a structure containing essential metadata abt the mounted filesystem
What kind of information does a superblock contain
filesystem size, inode list, function pointers for filesystem operations
True or False: Each filesystem has exactly one superblock loaded in memory
false, there can be multiple superblocks linked for multiple mounts
What role do super_operations play in VFS
They define function pointers for actions like file creation, deletion, etc., specific to each filesystem
Why is VFS important for portability across different filesystems
it abstracts differences, allowing program to work across ext4, NTFS, and more w/o changes
In contiguous allocation, how are file blocks stored
in sequential, adjacent blocks on the disk
what are the advantages of contiguous allocation
fast performance and simple file access
what are the challenges with contiguous allocation
external fragmentation and file growth issues
What happens if a file in contiguous allocation outgrows its allocated space
it must be relocated or aborted
In linked list allocation, what does each block store
a pointer to the next block
what are the advantages of linked list allocation
no external fragmentation and doesn’t require predefined file sizes
what are the challenges of linked list allocation
random access is inefficient, pointer overhead consumes storage space, loss or corruption of pointers
file allocation table (FAT)
a table-based version of linked allocation that stores block links separately from file data
How does FAT improve file access compared to basic linked allocation
caching the table improves random access speed
In FAT, where is the chain of block links stored
in a separate table at the beginning of the disk
What is the main idea behind indexed allocation
each file has an index block storing pointers to all its data blocks
what are the challenges with indexed allocation
wastes disk space and there’s a file size limitation
what are potential solutions to overcome indexed allocation limits
multi-leveled indexed allocation, file size calculation, chained indexed allocation, and UNIX inodes,
multi-leveled indexed allocation
a file allocation method that uses multiple levels of index blocks to manage large files and reduce limitations in size and efficiency.
How does two-level indexed allocation work
Primary index points to secondary indices
Secondary indices point to data blocks
What drawback does multi-level indexing have for small files
wastes storage - even small files need multiple index blocks
How is chained indexed allocation different from multi-level indexing
Chained: First entry in an index block points to the next index block.
Multi-level: Structured tree-like layers of index blocks
what are advantages with chained indexed allocation
files can grow indefinitely and there’s less wasted space
what’s a downside with chained indexed allocation
small files may waste blocks
What is the hybrid allocation scheme used by Unix inodes
First 12 data blocks stored directly in the inode.
Indirect pointers for larger files
what are the advantages with UNIX inodes
small files are directly accessible, some files use only a single indirect block, huge files = few disk accesses
True or False: Unix inode allocation allows fast access for both small and large files
true
Why might an OS switch from contiguous to indexed allocation mid-way
to support file growth once the file exceeds a thresholdand to improve disk space utilization.
Why are linked list allocation methods better for sequential access
they naturally follow the sequential structure of files