Phase 6Ch 6.1 File systems
ACompressed recap
File = attributes + operations; per-process table holds the file pointer, system-wide table the open count. Access: sequential, direct, indexed. Directories: tree with absolute/relative paths; hard link = same inode (link count), soft link = path. rwx bits r4 w2 x1. Allocation: contiguous (start + b), linked (b + 1 reads; FAT one entry per block), indexed/inode (direct + k + k² + k³) × B with k = B/P. Bitmap = blocks/8 bytes.
BMerged rule card
6.1.1 Files, directories and access methods
- File: attributes + operations; open() returns a descriptor; seek moves the pointer.
- System-wide table (open count) + per-process table (file pointer).
- Access: sequential, direct, indexed. Directories: single, two-level, tree (absolute/relative paths), acyclic graph, general graph.
- Hard link = same inode, link count; soft link = path (can dangle).
- UNIX rwx bits: owner/group/others, r4 w2 x1 (e.g. 754 = rwxr-xr--).
6.1.2 Allocation methods: contiguous, linked (FAT), indexed (inodes); free space
- Contiguous: (start, length), block b = start + b; external fragmentation.
- Linked: next pointers; block b needs b + 1 reads. FAT = one entry per disk block, cached.
- Indexed/inode: k = B/P; max size = (direct + k + k² + k³) × B; reads: direct 1, single 2, double 3, triple 4.
- Free space: bitmap (blocks/8 bytes), linked list, grouping, counting.
CInterleaved GATE-style questions
Q1 · NAT · 1 mark(s) — Permissions
Octal value of r-xr-xr-x?
Numerical answer: ________
Q2 · MCQ · 1 mark(s) — Soft link
A symbolic link's target is deleted. The link:
- (A) becomes dangling: opening it fails
- (B) is deleted automatically
- (C) becomes a hard link
- (D) still opens the old data
Q3 · MCQ · 1 mark(s) — Directories
In a tree-structured directory, a relative path starts from:
- (A) the root
- (B) the current working directory
- (C) the user's home directory always
- (D) the disk's first block
Q4 · NAT · 2 mark(s) — Inode
Inode with 10 direct, 1 single and 1 double indirect pointer; block 2 KB; pointer 4 bytes. Maximum file size in MB (2 decimals)?
Numerical answer: ________
Q5 · NAT · 1 mark(s) — Linked
Linked allocation (no FAT): how many disk reads to reach block 49 of a file (blocks numbered from 0)?
Numerical answer: ________
Q6 · NAT · 1 mark(s) — Contiguous
A contiguous file starts at block 1200. Which disk block holds file block 35?
Numerical answer: ________
Q7 · NAT · 2 mark(s) — Bitmap
A 64 GB disk has 8 KB blocks. Free-space bitmap size in KB?
Numerical answer: ________
Q8 · MCQ · 1 mark(s) — FAT
A FAT has one entry for each:
- (A) file
- (B) directory
- (C) disk block
- (D) inode
DAnswer Vault
Try the questions first. Open when you are ready to check.
🔐 Open the Answer Vault
Q1 Answer: 555 · 1 mark(s)
5 for each group.
Re-read: Lesson 6.1.1 — Files, directories and access methods
Q2 Answer: (A) · 1 mark(s)
It only stores a path.
- (B) is wrong: Not automatically.
- (C) is wrong: No.
- (D) is wrong: The data is gone.
Re-read: Lesson 6.1.1 — Files, directories and access methods
Q3 Answer: (B) · 1 mark(s)
Absolute paths start at the root.
- (A) is wrong: That is absolute.
- (C) is wrong: Only if that is the current directory.
- (D) is wrong: No.
Re-read: Lesson 6.1.1 — Files, directories and access methods
Q4 Answer: 513.01 to 513.03 · 2 mark(s)
k = 512; (10 + 512 + 262144) × 2 KB.
Re-read: Lesson 6.1.2 — Allocation methods: contiguous, linked (FAT), indexed (inodes); free space
Q5 Answer: 50 · 1 mark(s)
Blocks 0 to 49.
Re-read: Lesson 6.1.2 — Allocation methods: contiguous, linked (FAT), indexed (inodes); free space
Q6 Answer: 1235 · 1 mark(s)
1200 + 35.
Re-read: Lesson 6.1.2 — Allocation methods: contiguous, linked (FAT), indexed (inodes); free space
Q7 Answer: 1024 · 2 mark(s)
2²³ blocks → 2²³ bits = 2²⁰ bytes.
Re-read: Lesson 6.1.2 — Allocation methods: contiguous, linked (FAT), indexed (inodes); free space
Q8 Answer: (C) · 1 mark(s)
Each entry gives the next block of the chain.
- (A) is wrong: Files are chains in the table.
- (B) is wrong: No.
- (D) is wrong: FAT systems don't use inodes.
Re-read: Lesson 6.1.2 — Allocation methods: contiguous, linked (FAT), indexed (inodes); free space