0% found this document useful (0 votes)
1 views13 pages

Chapter 4

The document covers various aspects of disk space management, including file size distributions, free block tracking methods, disk quotas, backups, consistency, performance, and specific file systems like MS-DOS and UNIX V7. It discusses trade-offs in block sizes, methods for tracking free blocks, and the importance of backups for disaster recovery. Real-world examples illustrate the application of these concepts in modern systems and environments.

Uploaded by

wangminh26
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views13 pages

Chapter 4

The document covers various aspects of disk space management, including file size distributions, free block tracking methods, disk quotas, backups, consistency, performance, and specific file systems like MS-DOS and UNIX V7. It discusses trade-offs in block sizes, methods for tracking free blocks, and the importance of backups for disaster recovery. Real-world examples illustrate the application of these concepts in modern systems and environments.

Uploaded by

wangminh26
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1.

Disk Space Management (Pages 1-2)


Content Clarification:
- Figure 4-20 (Page 1): This table shows the cumulative
percentage of files smaller than a given size (in bytes) for
three datasets: VU 1984, VU 2005, and Web. For
example, 48.05% of files in VU 1984 are 1 KB or smaller,
while 99.94% of Web files are 16 MB or smaller. This
illustrates file size distributions, which are critical for
designing efficient block sizes in file systems.
- Figure 4-21 (Page 2): Describes a trade-off for 4 KB
files: a dashed curve (data rate) shows how fast data can
be read/written, while a solid curve (disk space efficiency)
shows how much space is wasted due to internal
fragmentation (when a block isn’t fully used).

Additional Knowledge:
- Block Size Impact: Smaller blocks reduce wasted space
(internal fragmentation) but increase overhead (more
metadata to track blocks). Larger blocks improve data
rate (fewer seeks) but waste space for small files.
- Context: Modern file systems like ext4 (Linux) use 4 KB
blocks by default, balancing efficiency and performance.
SSDs, unlike HDDs, have no seek time, so block size
impacts are less about physical motion and more about
metadata overhead.

Real-World Examples:
- Smartphones: Android’s ext4 or F2FS file systems use 4
KB blocks to store apps, photos, and small config files,
optimizing for mixed file sizes.
- Cloud Storage: Services like Google Drive or Dropbox
analyze file size distributions (similar to Figure 4-20) to
optimize storage allocation, often using larger blocks for
multimedia files (e.g., videos) to boost throughput.

---

2. Keeping Track of Free Blocks (Pages 3-4)


Content Clarification:
- Figure 4-22 (Page 3): Two methods to track free disk
blocks:
- (a) Linked List: Free blocks (e.g., 16, 17, 18) are linked,
with each block pointing to the next. A 1 KB block can
store 256 32-bit block numbers.
- (b) Bitmap: A binary map where 1 = used, 0 = free,
e.g., for blocks 0-15, a pattern like 1101101101111100
shows usage.
- **Figure 4-23 (Page 4):**
- (a) Shows memory holding pointers to free disk blocks,
with more on disk.
- (b) Freeing a three-block file adds those blocks to the
free list.
- (c) An alternative: store new free blocks in a separate
chain, reducing fragmentation.

**Additional Knowledge:**
- **Linked List Pros/Cons:** Fast for allocation but slow for
searching large free spaces. Used in older systems like
FAT.
- **Bitmap Pros/Cons:** Compact and efficient for finding
contiguous blocks, common in modern systems like ext4
and NTFS. A 1 TB disk with 4 KB blocks needs a 32 MB
bitmap (1 bit per block).
- **Modern Systems:** Many file systems (e.g., ZFS)
combine bitmaps with extent-based allocation (tracking
ranges of blocks) for better performance with large files.

**Real-World Examples:**
- **Linux (ext4):** Uses bitmaps to track free blocks,
enabling fast allocation for new files like logs or
downloads.
- **Windows (NTFS):** Employs a bitmap-based Master
File Table (MFT) to manage free space, critical for
handling large drives in servers or PCs.

