nerdexam
GIAC

GCFA · Question #181

You work as the Network Administrator for McNeil Inc. The company has a Unix-based network. You want to run a command that forces all the unwritten blocks in the buffer cache to be written to the…

The correct answer is B. sync. The Unix 'sync' command flushes all pending writes from the kernel buffer cache to disk, ensuring data integrity before system shutdown or disk operations.

Advanced Mac & Linux Forensics

Question

You work as the Network Administrator for McNeil Inc. The company has a Unix-based network. You want to run a command that forces all the unwritten blocks in the buffer cache to be written to the disk. Which of the following Unix commands can you use to accomplish the task?

Options

  • Atune2fs
  • Bsync
  • Cswapoff
  • Dswapon

How the community answered

(44 responses)
  • A
    5% (2)
  • B
    70% (31)
  • C
    16% (7)
  • D
    9% (4)

Why each option

The Unix 'sync' command flushes all pending writes from the kernel buffer cache to disk, ensuring data integrity before system shutdown or disk operations.

Atune2fs

tune2fs is used to adjust tunable filesystem parameters on ext2/ext3/ext4 filesystems, not to flush buffer cache to disk.

BsyncCorrect

The 'sync' command instructs the kernel to write all dirty (unwritten) buffer cache blocks to the underlying storage device immediately. It is a standard POSIX utility that ensures in-memory filesystem changes are persisted to disk, and is commonly used before unmounting filesystems or rebooting to prevent data loss.

Cswapoff

swapoff disables the use of a specific file or partition as swap space, which is unrelated to flushing buffer cache writes.

Dswapon

swapon enables a file or partition for use as swap space, which has no function in flushing unwritten buffer cache blocks to disk.

Concept tested: Unix sync command and buffer cache flushing

Source: https://man7.org/linux/man-pages/man8/sync.8.html

Topics

#Unix commands#sync command#buffer cache#disk write operations

Community Discussion

No community discussion yet for this question.

Full GCFA Practice