Memory and Storage
Memory and storage management are essential operating system functions that determine how data and programs are stored, accessed, allocated, and managed.
This section covers memory allocation, paging, segmentation, virtual memory, file systems, file management, and disk storage.
What You'll Learn
- Understand the difference between memory and storage.
- Learn how operating systems allocate and manage memory.
- Explore paging, segmentation, and virtual memory.
- Understand file systems and directory structures.
- Learn file allocation and file management techniques.
- Explore disk management and disk scheduling.
- Understand how efficient memory and storage management affects performance.
Lessons
1. Memory Management
Learn how an operating system tracks memory usage and allocates memory to running programs.
Topics include:
- Memory management fundamentals
- Logical and physical addresses
- Memory allocation strategies
- Contiguous and non-contiguous allocation
- Internal and external fragmentation
2. Memory Allocation
Understand how memory is assigned to processes and how allocation strategies affect system efficiency.
Topics include:
- Fixed and variable partitioning
- First Fit, Best Fit, and Worst Fit
- Allocation and deallocation
- Fragmentation and compaction
3. Paging
Explore how memory is divided into fixed-size pages and frames to support non-contiguous memory allocation.
Topics include:
- Pages and frames
- Page tables
- Address translation
- Internal fragmentation
- Basic page replacement concepts
4. Segmentation
Learn how memory can be divided into logical segments representing parts of a program.
Topics include:
- Segment tables
- Logical address structure
- Segment-based address translation
- Protection and sharing
- External fragmentation
- Paging versus segmentation
5. Virtual Memory
Understand how operating systems provide processes with a virtual address space that is mapped to physical memory.
Topics include:
- Virtual memory fundamentals
- Demand paging
- Page faults
- Page replacement algorithms
- Working sets and thrashing
- Virtual versus physical memory
6. File Systems
Learn how operating systems organize, store, retrieve, and protect files on storage devices.
Topics include:
- File system fundamentals
- File and directory structures
- File metadata
- File system types
- Permissions and access control
- File system mounting
7. File Management
Explore how files are created, opened, read, written, renamed, and deleted.
Topics include:
- File operations
- File attributes and metadata
- File access methods
- File permissions
- File ownership
- File handling and protection
8. Directory Management
Understand how directories organize files and how operating systems manage directory structures.
Topics include:
- Directory structures
- Absolute and relative paths
- Directory operations
- Hierarchical organization
- Directory permissions
- File and directory navigation
9. File Allocation
Learn how file systems assign storage blocks to files.
Topics include:
- Contiguous allocation
- Linked allocation
- Indexed allocation
- Allocation methods comparison
- Fragmentation and storage efficiency
10. Storage Fundamentals
Understand the storage technologies used to retain operating system files, applications, and user data.
Topics include:
- Primary versus secondary storage
- HDDs and SSDs
- Volatile and non-volatile memory
- Storage capacity and performance
- Storage hierarchy
- Basic storage terminology
11. Disk Management
Learn how operating systems prepare, organize, and manage disks and partitions.
Topics include:
- Disk initialization
- Partitioning
- Formatting
- Mounting and unmounting
- Disk space monitoring
- Basic disk maintenance
12. Disk Scheduling
Explore how operating systems organize disk I/O requests to improve performance.
Topics include:
- Disk scheduling fundamentals
- FCFS
- SSTF
- SCAN
- C-SCAN
- LOOK and C-LOOK
- Seek time and scheduling comparisons
Recommended Learning Path
- Memory Management
- Memory Allocation
- Paging
- Segmentation
- Virtual Memory
- File Systems
- File Management
- Directory Management
- File Allocation
- Storage Fundamentals
- Disk Management
- Disk Scheduling
Key Concepts Comparison
| Concept | Main Purpose |
|---|---|
| Memory management | Manages RAM allocation and usage |
| Paging | Divides memory into fixed-size pages and frames |
| Segmentation | Organizes memory into logical segments |
| Virtual memory | Provides a virtual address space for processes |
| File system | Organizes files and directories |
| File allocation | Maps files to storage blocks |
| Disk scheduling | Orders disk I/O requests |
Practical Activities
- Check RAM usage using
free -hon Linux. - Inspect memory and process usage using
top. - Check disk space using
df -h. - Examine directory and file sizes using
du -sh. - List block devices using
lsblk. - Inspect mounted file systems using
findmnt. - Compare HDD and SSD characteristics.
- Solve paging, memory allocation, and disk scheduling problems on paper.
Use administrative commands carefully, particularly those that partition, format, or modify disks.
Practice Questions
- What is the difference between memory and storage?
- Explain internal and external fragmentation.
- Differentiate between paging and segmentation.
- What is virtual memory?
- What causes a page fault?
- Compare First Fit, Best Fit, and Worst Fit.
- What is the role of a file system?
- Compare contiguous, linked, and indexed file allocation.
- Differentiate between HDDs and SSDs.
- Explain FCFS, SSTF, SCAN, and C-SCAN disk scheduling.
- What is the difference between an absolute path and a relative path?
- How can you check memory usage and available disk space on Linux?
Next Steps
After completing this section, continue to:
- System and Device Management — Learn about booting, interrupts, system calls, and I/O.
- Commands and Troubleshooting — Practice inspecting memory, disks, and file systems.
- Virtualization and Containers — Understand how virtual environments use system resources.
Ugenz Academy — Learn • Build • Protect • Grow.