File Systems: Names, Blocks and Metadata · seed 1 · A4, ink-friendly. The answer key prints on its own page for grown-ups.
En anglais

Names point at records, records point at blocks

Computing · Computer Systems · ages 20-21
Name ______________________   Date ____________
  1. The current working directory is /home/lee. With no symbolic links here, where does notes/report.txt resolve?

    • /notes/report.txt
    • /home/notes/report.txt
    • /home/lee/notes/report.txt
  2. In the taught inode-based model, what does a directory entry store?

    • The file's block list and permission bits
    • A filename and a reference to its record
    • The file's owner, size and complete contents
  3. Two hard-link names for a regular file on the same file system refer to the same file record.

    Circle one:   True   False

  4. Why can unlinking a large file take less time than writing its contents, without being guaranteed instant?

    • It writes zeros over every content block before freeing storage
    • It discards contents while leaving every directory entry unchanged
    • It updates names and metadata without rewriting all data
  5. After chmod 600 myfile.txt on a regular file, which permissions do the group and other mode fields grant?

    • None: both fields contain ---
    • Read: both fields contain r--
    • Read and write: both fields contain rw-
  6. What do the three groups after the leading dash in -rw-r--r-- represent?

    • Owner, group, other; each has read/write/execute slots
    • Read, write, execute; each has owner/group/other slots
    • Other, group, owner; each has read/write/execute slots
  7. plan.txt and saved.txt are hard links to one regular file. You successfully unlink plan.txt while saved.txt remains. What follows?

    • saved.txt still names the same record and contents
    • saved.txt now names an independent copy with a new record
    • saved.txt becomes unusable because the first name was removed
  8. report.txt maps to inode 42. Inode 42 lists data blocks 12 and 19. How are the file's bytes found in this model?

    • Read blocks 42 and 19, treating 12 as the file's inode
    • Read inode 42, then its listed data blocks 12 and 19
    • Read inode 12, then its listed data blocks 19 and 42
LightMySky · lightmysky.comW1-mt_jN4u3idvF3-s1

Answer key

For grown-ups. Fold this page away before handing over the rest.

Names point at records, records point at blocks W1-mt_jN4u3idvF3-s1

  1. /home/lee/notes/report.txt · The relative path starts at /home/lee, then follows notes and report.txt.
  2. A filename and a reference to its record · A directory entry maps a name to a record. The record supplies metadata and information locating the contents.
  3. True · Hard links share one record and its contents; neither name is a special original.
  4. It updates names and metadata without rewriting all data · Unlinking removes a name and updates metadata. It avoids overwriting every content block, but reclamation can still require work.
  5. None: both fields contain --- · Mode 600 sets owner rw-, group --- and other ---. This describes mode fields, not every possible action by every user.
  6. Owner, group, other; each has read/write/execute slots · The groups are rw-, r-- and r-- for owner, group and other, in that order.
  7. saved.txt still names the same record and contents · Removing plan.txt removes that entry, not saved.txt. The remaining hard link still reaches the shared record.
  8. Read inode 42, then its listed data blocks 12 and 19 · The directory mapping selects inode 42. Its block information selects blocks 12 and 19.
Worksheet · LightMySky