Separate file names from file lifetime

On a Unix filesystem, /lab/raw.dat, /lab/keep.dat and /lab/archive.dat are three directory entries identifying the same inode. The file occupies exactly 24 576 bytes of allocated data blocks. One process also holds a single open file descriptor for this file.


These are the only directory entries and open references to the file. No snapshots or other storage-retention mechanisms apply. All operations below succeed, and no data are written.


Three directory entries and one open file descriptor initially refer to the same file inode.


The following events occur in order:

  1. The entries /lab/raw.dat and /lab/keep.dat are removed.
  2. The entry /lab/archive.dat is removed while the descriptor remains open.
  3. The process closes its descriptor.

Give three exact integers: the file's hard-link count after event 1, the number of its data-block bytes eligible for reuse after event 2, and the number eligible for reuse after event 3. Count only the stated data blocks; exclude metadata storage.

Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More The Unix/Linux Operating System Questions: