What is the Virtual File System (VFS)?
A kernel abstraction layer that provides a uniform interface for all filesystem types.
What are the main VFS objects?
Superblock, Inode, Dentry, and File objects.
What does a Superblock represent?
A mounted filesystem, containing metadata and pointers to filesystem operations.
What does an Inode represent?
A file or directory with metadata such as permissions, owner, timestamps, and data pointers.
What is a Dentry object used for?
Represents a directory entry; links a filename to an inode and speeds up path lookups.
What is the purpose of the dentry cache (dcache)?
Speeds up file path resolution by caching directory lookups.
What is a File object in VFS?
Represents an open file instance for a process, including position and access mode.
What is the relationship between File, Dentry, and Inode objects?
File → Dentry → Inode → Data Blocks.
What command shows mounted filesystems?
mount or cat /proc/mounts
What does /etc/fstab store?
Persistent mount configuration for filesystems.
What is the function of mkfs.ext4?
Creates an ext4 filesystem on a partition or disk.
What are common ext4 features?
Extents, journaling, delayed allocation, multiblock allocation, and checksumming.
What is journaling in filesystems?
Records metadata (and optionally data) updates before committing to prevent corruption.
What are block devices?
Devices that transfer data in fixed-size blocks, e.g., hard drives and SSDs.
What is the typical block size in Linux?
Usually 4KB, must be a multiple of the sector size.
What is a buffer cache for filesystems?
Stores metadata and file system structure data for block devices.
What is the page cache?
Caches file data in memory to minimize disk I/O.
What are write-through and write-back policies?
Write-through: immediately write to disk; Write-back: defer writes, mark pages dirty.
How does Linux decide which pages to evict from cache?
Uses an active and inactive LRU list algorithm.
What command forces all dirty pages to disk?
sync
How do you drop page cache manually?
echo 1 > /proc/sys/vm/drop_caches
What are hard and soft links?
Hard link: same inode; Soft link: separate inode pointing to a path.
What command creates a hard link?
ln existing_file new_link
What command creates a soft (symbolic) link?
ln -s target link_name