File Systems · Operating System
12 questions · asked in 10 of 27 years (2000–2026)
MCQ 8 · NAT 41-mark 8 · 2-mark 4
2000Questions per year2026
Questions 6–10 of 12
A file system with 300 GByte disk uses a file descriptor with 8 direct block addresses, 1 indirect block address and 1 doubly indirect block address. The size of each disk block is 128 Bytes and the size of each disk block address is 8 Bytes. The maximum possible file size in this file system is
Answer: (B)
One block can hold 128 / 8 = 16 addresses.
Most blocks a file can have = 8 (direct) + 16 (single indirect) + 16 16 (double indirect) = 280
Largest file size = 280 128 B = 35840 B = 35 KB
Answer: 35 KBytes
Most blocks a file can have = 8 (direct) + 16 (single indirect) + 16 16 (double indirect) = 280
Largest file size = 280 128 B = 35840 B = 35 KB
Answer: 35 KBytes
The data blocks of a very large file in the Unix file system are allocated using
Answer: (D)
Contiguous allocation needs one long free run and causes external fragmentation. Linked allocation makes random access slow, since you follow the chain block by block. Plain indexed allocation needs one index block that cannot hold enough pointers for a very large file.
Unix keeps an inode for each file. The inode has some direct pointers to data blocks, then a single indirect pointer (to a block of pointers to data blocks), a double indirect pointer and a triple indirect pointer. So small files use direct pointers and very large files use the multi-level indirect blocks. This is an extension of indexed allocation.
Answer: (D)
Unix keeps an inode for each file. The inode has some direct pointers to data blocks, then a single indirect pointer (to a block of pointers to data blocks), a double indirect pointer and a triple indirect pointer. So small files use direct pointers and very large files use the multi-level indirect blocks. This is an extension of indexed allocation.
Answer: (D)
A student wishes to create symbolic links in a computer system running Unix. Three text files named "file1", "file2" and "file3" exist in her current working directory, and the student has read and write permissions for all three files. Assume that file1 contains information about her hobbies, file2 contains information about her friends and file3 contains information about her courses. The student executes the following sequence of commands from her current working directory.
Which of the following types of information would be lost from her file system?
I.Hobbies
II.Friends
III.Courses
ln -s file1 file2
ln -s file2 file3 Which of the following types of information would be lost from her file system?
I.Hobbies
II.Friends
III.Courses
Answer: (B)
ln -s makes a symbolic link: ln -s target link_name. Here each command makes a link that takes the place of the existing file with the link's name.
- ln -s file1 file2: file2 becomes a link to file1. The old contents of file2 (friends) are replaced, so friends are lost.
- ln -s file2 file3: file3 becomes a link to file2. The old contents of file3 (courses) are replaced, so courses are lost.
file1 is only the target of a link and is never changed. It still holds the hobbies, and file3 and file2 now both lead to it: file3 file2 file1.
So II and III are lost, and I is kept.
Answer: (B)
- ln -s file1 file2: file2 becomes a link to file1. The old contents of file2 (friends) are replaced, so friends are lost.
- ln -s file2 file3: file3 becomes a link to file2. The old contents of file3 (courses) are replaced, so courses are lost.
file1 is only the target of a link and is never changed. It still holds the hobbies, and file3 and file2 now both lead to it: file3 file2 file1.
So II and III are lost, and I is kept.
Answer: (B)
In a particular Unix OS, each data block is of size 1024 bytes, each node has 10 direct data block addresses and three additional addresses: one for single indirect block, one for double indirect block and one for triple indirect block. Also, each block can contain addresses for 128 blocks. Which one of the following is approximately the maximum size of a file in the file system?
Answer: (B)
The largest file uses all the direct blocks and all the indirect blocks. Each block is 1024 bytes and holds 128 addresses.
Number of data blocks =
Size = bytes
The triple indirect part is bytes = 2 GB.
The other parts together are MB, which is small next to 2 GB.
So the maximum file size is about 2 GB.
Answer: (B)
Number of data blocks =
Size = bytes
The triple indirect part is bytes = 2 GB.
The other parts together are MB, which is small next to 2 GB.
So the maximum file size is about 2 GB.
Answer: (B)
A unix-style I-node has 10 direct pointers and one single, one double and one triple indirect pointers. Disk block size is 1 Kbyte, disk block address is 32 bits, and 48-bit integers are used. What is the maximum possible file size?
Answer: (C)
Block size = 1 KB = bytes. A block address is 32 bits = 4 bytes, so one block holds addresses.
Data blocks the I-node can reach:
- Direct: 10 blocks
- Single indirect: blocks
- Double indirect: blocks
- Triple indirect: blocks
Maximum file size = bytes. The triple-indirect part is by far the largest, so the total is just above bytes. No option equals it exactly, and the closest is bytes.
The 32-bit block address and the 48-bit integer do not cut this down. 32 bits can name blocks, which is bytes, and a 48-bit integer can count up to bytes. Both are more than , so the pointer layout of the I-node is the real limit.
Answer: (C)
Data blocks the I-node can reach:
- Direct: 10 blocks
- Single indirect: blocks
- Double indirect: blocks
- Triple indirect: blocks
Maximum file size = bytes. The triple-indirect part is by far the largest, so the total is just above bytes. No option equals it exactly, and the closest is bytes.
The 32-bit block address and the 48-bit integer do not cut this down. 32 bits can name blocks, which is bytes, and a 48-bit integer can count up to bytes. Both are more than , so the pointer layout of the I-node is the real limit.
Answer: (C)
Keep practising