1/15
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Which disk allocation policy is least reliable?
linked-list allocation
Which disk allocation policies offer efficient random accesses?
multi-level indexing
index-based allocation
continuous allocation
Most files are...
small
Which namespace is most prone to name collisions?
flat name space
Free blocks, directories, file headers, indirect blocks are an example of...
metadata
Ad hoc file system check
fsck
All operations either happen or they do not
atomicity
Transactions appear to happen one after another
serializability
Once a transaction happens, it is recoverable and can survive crashes
durability
If you can have an infinite number of CPUs (computation time is zero) on a machine, how would you design your file system?
If you can have infinite memory size on your machine, how would you design your file system?
If I had infinite memory size on a machine, I would design my storage layout to be so the entire file system could be stored in memory, eliminating the need for disk-based storage. This would ensure better performance and access times. I would use unique identifiers to avoid path collisions and ensure that no conflicts can arise. I would implement memory-based ACLs and use access control lists for protection and ensure precise control over file permissions. Lastly, in regards to file reliability, I would ensure crash recovery and multiple in-memory replicas of important files so they are able to ensure data recovery.
If you can have infinite disk storage on your machine, how would you design your file system?
If you can have infinite network bandwidth on your machine, how would you design your file system?
Write a program create_files in any language to create a file foo, sleep for 5 seconds, and create a file bar.
Right after you start the program, press Ctrl-C to prevent the program from completing. What do you see in the directory?
foo
Write programs atomically_create_files and replay_journal so that files foo and bar are atomically created First, atomically_create_files logs <begin transaction> into the journal file journal. Second, atomically_create_files logs <create foo> and <create bar> into journal. Third, atomically_create_files logs <commit> into journal. A second replay_journal program can read the journal file to perform the actual file creations and delete journal. If there is a crash before <commit> is written into journal, replay_journal just deletes journal. If there is a crash before replay_journal can complete the creation of the two files, replay_journal can be run again to recreate both files. Finally, after both files are created, replay_journal removes journal.
You can inject crashes by exiting at various points in various programs. First, copy the program atomically_create_files to atomically_create_files_crash. Insert a crash point between the logging of two file creation operations in atomically_create_file_crash.
Run atomically_create_files_crash and run replay_journal. What do you see in the directory at this point?
nothing
Write programs atomically_create_files and replay_journal so that files foo and bar are atomically created First, atomically_create_files logs <begin transaction> into the journal file journal. Second, atomically_create_files logs <create foo> and <create bar> into journal. Third, atomically_create_files logs <commit> into journal. A second replay_journal program can read the journal file to perform the actual file creations and delete journal. If there is a crash before <commit> is written into journal, replay_journal just deletes journal. If there is a crash before replay_journal can complete the creation of the two files, replay_journal can be run again to recreate both files. Finally, after both files are created, replay_journal removes journal.
You can inject crashes by exiting at various points in various programs. First, copy the program replay_journal to replay_journal_crash. Insert a crash point after recreating the first file in replay_journal_crash.
Run atomically_create_files, run replay_journal_crash, and run replay_journal. What do you see in the directory at this point?
bar, foo