# Recent questions tagged file-system

1
The file structure that redefines its first record at a base of zero uses the term relative organization. key fielding. dynamic reallocation. all of these.
2
Implement a simulated file system that will be fully contained in a single regular file stored on the disk. This disk file will contain directories, i-nodes, free-block information, file data blocks, etc. Choose appropriate algorithms for maintaining free-block ... to create/delete directories, create/delete/open files, read/write from/to a selected file, and to list directory contents.
3
Implement a program to measure the impact of application-level buffer sizes on read time. This involves writing to and reading from a large file (say, $2$ GB). Vary the application buffer size (say, from $64$ bytes to $4$ KB). Use timing measurement ... buffer sizes. Analyze the results and report your findings: does buffer size make a difference to the overall write time and per-write time?
4
Write a new version of the UNIX ls program. This version takes as an argument one or more directory names and for each directory lists all the files in that directory, one line per file. Each field should be formatted in a reasonable way given its type. List only the first disk address, if any.
5
Write a program that scans all directories in a $UNIX$ file system and finds and locates all i-nodes with a hard link count of two or more. For each such file, it lists together all file names that point to the file.
6
Write a program that starts at a given directory and descends the file tree from that point recording the sizes of all the files it finds. When it is all done, it should print a histogram of the file sizes using a bin width specified as a parameter (e.g., with $1024,$ file sizes of $0$ to $1023$ go in one bin, $1024$ to $2047$ go in the next bin, etc.).
7
Write a program that reverses the bytes of a file, so that the last byte is now first and the first byte is now last. It must work with an arbitrarily long file, but try to make it reasonably efficient.
8
In many UNIX systems, the i-nodes are kept at the start of the disk. An alternative design is to allocate an i-node when a file is created and put the i-node at the start of the first block of the file. Discuss the pros and cons of this alternative.
9
How many disk operations are needed to fetch the i-node for a file with the path name /usr/ast/courses/os/handout.t? Assume that the i-node for the root directory is in memory, but nothing else along the path is in memory. Also assume that all directories fit in one disk block.
1 vote
10
A UNIX file system has $4-KB$ blocks and $4-$byte disk addresses. What is the maximum file size if i-nodes contain $10$ direct entries, and one single, double, and triple indirect entry each?
11
Files in $MS-DOS$ have to compete for space in the $FAT -16$ table in memory. If one file uses $k$ entries, that is $k$ entries that are not available to any other file, what constraint does this place on the total length of all files combined?
1 vote
12
Given a disk-block size of $4\: KB$ and block-pointer address value of $4$ bytes, what is the largest file size (in bytes) that can be accessed using $10$ direct addresses and one indirect block?
13
A certain file system uses $4-KB$ disk blocks. The median file size is $1 KB.$ If all files were exactly $1 KB,$ what fraction of the disk space would be wasted? Do you think the wastage for a real file system will be higher than this number or lower than it? Explain your answer.
14
Consider the idea behind Fig. $4-21,$ but now for a disk with a mean seek time of $6\: msec,$ a rotational rate of $15,000\: rpm,$ and $1,048,576$ bytes per track. What are the data rates for block sizes of $1\: KB, 2\: KB,$ and $4\: KB,$ respectively?
15
Consider a disk that has $10$ data blocks starting from block $14$ through $23.$ Let there be $2$ files on the disk$: f1$ and $f2.$ The directory structure lists that the first data blocks of $f1$ and $f2$ are respectively $22$ and $16.$ Given the $FAT$ table entries as ... $(x, y)$ indicates that the value stored in table entry $x$ points to data block $y.$
16
Consider an application where students’ records are stored in a file. The application takes a student $ID$ as input and subsequently reads, updates, and writes the corresponding student record; this is repeated till the application quits. Would the "block read ahead" technique be useful here?
17
For an external USB hard drive attached to a computer, which is more suitable: a write through cache or a block cache?
18
The performance of a file system depends upon the cache hit rate (fraction of blocks found in the cache). If it takes $1\: msec$ to satisfy a request from the cache, but $40\: msec$ to satisfy a request if a disk read is needed, give a formula for the mean time required to satisfy a request if the hit rate is $h.$ Plot this function for values of $h$ varying from $0$ to $1.0.$
19
Consider Fig. $4-27.$ Is it possible that for some particular block number the counters in both lists have the value $2?$ How should this problem be corrected?
20
It has been suggested that the first part of each UNIX file be kept in the same disk block as its i-node. What good would this do?
21
Suppose that file $21$ in Fig. $4-25$ was not modified since the last dump. In what way would the four bitmaps of Fig. $4-26$ be different?
22
We discussed making incremental dumps in some detail in the text. In Windows it is easy to tell when to dump a file because every file has an archive bit. This bit is missing in $UNIX.$ How do $UNIX$ backup programs know which files to dump?
23
Oliver Owl’s night job at the university computing center is to change the tapes used for overnight data backups. While waiting for each tape to complete, he works on writing his thesis that proves Shakespeare’s plays were written by extraterrestrial visitors. His text processor runs on the system being backed up since that is the only one they have. Is there a problem with this arrangement?
24
What would happen if the bitmap or free list containing the information about free disk blocks was completely lost due to a crash? Is there any way to recover from this disaster, or is it bye-bye disk? Discuss your answers for $UNIX$ and the $FAT -16$ file system separately.
25
The beginning of a free-space bitmap looks like this after the disk partition is first formatted$:\: 1000\: 0000\: 0000\: 0000$ (the first block is used by the root directory). The system always searches for free blocks starting at the lowest-numbered block, so after writing ... $A$ is deleted. File $C$ is written, using eight blocks. File $B$ is deleted.
26
Free disk space can be kept track of using a free list or a bitmap. Disk addresses require $D$ bits. For a disk with $B$ blocks, $F$ of which are free, state the condition under which the free list uses less space than the bitmap. For $D$ having the value $16$ bits, express your answer as a percentage of the disk space that must be free.
27
Consider a $4-TB$ disk that uses $4-KB$ blocks and the free-list method. How many block addresses can be stored in one block?