Lecture 12 - Filesystems Flashcards
What is a filesystem?
Method of long term storage
Stores large amounts of data
Organised as data and metadata
Usually on block devices
What is metadata?
Data about data
What is structural metadata?
About the design and specification of data structures
“Data about the containers of data”
i.e. where are blocks stored on disk
how long are blocks
is it fast or slow
What is descriptive metadata?
Data about the actual content
e.g. when was this file created, by whom, whats the encoding, can it be trusted
What are some design choices about filesystems?
Namespace - flat, hierarchical
Types of files - structured/unstructured
what metadata to use
how to store on the device
What are some important file attributes?
Name - human readable
Identifier - for machine use
Type
Location - both within the filesystem and on the device
Size
Protection
Time, date, user info
What are the two ways of accessing a file?
sequential access - read from beginning - cannot randomly pick and choose a bit to read
Random access - read in any order, pick and choose as you like
What are some typical file operations?
Create
Delete
Open
Close
Read
Write
Append
Seek
Get/set attributes
Rename
What are file descriptors?
An integer the kernel uses to name a file when it is open
In unix also applies to devices since they are represented as files
What does the POSIX file api do?
Forms an interface between OS kernel and software in user mode
What is the difference between mandatory and advisory file locking?
Mandatory - access is denied depending on locks held and requested
Advisory - processes can find status of locks and decide what to do
What is a hard link?
Link to low-level reference to the file, i.e. points to the actual file itself on disk
What is a soft link?
Symbolic link
High level reference to file, i.e. where it is in the hierarchy
How are files accessed in filesystem?
By name: name identifies unique file (including path)
By content or attribute: could index by the actual content of a file - would need to search to find it
What are the 5 layers in file systems?
Application programs
Logical file system (hierarchy - files, diretcories etc.)
Basic file system (block read/write)
I/O control (drivers, interrupts)
Hardware devices