---
### 3. Disk Quotas (Page 5)
**Content Clarification:**
- **Figure 4-24:** Disk quotas track storage usage per
user via a quota table, linked to open file tables, ensuring
users don’t exceed limits.

**Additional Knowledge:**
- **Quota Types:** Hard quotas (strict limits) and soft
quotas (warnings) control disk space and file counts.
- **Implementation:** Stored in file system metadata,
checked during write operations. Modern systems like
ext4 support user and group quotas.
- **Benefits:** Prevents one user from monopolizing
shared storage, crucial in multi-user environments.

**Real-World Examples:**
- **University Servers:** Sysadmins set quotas (e.g., 10
GB per student) to manage shared storage for
assignments and projects.
- **Cloud Hosting:** Providers like AWS or Azure use
quotas to limit disk usage for virtual machines, ensuring
fair resource distribution.

---
### 4. File System Backups (Pages 6-8)
**Content Clarification:**
- **Page 6:** Backups address:
1. Disaster recovery (e.g., hardware failure).
2. User errors (e.g., accidental deletion).
- **Figure 4-25 (Page 7):** A file system with directories
(squares) and files (circles), labeled by i-node numbers.
Shaded items are modified since the last dump, targeted
for incremental backups.
- **Figure 4-26 (Page 8):** Bitmaps for logical dumping:
- (a) Initial state of blocks.
- (b-d) Steps in marking and dumping modified blocks,
using 1s and 0s to track changes.

**Additional Knowledge:**
- **Backup Types:** Full backups copy everything;
incremental backups copy only changes since the last
backup, faster and smaller.
- **I-nodes:** Store metadata (size, location,
timestamps), key for identifying modified files.
- **Modern Tools:** Rsync (Linux) uses similar logic to
Figure 4-26, checking timestamps and checksums for
efficient backups.
**Real-World Examples:**
- **Corporate IT:** Companies use tools like Veeam or
Acronis to back up servers incrementally, recovering from
ransomware or crashes.
- **Personal Use:** Google Photos backs up new or
modified photos daily, similar to the shaded items in
Figure 4-25, saving bandwidth.

---

### 5. File System Consistency (Page 9)


**Content Clarification:**
- **Page 9:** Repeated bitmaps (e.g.,
1101101101111100011111000) show blocks in use.
Consistency checks ensure the bitmap matches actual
block usage and file metadata (e.g., i-nodes).

**Additional Knowledge:**
- **Consistency Issues:** Crashes can leave mismatches
(e.g., a block marked free but used by a file). Tools like
fsck (Linux) scan bitmaps and i-nodes to fix this.
- **Journaling:** Modern file systems (e.g., ext4, NTFS)
use journals to log changes, reducing inconsistency after
power failures.
- **Checks:** Verify no block is allocated to multiple files
and all file blocks are marked used.

**Real-World Examples:**
- **Linux Servers:** After a crash, fsck checks ext4 file
systems, repairing bitmap errors to prevent data loss.
- **SSDs:** Tools like TRIM ensure free blocks are
correctly marked, maintaining consistency in NVMe
drives.

---

### 6. File System Performance (Pages 10-11)


**Content Clarification:**
- **Figure 4-28 (Page 10):** Buffer cache stores recently
used blocks in memory to reduce disk access.
- **Page 11:** A modified LRU (Least Recently Used)
scheme considers:
1. Likelihood of block reuse.
2. Importance to file system consistency (e.g., i-nodes,
directory blocks).

**Additional Knowledge:**
- **Caching:** Buffer caches speed up reads/writes by
keeping data in RAM. Write-back caching delays disk
writes for efficiency.
- **LRU Variants:** Modern systems like Linux use a two-
list LRU (active/inactive) to prioritize frequently accessed
blocks.
- **SSD Impact:** Caching remains vital for SSDs, though
access times are faster than HDDs.

**Real-World Examples:**
- **Databases:** MySQL uses buffer pools to cache table
data, reducing disk I/O for queries.
- **Operating Systems:** Windows caches file data in
RAM, speeding up access to frequently used apps like
browsers.

---

### 7. Reducing Disk Arm Motion (Page 12)


