
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
thumb_up100%

Transcribed Image Text:**Understanding Disk Blocks and I-Nodes in Simple File Systems**
**Problem Statement:**
Suppose that you have a very simple file system (VSFS) using i-node to manage disk data blocks, where the disk block size is 4096 bytes. Disk addresses and file block pointers take 32 bits (4 bytes), and the i-node contains 10 direct pointers, one single-indirect pointer, and one double-indirect pointer. Assume an index block is the same size as a data block (both 4096 Bytes). If there is a file having 45,000 bytes of data and it has never been accessed, we only assume the file's i-node is in memory, but none of the rest of the file. If the user process wants to read the entire file into memory, how many disk blocks (including both data blocks and index block(s)) would be brought into the main memory?
**Answer Choices:**
a. 11
b. 10
c. 12
d. 1035
e. 1034
**Solution:**
1. **Direct Pointers Calculation:**
Each direct pointer can address one disk block of 4096 bytes.
- Number of blocks addressed by direct pointers = 10
- Total data addressed by direct pointers = 10 * 4096 bytes = 40960 bytes
2. **Single-Indirect Pointer Calculation:**
Since 45,000 bytes > 40,960 bytes, the remaining data must be addressed by the single-indirect pointer.
- Remaining data = 45000 bytes - 40960 bytes = 1040 bytes
- One block accessed through single-indirect pointer
3. **Total Block Count:**
- Direct blocks (10) + 1 single-indirect block (1) + 1 indirect block itself = 12
**Correct Answer:**
c. 12
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Consider a system where free space is kept in a free-space list. a. Suppose that the pointer to the free-space list is lost. Can the system reconstruct the free-space list? Explain your answer. b. Consider a file system similar to the one used by UNIX with indexed allocation. How many disk 1/0 operations might be required to read the contents of a small local file at /a/b/c? Assume that none of the disk blocks is currently being cached. c. Suggest a scheme to ensure that the pointer is never lost as a result of memory failure.arrow_forwardSuppose we have a Unix file system with block size of 8 Kbyte and pointers with size of 4 bytes. How large a file can be represented using only single indirect pointer in inode? A. 8 Kbyte B. 2K * 8 Kbyte C. 2K * 2K * 8 Kbyte D. 2K * 2K * 2K * 8 Kbytearrow_forwardConsider a file system on a disk that has both logical and physical block sizes of 512 bytes. Assume that the information about each file is al ready in memory. For each of the three allocation strategies (contiguous, linked, and indexed), answer these questions: a. How is the logical-to-physical address mapping accomplished in this system? (For the indexed allocation, assume that a file is always less than 512 blocks long.) b. If we are currently at logical block 10 (the last block accessed was block 10) and want to access logical block 4, how many physical blocks must be read from the diskarrow_forward
- Assuming 4K clustering for a 500-byte file, what is the size (in bytes) of the File Slack? O 12 bytes O 1536 bytes O 3584 bytes O 4096 bytesarrow_forwardConsider a file system that uses indexed allocation with a maximum of one index node per file. Suppose the index node occupies 4096 bytes, that each block pointer occupies 4 bytes. Ignore the metadata associated with the file that is usually contained in the index node. How large should a block be (in bytes) so that this scheme is able to completely access files on a 1 GB file system?arrow_forwardGiven the following data file: STUDENT(ID, SNAME, ADDRESS, LEVEL, GPA, …) Suppose that: record size R = 200 bytes block size B = 512 bytes r = 2000 records Then, Find out: Blocking factor(Bfr) Bfr=B/R Number of file blocks(b) b=r/bfrarrow_forward
- Write a C program Producer – Consumer as a classical problem of synchronizationStep 2. Write a program* that solves the producer - consumer problem. You may use the following pseudo code for implementation.*program to write: produce -consumer problem to produce and consume the alphabet.//Shared data: semaphore full, empty, mutex;//pool of n buffers, each can hold one item//mutex provides mutual exclusion to the buffer pool//empty and full count the number of empty and full buffers//Initially: full = 0, empty = n, mutex = 1//Producer thread do {…produce next item…wait(empty); wait(mutex);…add the item to buffer…signal(mutex); signal(full);} while (1);//Consumer thread do {wait(full) wait(mutex);…remove next item from buffer…signal(mutex); signal(empty);…consume the item } while (1);arrow_forwardTask: 1. Write a C program to simulate the sequential file allocation in a very simple file system. 2. Assume a disk of 32 blocks, each block is of 1 KB size 3. First 8 blocks (0 to 7) are allocated to the “iNodes” and can’t be used by the file system. Hence blocks available for allocation are from block 8 to block 31. 4. Minimum file size is 1 KB. Hence the file system can have minimum of one file of size 24 KB or maximum of 24 files. 5. At the start, it is assumed that the file system has no files. 6. The program shall ask the user to input the number of files to allocate and their respective names and file sizes. 7. The program shall randomly (set a seed with srand(seed) to replicate the randomness) select any free block as a start block. Check that the start block and the required contiguous blocks are free. If free, allocate those blocks to the file. If not free, find next available contiguous blocks. 8. After allocating blocks for all the files, the program shall print file name,…arrow_forwardConsider a system where free space is kept in a free-space list. a. Suppose that the pointer to the free-space list is lost. Can the system reconstruct the free-space list? Explain your answer. b. Consider a file system similar to the one used by UNIX with indexed allocation. How many disk 1/0 operations might be required to read the contents of a small local file at /a/b/c? Assume that none of the disk blocks is currently being cached. c. Suggest a scheme to ensure that the pointer is never lost as a result of memory failure.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education