File System Management Flashcards
What are the essential requirements for long-term information storage in a file system?
- Ability to store a large amount of information
- Information must survive process termination
- Concurrent access by multiple processes
Define “File” in the context of file systems
A file is an abstraction for a collection of blocks on disk, persistent, named, and provides convenient sequential or random access
What is the purpose of the Master Boot Record (MBR) in a file system layout?
The MBR (sector 0) contains information to allow the OS to boot from the disk
List the primary file operations
- Create, make a new file
- Delete, remove a file
- Open/Close, manage file metadata in memory
- Read/Write, handle data operations
- Seek, change the current position for access
- Rename, change the file’s name
What are the advantages of contiguous file allocation?
- Easy implementation
- Excellent read performance due to minimal seeking
What is the main disadvantage of using linked list allocation for file systems?
Random access is very slow because accessing any specific block requires traversing the list sequentially
Explain the purpose of i-nodes in file systems
I-nodes store attributes and disk addresses for file blocks, requiring only i-nodes for open files to be in memory
What are the two types of file system backups?
- Full backup, copies the complete state of storage
- Incremental backup, records only files updated since the last backup
How do symbolic links differ from hard links in shared files?
- Symbolic links, point to the pathname of the original file
- Hard links, directly reference the same i-node as the original file
What is the trade-off in choosing the block size for disk space management?
Larger block sizes reduce overhead but increase internal fragmentation, while smaller block sizes require more overhead and links
How do you calculate Turn-around Time and Waiting Time in scheduling algorithms like FCFS, SJF, Round Robin, and Priority-based?
- Turn-around Time = Completion Time - Arrival Time
- Waiting Time = Turn-around Time - Burst Time
How are read and lseek system calls used in UNIX?
- read(fd, buffer, count), reads count bytes from the file descriptor fd into buffer
- lseek(fd, offset, whence), moves the file pointer by offset based on whence (SEEK_SET, SEEK_CUR, or SEEK_END)
What is the purpose of the magic number in an executable file’s header in UNIX?
The magic number identifies the file type and format. It is specific and not random
Differentiate between internal fragmentation and external fragmentation
- Internal Fragmentation, unused space within allocated blocks
- External Fragmentation, unused space outside allocated blocks due to scattered free memory
Compare contiguous allocation, linked list allocation, and table/indexed allocation
- Contiguous Allocation, fast access but prone to fragmentation
- Linked List Allocation, eliminates fragmentation but slow random access
- Table/Indexed Allocation, good random access, requires extra memory for indices