ecs 251 Spring 2014 midterm Name Student ID

  • Slides: 10
Download presentation
ecs 251 Spring 2014 midterm Name: Student ID: Email: Open book/laptop, but NO Internet,

ecs 251 Spring 2014 midterm Name: Student ID: Email: Open book/laptop, but NO Internet, or any type of electronic communication. Totally 5 questions, 5% each, total 8 pages. Please write precise and clean. Please READ the questions VERY CAREFULLY before putting down the final answer. And, also please mark your answer clearly. You can use the back of the pages. Every page of this exam book needs to be returned back. If we suspect any cheating behavior, we will pass the case to the academic committee immediately. Score: ___/25 05/01/2014 ecs 251 spring 2014, midterm 1

Q-01 (Logical versus Physical File Sizes, 5%) Under i-Node, di_size represents the logical file

Q-01 (Logical versus Physical File Sizes, 5%) Under i-Node, di_size represents the logical file size, while di_blks can be used to calculate the physical file size. Please illustrate why there might be a difference between the physical and logical file sizes. Furthermore, which size (i. e. , logical or physical) is bigger? Please justify your answer! 05/01/2014 ecs 251 spring 2014, midterm 2

Q-02 (I-Node, 5%) What is the largest possible file that can be represented by

Q-02 (I-Node, 5%) What is the largest possible file that can be represented by an I-node for the following file system: 1. UFS 2 inode: 256 bytes per inode and the block pointer is 64 bits (or 8 bytes) 2. each disk block is 16 K (214) bytes 3. di_size (the logical size of the file) is 8 bytes Please describe also how you derive your final answer. (If you final answer is wrong but your procedure is somewhat correct, you will still receive partial credits. ) 05/01/2014 ecs 251 spring 2014, midterm 3

Q-03 (i-node, Index Node, versus v-node, Virtual node, 5%) Under Free. BSD, an application

Q-03 (i-node, Index Node, versus v-node, Virtual node, 5%) Under Free. BSD, an application just open a file. How many (if any) i-nodes and v-nodes MUST have been created, assuming this is the first time to open this particular file since last reboot, on the machine running the application? (Please justify your answer here. ) 05/01/2014 ecs 251 spring 2014, midterm 4

Q-04 (Journaling versus Soft Update, 5%) Soft update and Journaling are two mechanisms for

Q-04 (Journaling versus Soft Update, 5%) Soft update and Journaling are two mechanisms for Free. BSD and Linux, respectively, to protect their meta-data. Which method is better in YOUR opinion, and please justify your choice. (** in order for you to receive the full points, you must provide valid reason(s), and provide some examples if appropriate. **) 05/01/2014 ecs 251 spring 2014, midterm 5

Q-05 (Soft Update, 5%) In each of the following diagrams, we have TWO directory

Q-05 (Soft Update, 5%) In each of the following diagrams, we have TWO directory blocks and TWO I-Node blocks. The first row shows the initial values of memory and disk BEFORE the synchronization. And, the second row shows a step-bystep sequence of block updates following the rules of “Soft Update” to synchronize the memory/disk. Please answer WHICH Option (pages 7 -8 versus pages 9 -10) is better and state the reason behind your answer. (hint: Please focus on the FIRST block update. ) 05/01/2014 ecs 251 spring 2014, midterm 6

Option #1 memory disk DE 5 DE 7 (empty) i. N(DE 5) (empty) DE

Option #1 memory disk DE 5 DE 7 (empty) i. N(DE 5) (empty) DE 7 (empty) (empty) DE 2 (empty) i. N(DE 2) (empty) DE 3 i. N(DE 3) (empty) (empty) i. N(DE 7) DE 8 (empty) i. N(DE 8) i. N(DE 7) DE 5 DE 7 (empty) i. N(DE 5) (empty) DE 7 (empty) (empty) (empty) i. N(DE 2) (empty) DE 3 i. N(DE 3) (empty) (empty) i. N(DE 7) DE 8 (empty) i. N(DE 8) i. N(DE 7) DE 5 DE 7 (empty) i. N(DE 5) (empty) (empty) (empty) DE 3 i. N(DE 3) (empty) (empty) i. N(DE 7) DE 8 (empty) i. N(DE 8) i. N(DE 7) 05/01/2014 ecs 251 spring 2014, midterm 7

memory disk DE 5 DE 7 (empty) i. N(DE 5) DE 5 (empty) (empty)

memory disk DE 5 DE 7 (empty) i. N(DE 5) DE 5 (empty) (empty) DE 3 i. N(DE 3) (empty) (empty) i. N(DE 7) (empty) DE 5 DE 7 (empty) i. N(DE 5) (empty) (empty) DE 3 i. N(DE 3) (empty) i. N(DE 7) (empty) DE 5 DE 7 (empty) i. N(DE 5) (empty) (empty) (empty) DE 3 i. N(DE 3) (empty) (empty) i. N(DE 7) 05/01/2014 ecs 251 spring 2014, midterm 8

Option #2 memory disk DE 5 DE 7 (empty) i. N(DE 5) (empty) DE

Option #2 memory disk DE 5 DE 7 (empty) i. N(DE 5) (empty) DE 7 (empty) (empty) DE 2 (empty) i. N(DE 2) (empty) DE 3 i. N(DE 3) (empty) (empty) i. N(DE 7) DE 8 (empty) i. N(DE 8) i. N(DE 7) DE 5 DE 7 (empty) i. N(DE 5) (empty) DE 7 (empty) (empty) (empty) i. N(DE 2) (empty) DE 3 i. N(DE 3) (empty) (empty) i. N(DE 7) DE 8 (empty) i. N(DE 8) i. N(DE 7) 05/01/2014 ecs 251 spring 2014, midterm 9

memory disk DE 5 DE 7 (empty) i. N(DE 5) (empty) (empty) (empty) DE

memory disk DE 5 DE 7 (empty) i. N(DE 5) (empty) (empty) (empty) DE 3 i. N(DE 3) (empty) (empty) i. N(DE 7) DE 8 (empty) i. N(DE 8) i. N(DE 7) DE 5 DE 7 (empty) i. N(DE 5) (empty) (empty) (empty) (empty) (empty) DE 3 i. N(DE 3) (empty) (empty) (empty) i. N(DE 7) (empty) i. N(DE 7) 05/01/2014 ecs 251 spring 2014, midterm 10