Machine-translated by Google. Questions are authored in English.
Top

File System Interface and Implementation Questions and Answers

1.

The link system call in UNIX is called link (sfname tfname) :

Which of the following statements are true ?

(1) sfname and tfname have the same inode after the call.
(2) sfname and tfname have the same directory entry after the call.
(3) sfname is an existing file before the call.
(4) tfname is an existing file before the call.

Exam Year(s)

MH SET - 2018, SET Exam - 2018,

Answer: A

The true statements are (1) and (3).

link(sfname, tfname) creates a new directory entry, tfname, pointing to the same inode as the existing file sfname, and increments the inode's link count. So after the call both names refer to the same inode (1), and sfname must already exist before the call (3).

Statement (2) is false: the call creates a second, separate directory entry, so the two names have different directory entries that share one inode. Statement (4) is false too: if tfname already exists the call fails, so any option containing (2) or (4) is wrong.

Please log in or register to report this question.

2.

Which command is used to manage hard disk partitions in a Linux system ?

Exam Year(s)

MH SET - 2019, SET Exam - 2019,

Answer: B

The command is fdisk.

fdisk is the Linux command-line utility for creating, deleting, resizing and listing partitions on a disk; for example, fdisk -l lists the partition tables of all disks.

df reports the free and used space of mounted file systems. dd copies and converts data block by block, for instance to clone a disk or write an image. iostat reports CPU and device input/output statistics. None of them manages partitions.

Please log in or register to report this question.

3.

Which of the following scenario most appropriately depicts the primary use of a distributed file system ?

Exam Year(s)

MH SET - 2020, SET Exam - 2020,

Answer: B

The primary use of a distributed file system is to Access data stored on remote computer systems.

A distributed file system such as NFS or AFS lets users and programs access files stored on other machines across a network as if they were on the local disk, with location transparency.

Replication for backup and splitting data across nodes are features some distributed file systems add, not their basic purpose, and multiple file systems on one computer is simply mounting, which needs no distribution.

Please log in or register to report this question.

4.

Which of the following is not a valid kernel data structure in Linux ?

Exam Year(s)

MH SET - 2021, SET Exam - 2021,

Answer: D

The structure that is not a Linux kernel data structure is the Sector table.

For open files the kernel keeps three levels of tables: a per-process file descriptor table, a system-wide open file table holding the file offset and access mode, and an in-memory inode table holding the inodes of the open files.

Sectors are handled by the block device layer and the disk driver, which address blocks directly; there is no kernel 'sector table' alongside the other three, so it is the odd one out.

Please log in or register to report this question.

5.

The 'read' system call returns :

Exam Year(s)

MH SET - 2021, SET Exam - 2021,

Answer: A

The read system call returns the total number of bytes read.

read(fd, buf, count) returns the number of bytes actually read into the buffer, which may be less than count; it returns 0 at end of file and -1 on an error. Programs loop on this value to read a whole file.

The file descriptor is what open() returns and what read takes as its first argument. read returns no separate success flag and no address of the file.

Please log in or register to report this question.

6.

A FAT (File Allocation Table) based file system is being used and the total overhead of each entry in the FAT is 4 bytes in size. Given a 100 × \(10^{6}\) bytes disk on which the file system is stored and data block size is \(10^{3}\) bytes, the maximum size of a file that can be stored on this disk in units of \(10^{6}\) bytes is........... .

Exam Year(s)

MH SET - 2023, SET Exam - 2023,

Answer: A

The maximum file size is about 99.6, so the answer is 99.55 to 99.65.

The disk holds \(100 \times 10^{6} / 10^{3} = 10^{5}\) blocks, and the FAT needs one 4-byte entry per block:

\[ \begin{aligned} \text{FAT size} &= 10^{5} \times 4 = 0.4 \times 10^{6} \text{ B} \\ \text{max file} &= 100 \times 10^{6} - 0.4 \times 10^{6} \\ &= 99.6 \times 10^{6} \text{ B} \end{aligned} \]

Everything not taken by the FAT is available to a single file, so the answer is 99.6 in units of \(10^{6}\) bytes. A value above 100 is impossible on a disk of that size, and the lower ranges overstate the FAT's overhead.

Please log in or register to report this question.

7.

We need to design a filesystem to store image files having maximum one block size. Which of the following disk space allocation methods is most appropriate to meet this requirement ?

Exam Year(s)

MH SET - 2023, SET Exam - 2023,

Answer: A

The most appropriate method is Contiguous Allocation.

If no file is bigger than one block, every file occupies exactly one block, so contiguous allocation simply records that block's address. It needs no pointers and no index blocks, gives direct access in one disk read, and cannot suffer external fragmentation because every allocation is the same size.

Linked allocation would waste space on a next-block pointer that is never used. Indexed allocation would need a whole index block for each one-block file, doubling the space and the reads. Hashed allocation is not one of the standard disk allocation methods.

Please log in or register to report this question.

Loading…

Other Subjects

Tags: File System Interface and Implementation Questions and Answers || File System Interface and Implementation MCQ Questions and Answers || File System Interface and Implementation GK Questions and Answers || File System Interface and Implementation GK MCQ Questions || File System Interface and Implementation Multiple Choice Questions and Answers || File System Interface and Implementation GK || GK on File System Interface and Implementation || Operating Systems Questions and Answers || Operating Systems MCQ Questions and Answers || Operating Systems GK Questions and Answers || GK on Operating Systems