File Systems Flashcards
(39 cards)
File Systems
[12pts] Choose 3 file layouts and show how each would represent a 44KB file in a system of 4KB blocks.
(a) Contiguous allocation - stores the beginning sector and a length of 44 kb
(b) FFS (fast file system)
10 direct pointers to 4kb of data each
One indirect pointer that has a reference to one more direct pointer to the last 4kb of data
(c) Direct allocation - stores 11 direct pointers to 11 different blocks from the inode itself.
File Systems
You buy a new hard drive and format it as a Fast File System.
- [4pts] Describe the layout of the disk before user files are added.
(a) Master Boot Record
(b) Partition Table
(c) Partitions
Each partition has:
(a) boot block
(b) key parameters of the file system (type, etc.)
(c) super block
(d) free space management
(e) inode bitmap
(f) root
You buy a new hard drive and format it as a Fast File System.
- [4pts] List the steps necessary to create a user file.
(1) Get the root inode
(2) Traverse the path from the root to the end directory
(3) Allocate a sector from the freemap and update the freemap
(4) Create the inode
(5) Update the inode bitmap
(6) Add the file entry to the end directory.
File Systems
In class, we studied the Fast File System and NTFS.
- NTFS is implemented as a flexible tree with extents.
(a) [4pts] What is an extent?
An extent is a range of sectors belonging to a file
(b) [6pts] Describe three ways in which the NTFS flexible tree can be used to represent files.
(a) Data is resident in the record
(b) Data is not resident in the record and there is use of records.
(c) The attribute list is not resident (extents are stored in a different records)
- The Fast File System is implemented as a multilevel indexed file system, which can efficiently access small files while also supporting larger files.
(a) [4pts] How does FFS store small files? You may assume a small file has a size of 40KB or
Less.
Stores them in the 10 direct blocks
(b) [4pts] A file size limit is inherent in the design of FFS. Why?
The depth of the triply indirect block is what limits the file size in FFS.
- [3pts] Name three pieces of file metadata, stored in the file header.
Owner name, File Size, File Permissions
- Which filesystem(s) we studied (specific or type accepted):
(a) [2pts] suffers from external fragmentation?
Contiguous
- Which filesystem(s) we studied (specific or type accepted):
(b) [2pts] can hold a file large enough to fill the entire disk, no matter the disk’s size?
NTFS
- Which filesystem(s) we studied (specific or type accepted):
(d) [2pts] writes all metadata changes to a log?
Journaling File System
- Which filesystem(s) we studied (specific or type accepted):
(e) [2pts] uses direct and indirect pointers?
FFS
- Which filesystem(s) we studied (specific or type accepted):
(f) [2pts] has a rigid file structure?
FFS
- Which filesystem(s) we studied (specific or type accepted):
(g) [2pts] uses block groups?
FFS
- Which filesystem(s) we studied (specific or type accepted):
(h) [2pts] copies data to a new location when that data changes on disk?
Copy-on-write file systems
File Systems
1. File systems use a data structure called a file header.
(a) [3pts] What is the purpose of a file header?
Store metadata for the file
(c) [2pts] What is a file header called in FFS?
Inode
(d) [2pts] What is a file header called in NTFS?
File Record
- [3pts] Name another metadata structure in the file system.
Inode bitmap
- [4pts] Assume that the user has just saved her file page.c, and that save requires another data block to be appended to the file. What steps are required to append a data block to a file?
(1) Allocate a slot from the freemap
(2) Data block is allocated
(3) Data block is filled with data
(4) File header is updated and written back to disk
- [4pts] Assume a crash occurs during the steps of problem 3. Is there a possibility of a file
system inconsistency? Defend your answer. - [4pts] Assume that the user has just saved her file page.c, and that save requires another data block to be appended to the file. What steps are required to append a data block to a file?
Yes, assuming there is no journaling, it’s possible that a spot could be allocated in the free map, but the system crashes and no data actually resides there
Disks and File Systems
- NTFS and FFS (and all of its descendents) have been carefully designed and optimized to
take advantage of the technology that has been prevalent for most of their lifetimes: spinning,
magnetic disks.
(a) [4pts] Name two design features of FFS that exploit characteristics of the spinning disk.
Block groups,
Presents user with a smaller disk than is actually available
(b) [2pts] Name one design feature of NTFS that exploits characteristics of the spinning disk.
Extents: exploit low cost of transfer time on continuous chunks of data
- One of the file systems we discussed (albeit briefly) was the copy-on-write file system.
(a) [4pts] Why is this file system well-suited to an SSD? Give two reasons.
(a) By nature of writing all updates to new locations on the SSD, it does wear leveling automatically.
(b) Transforms random writes to sequential writes, offset cost of block erasure
(c) “COW techniques used to virtualize block addresses and redirect writes to cleared erasure blocks”