Download CS 570 Hour Test 2 - Disk Operations and File Systems and more Exams Operating Systems in PDF only on Docsity! Page 1 of 4 CS 570 HOUR TEST #2 May 16, 2001 Name (Last, First):_____________________________________________________SSN:___________________ ROW: ________ COL: ________ IMPORTANT: PLEASE WRITE NEATLY AND LEGIBLY. ILLEGIBLE ANSWERS WILL NOT BE GRADED. This is a closed-book exam. Only a half letter-size page cheat-sheet is allowed. (The cheat sheet must be one-of- a-kind, hand written by the student who is taking the exam and must be signed and turned in along with the exam paper. 1. [5 POINTS] Find the capacity of a formatted disk, which has the following geometry: four heads, 500 cylinders, 200 sectors per track. Suppose that the number of sectors per track is the same for all cylinders. Also suppose that a sector has 512 bytes for data. ___________________________________________________________________________________________ 2. [8 POINTS] Consider a random access to a disk file in which the 25000-th byte needs to be modified. Suppose that the disk blocks have four disk sectors (a disk sector has standard size of 512 bytes for data). Find the following (show work!): VBN: ________________ Block offset (in bytes): ______________ ___________________________________________________________________________________________ 3. [20 POINTS] Given is the following sequence of disk requests (numbers represent cylinder numbers): 54, 28, 100, 50, 23, 13, 177, 176, 48, 33 (this is the last request) Suppose the disk has 200 cylinders and the initial position of the head is at 100. Assume in case of SCAN and C-SCAN that the head is moving from lower to higher cylinder number. C-SCAN can read only in that direction. Write the sequence of requests served for the following disk scheduling algorithms: (a) FCFS: _____________________________________________________ (b) SSTF: _____________________________________________________ (c) SCAN: ____________________________________________________ (d) C-SCAN: __________________________________________________ (e) Find the average seek length for SCAN algorithm: _________ Page 2 of 4 4. [23 POINTS] Consider a combined multi-level indexed file allocation scheme. Find the required number of blocks and determine the internal fragmentation for three files with different sizes (show work!): File size in K bytes Total number of blocks (data+index) Internal fragmentation in K bytes (data blocks only) Internal fragmentation in K bytes (index blocks only) 15 1550 4108 5. [5 POINTS] Define the size (in K bytes) of a bit map of free memory blocks, if the disk has formatted capacity of 30 G bytes, with block size of 4 K bytes. 6. [4 POINTS] Why is desirable to separate directories and file headers? 7. [8 POINTS] Consider a DOS file system with a file "ABC" that has 8 blocks with the following LBNs: 12 (first block), 3, 8, 9, 11, 4, 6, 10 (last block). (a) Fill-in the FAT table below: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ……… Disk Size Directory ABC 12 (b) Allocate new file "XYZ" which requires only three blocks. Update the FAT and the directory.