Disk size is 1GB =2^30 bytes and 4096 bytes = 2^12 bytes. Therefore the number of blocks available = 2^30/2^12 = 2^18 blocks(262144 blocks)
a. File a is written in 6 blocks. The first block0 is occupied for storing system-related information and the remaining blocks are free for allocation.
The bitmap 1000 0000 0000 0000 0000.....0000 denotes, for each block a bit is used to represent whether the block is occupied or free. If the bit is '1' then that block is occupied. If the bit is '0', then that block is free and available for allocation.
Therefore for the first activity : File A written using 6 blocks.
The bit map:
1111 1110 0000 0000 0000.....0000
The bits corresponding to blocks starting from 1 to 6 are made 1 in bitmap, as those blocks are occupied because of writting the file A in those blocks.
Second activity: File B written using 7 blocks
The bit map:
1111 1111 1111 1100 0000.......0000
The bits corresponding to blocks starting from 7 to 13 are made 1 in bitmap, as those blocks are occupued because of writting the file B in those blocks.
Third activity: File C written using 4 blocks
The bit map:
1111 1111 1111 1111 1100.......0000
The bits corresponding to blocks starting from 14 to 17 are made 1 in bitmap, as those blocks are occupied because of writting the file C in those blocks.
Fourth activity: File B is deleted
The bit map:
1111 1110 0000 0011 1100......0000
The bits corresponding to blocks starting from 7 to 13 are made 0 in bitmap, as those blocks are freed because of deleting the file B.
b. when free space on disk maintained as a linked list:
The first 10 free blocks after each activity:
First activity : File A written, using 6 blocks. Blocks 1 to 6 are used as shown above. Each entry correspond to each free block:
Block number | Next Entry | Previous Entry |
7 | 8 | - |
8 | 9 | 7 |
9 | 10 | 8 |
10 | 11 | 9 |
11 | 12 | 10 |
12 | 13 | 11 |
13 | 14 | 12 |
14 | 15 | 13 |
15 | 16 | 14 |
16 | 17 | 15 |
Second activity: File B written using 7 blocks, blocks from 7 to13 are occupied in this activity
The first 10 free blocks after this activity starts from block 14 upto 23
Block Number | Next entry | previous entry |
14 | 15 | - |
15 | 16 | 14 |
16 | 17 | 15 |
17 | 18 | 16 |
18 | 19 | 17 |
19 | 20 | 18 |
20 | 21 | 19 |
21 | 22 | 20 |
22 | 23 | 21 |
23 | 24 | 22 |
Third Activity: File C written using 4 blocks. The blocks 14 to 17 are used. Thus first 10 free blocks are from block 18 to 27.
Block number | Next Entry | Previous Entry |
18 | 19 | - |
19 | 20 | 18 |
20 | 21 | 19 |
21 | 22 | 20 |
22 | 23 | 21 |
23 | 24 | 22 |
24 | 25 | 23 |
25 | 26 | 24 |
26 | 27 | 25 |
27 | 28 | 26 |
Fourth Activity: File B deleted. Thus blocks from 7 to 13 are freed. Therefore the first 10 free entries after this activity:
Block number | Next entry | Previous entry |
7 | 8 | - |
8 | 9 | 7 |
9 | 10 | 8 |
10 | 11 | 9 |
11 | 12 | 10 |
12 | 13 | 11 |
13 | 18 | 12 |
18 | 19 | 13 |
19 | 20 | 18 |
20 | 21 | 19 |
Consider an empty 1 Gbyte disk with the block size of 4096 bytes. When the disk...
Consider a disk with block size = 4096 bytes. A block pointer is 6 bytes and a record pointer is 8 bytes long. A file has 100,000 records of fixed length. Each record has the following fields and byte size: Name (30), Ssn (9), Dept (9), Address (40), Phone (10), Bdate (8), Sex (1), Job (4) and Salary (4). An additional byte is used as a deletion marked. a. Calculate the record size R in bytes b. Calculate the blocking...
After the disk partition is first formatted, the beginning of a free space bitmap looks like this: 1000 0000 0000 0000 (the first block is used by the root directory). As we discussed during the lecture, the system always searches for free blocks starting at the lowest numbered block, so after writing file A, which uses six blocks, the bitmap would change to 1111 1110 0000 0000... . Show the bitmap after each of the following actions: a) File B...
Problem 1. Consider a disk with block size B=1024 bytes. A block pointer is P = 8 bytes long, and a record pointer is R =7 bytes long. A file has r=5,000,000 EMPLOYEE records of fixed- length. Each record has the following fields: NAME (30 bytes), SSN (9 bytes), DEPARTMENTCODE (9 bytes), ADDRESS (35 bytes), PHONE (9 bytes), BIRTHDATE (8 bytes), SEX (1 byte), JOBCODE (4 bytes), SALARY (4 bytes, real number). An additional byte is used as a deletion...
How many disk accesses are needed to bring byte i of a file into memory when the file is stored using contiguous allocation? Assume only the file’s FCB is in memory , block pointers require 32 bits , and that blocks hold 4096 bytes each. 3 accesses 1 + [ i/4096] accesses [i/4096 accesses 2 accesses 1 access
Consider 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 already in memory. For each of the three allocation strategies (contiguous, linked, and indexed), answer these questions: If we are currently at logical block 5 (the last block accessed was blocked 4) and want to access logical block 15, how many physical blocks must be read from the disk?
1 Mark Question Two Consider a file system on a disk that has both logical and physical block sizes of 512 tebytes. Assume that the information about each file is already in memory. For each of the three allocation strategies (contiguous, linked, and indexed), answer these at 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...
1. (10 pts) What is the largest file size if the inode is as follows: size of the inode is 128 Bytes out of which 64 Bytes are used for layout information, . each pointer is of size 8 Bytes and the file system block size is 4 KBytes, the inode has 2 direct pointers, 2 single indirect pointers, 2 double indirect pointers, and 2 triple indirect pointers 2. (10 pts) Find the average seek time (under the assumptions we...
Computer Science Operation System question. I will give thumb up, thank you! Consider a file system that uses inodes to represent files. This file system has 16 direct disk blocks, as well as single, double, and triple indirect disk blocks. This file system is illustrated in the below figure. Please notice that the tables pointed to by the indirect pointers are full sized blocks that only stores pointers. mode owners (2) timestamps (3) size block count data data data direct...
How many disk accesses are needed to bring byte 4090 of a file into memory when the file is stored using double indirect indexed allocation? Assume that only the file's FCB is in memory, block pointers require 32 bits, and that blocks hold 1024 bytes each. How many disk accesses are needed to bring byte 4090 of a file into memory when the file is stored using double indirect indexed allocation? Assume that only the file's FCB is in memory,...
Really don't know what its about... Course in operating system, file system Question 2. File Systems (10 marks) (a) Consider a 32GB hard disk and a FAT file system with 24 bits cluster (block) address. What is the minimum block (cluster) size in order to fully utilize all space in the hard disk? (3 marks) (b) Consider an index-based file system with the inode containing 64 direct pointers, 1 indirect pointer, and 1 double-indirect pointer. Suppose the size of a...