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.
(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.
(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.
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)
(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.
Owner name, File Size, File Permissions
Contiguous
NTFS
Journaling File System
FFS
FFS
FFS
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
Inode bitmap
(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
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
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
(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”