What is the File System for?
File System provides:
What is a File System?
It is a collection of files + directory structures
What are files?
A container for storing information.
File abstracts away the different kinds of information into a single struct - devices, pipes, text files, data files.
Where are files stored?
Generally, they are stored on disk.
what are the different kinds of representations a file has?
Three kinds of files:

What kind of types a file has?
User files:
System files
How many kinds of access-to-file we have?
Sequential access:
Random access
What are the file attributes?
General info - user ID, Group ID, dates, times
Location & size - pointer to a device and location on it
Flags that store information for the system
Another special flags - Protection, password..
What are the file’s operations?
Create ; Delete
Open ; Close
Write ; Read ; Seek
Get attributes
Set attributes
What are the directory’s operations?
Create entry ; Delete entry (?)
Search for a file
Create/Delete a directory file
List a directory
Rename a file
Link a file to a directory
Traverse a file system
What are the dot and dotdot directory entries?
What’s the relation between a process and a path?
. - the current directory.
.. - the parent directory
Each process has its own working directory, which is shared by its threads.
Using which tool files(inodes) are shared?
Links
What are soft links and hard links?
Soft
Hard
What is the difference between shared and exclusive locks?
Exclusive - protects updates to file resources and can be owned by only one transaction at a time.
Acquiring an exclusive lock demands waiting if another process is currently holding an exclusive lock or a shared lock of the same resource.
shared - can be owned by several processes at a time.
Acquiring a shared lock demands waiting if another process is currently holding an exclusive lock.
A new request for a shared lock must wait if there’s a request for an exclusive lock on a resource that already has a shared lock.
How can i block or unblock a file?
Using the command flock(file descriptor, operation)
What happens to the lock when a file is closed or a process terminates?
File lock is removed.
Can we lock parts of the file?
Yes.
Any part of the file may be blocked.
What are the concerns of the user/kernel regarding files?
User:
System:
Disk allocation:
Advantages/Disadvantages of:
Contiguous:
Linked list of disk blocks:
Linked list using in-memory Files Allocation Table

What is an inode and who holds it?
It is a place, on disk, where data about the file is stored.
Each file struct holds inode. (might be two files pointing to the same inode..)
There is a struct called dinode which holds the:
What is the classic Unix disk structure?
Unix inodes - how bytes counting work?
I didn’t get it. You try.

Tell me in which block byte 355,000 can be found?

What is the file descriptor table for? who holds it?