**Content Clarification:**
- **Figure 4-29:**
- (a) I-nodes at disk start cause arm movement for data
access.
- (b) Cylinder groups localize i-nodes and data,
minimizing seek time.
**Additional Knowledge:**
- **Seek Time:** On HDDs, the arm moves to position the
read/write head, a slow mechanical process.
- **Cylinder Groups:** Used in FFS (Fast File System) and
ext2, grouping related data reduces seek latency.
- **SSD Relevance:** No moving parts, so this is less
critical, but locality still aids sequential reads.

**Real-World Examples:**
- **HDD Servers:** Older database servers used cylinder
groups in ext2 to speed up file access.
- **Modern Drives:** SSDs in laptops (e.g., NVMe in
MacBooks) benefit from locality for sequential reads,
though seek time isn’t a factor.

---

### 8. The MS-DOS File System (Pages 13-14)


**Content Clarification:**
- **Figure 4-30 (Page 13):** MS-DOS directory entry
stores file metadata (name, size, etc.).
- **Figure 4-31 (Page 14):** Maximum partition sizes for
FAT file systems:
- FAT-12: 16 MB (4 KB blocks).
- FAT-16: 2 GB (32 KB blocks).
- FAT-32: 2 TB (8-32 KB blocks).

**Additional Knowledge:**
- **FAT Limitations:** FAT-12/16/32 use a File Allocation
Table to track clusters, but large cluster sizes waste space
(slack).
- **Modern Replacement:** NTFS and exFAT support
larger partitions and files, with better reliability.
- **Cluster Size:** Larger clusters improve performance
but increase wasted space for small files.

**Real-World Examples:**
- **USB Drives:** Older drives used FAT-32 for
compatibility, limited to 2 TB partitions and 4 GB files.
- **SD Cards:** exFAT, a FAT successor, is used in SDXC
cards for large files (e.g., 4K videos).

---

### 9. The UNIX V7 File System (Pages 15-17)


**Content Clarification:**
- **Figure 4-32 (Page 15):** UNIX V7 directory entry: 2
bytes for i-node number, 14 for file name.
- **Figure 4-33 (Page 16):** UNIX i-node stores file
metadata (size, blocks, etc.).
- **Figure 4-34 (Page 17):** Path lookup for /usr/ast/mbox:
root i-node 1 points to block 132 (/usr), then block 406
(/usr/ast), then file mbox.

**Additional Knowledge:**
- **I-nodes:** Store file metadata, not names; directories
map names to i-nodes.
- **Limitations:** V7 had fixed i-node tables, limiting file
count. Modern UNIX (e.g., ext4) uses dynamic allocation.
- **Path Resolution:** Recursive lookup from root to file,
critical for navigation.

**Real-World Examples:**
- **Linux:** Ext4 uses i-nodes for files like
/home/user/doc, enabling fast metadata access.
- **Servers:** Path lookups are used when accessing
/var/log/syslog for troubleshooting.

---
### 10. The ISO 9660 File System & Extensions (Pages
18-20)
**Content Clarification:**
- **Figure 4-35 (Page 18):** ISO 9660 directory entry for
CDs, with padding for alignment.
- **Rock Ridge Extensions (Page 19):** Add POSIX
attributes, symbolic links, long names, etc.
- **Joliet Extensions (Page 20):** Support long names,
Unicode, deep directories, and extensions.

**Additional Knowledge:**
- **ISO 9660:** Standard for CDs, limited to 8.3 names
and 8-level directory depth.
- **Rock Ridge:** Enhances UNIX compatibility with
permissions and links.
- **Joliet:** Windows-friendly, supports Unicode for global
use.

**Real-World Examples:**
- **CDs/DVDs:** ISO 9660 is used for bootable discs (e.g.,
Linux install CDs).
- **Software Distribution:** Joliet allows long names for
files like “setup_windows_10.exe” on DVDs.
---

If you’d like a chart (e.g., to visualize file size distributions


from Figure 4-20 or partition sizes from Figure 4-31),
please confirm, and I can generate one for you. Let me
know if you’d like deeper focus on any section!

You might also like