Filesystem, Disk I/O, & Kernel Internals Flashcards

(33 cards)

1
Q

What is the Virtual File System (VFS)?

A

A kernel abstraction layer that provides a uniform interface for all filesystem types.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the main VFS objects?

A

Superblock, Inode, Dentry, and File objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does a Superblock represent?

A

A mounted filesystem, containing metadata and pointers to filesystem operations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does an Inode represent?

A

A file or directory with metadata such as permissions, owner, timestamps, and data pointers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a Dentry object used for?

A

Represents a directory entry; links a filename to an inode and speeds up path lookups.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the purpose of the dentry cache (dcache)?

A

Speeds up file path resolution by caching directory lookups.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a File object in VFS?

A

Represents an open file instance for a process, including position and access mode.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the relationship between File, Dentry, and Inode objects?

A

File → Dentry → Inode → Data Blocks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What command shows mounted filesystems?

A

mount or cat /proc/mounts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does /etc/fstab store?

A

Persistent mount configuration for filesystems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the function of mkfs.ext4?

A

Creates an ext4 filesystem on a partition or disk.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are common ext4 features?

A

Extents, journaling, delayed allocation, multiblock allocation, and checksumming.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is journaling in filesystems?

A

Records metadata (and optionally data) updates before committing to prevent corruption.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are block devices?

A

Devices that transfer data in fixed-size blocks, e.g., hard drives and SSDs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the typical block size in Linux?

A

Usually 4KB, must be a multiple of the sector size.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a buffer cache for filesystems?

A

Stores metadata and file system structure data for block devices.

17
Q

What is the page cache?

A

Caches file data in memory to minimize disk I/O.

18
Q

What are write-through and write-back policies?

A

Write-through: immediately write to disk; Write-back: defer writes, mark pages dirty.

19
Q

How does Linux decide which pages to evict from cache?

A

Uses an active and inactive LRU list algorithm.

20
Q

What command forces all dirty pages to disk?

21
Q

How do you drop page cache manually?

A

echo 1 > /proc/sys/vm/drop_caches

22
Q

What are hard and soft links?

A

Hard link: same inode; Soft link: separate inode pointing to a path.

23
Q

What command creates a hard link?

A

ln existing_file new_link

24
Q

What command creates a soft (symbolic) link?

A

ln -s target link_name

25
What is RAID used for?
Combines multiple disks for redundancy or performance.
26
What is the default I/O scheduler for modern Linux systems?
BFQ or Deadline, depending on the kernel version.
27
What is a kernel panic?
A fatal kernel error that halts the system to prevent data corruption.
28
How do you determine if a drive is full?
run df -h to see which mount is full lsblk or mount to map to an underlying device Check for inodes with df -i
29
What is the role of the Virtual File System (VFS) in the Linux kernel?
The virtual file system is an abstraction layer on top of a filesystem like ext4. Provides uniform API and allows Linux to support multiple filesystems inodes, dentries, superblocks, etc. syscall -> VFS -> FS Caching to speed up lookups
30
What's the difference between a filesystem driver and the block layer?
Filesystem driver = what to read/write (structured data view) Block layer = how to read/write (raw storage I/O)
31
Explain the process of mounting and unmounting filesystems in Linux.
Use mount or umount cmds Associates a filesystem with a directory path Kernel reads super block, initializes in-memory structures and adds to VFS mount table Unmounting flushes caches, ensure no open file remains, and detaches Can't unmount busy filesystem
32
What are inodes in Linux?
Store metadata (permissions, size, timestamps, links, pointers to data blocks) Each file has a unique inode numbers Directory entries map filesnames to inode number
33
What is a Linux file descriptor?
Integer that process use to refer to open file socket or pipe open() or sockert() creates file objects in kernel space and create pointer to file object 0 = stdin, 1 = stdout, 2 = stderr