Question

In: Computer Science

How do directories access eachother in a direct accessed allocation file system (i. E where I...

How do directories access eachother in a direct accessed allocation file system (i. E where I nodes access data blocks directly). So if the directory test wanted to access the directory Foo, what steps would have to be taken using blocks and writing to disk?

Solutions

Expert Solution

There are three types of allocation:

  1. contiguous allocation
  2. linked allocation
  3. indexed allocation.

The contiguous allocation method requires each file to occupy a set of contiguous address on the disk. Disk addresses define a linear ordering on the disk. When a file has to be stored on a disk, system search for contiguous set of blocks as required by the file size i.e. system waits till it finds required number of memory blocks in sequence. When space is available system stores the file in the disk and makes an entry in the directory.

With this ordering, accessing block b+1 after block b normally requires no head movement. Contiguous allocation of a file is defined by the disk address and the length of the first block. If the file is n blocks long, and starts at location b, then it occupies blocks b, b+1, b+2, …, b+n-1. The directory entry for each file indicates the address of the starting block and the length of the area allocated for this file.

In linked allocation, each file is a linked list of disk blocks. The directory contains a pointer to the first and optionally the last block of the file. For example, a file of 5 blocks which starts at block 4, might continue at block 7, then block 16, block 10, and finally block 27. Each block contains a pointer to the next block and the last block contains a NIL pointer. The value -1 may be used for NIL to differentiate it from block 0.

Linked allocation does not support random access of files, since each block can only be found from the previous. Indexed allocation solves this problem by bringing all the pointers together into an index block. One disk block is just used to store DBAs (disk block addresses) of a file.


Related Solutions

Linux Directories, File Properties, and the File System in C Code your version of mv command...
Linux Directories, File Properties, and the File System in C Code your version of mv command in C The mv command is more than just a wrapper around the rename system call. Write a version of mv that accepts two argument. The first argument must be the name of a file, and the second argument may be the name of a file or the name of a directory. If the destination is the name of a directory, then mv moves...
Linux Directories, File Properties, and the File System in C Your version of find command Try...
Linux Directories, File Properties, and the File System in C Your version of find command Try running the find command in the shell and observe the output. Try it in different folders to make sure you understand what it prints out. $ find Write your version of the find command and add comments.
Linux Directories, File Properties, and the File System in C Understanding Unix/Linux Programming Your version of...
Linux Directories, File Properties, and the File System in C Understanding Unix/Linux Programming Your version of mv command The mv command is more than just a wrapper around the rename system call. Write a version of mv that accepts two argument. The first argument must be the name of a file, and the second argument may be the name of a file or the name of a directory. If the destination is the name of a directory, then mv moves...
I need at least a page. Section #2: Accessing Data Where and how do you access...
I need at least a page. Section #2: Accessing Data Where and how do you access information stored in a Database? Discuss how you use information either at work, school or in your personal life. For example: accessing a product inventory, customer account information, checking the balance or making a deposit in your bank account, etc. What application do you use to reference this information, such as using a web interface to access an XML or MySQL database? Further outline...
How do I compute overhead cost for direct labor?
How do I compute overhead cost for direct labor?
How do I do this: Write a program that can read a text file of numbers...
How do I do this: Write a program that can read a text file of numbers and calculate the mean and standard deviation of those numbers. Print the result in another text file. Put the result on the computer screen. EACH LINE OF THE PROGRAM MUST BE COMMENTED!
Why is a device such as a tape-drive a poor secondary storage device for Random/Direct access to a file?
Why is a device such as a tape-drive a poor secondary storage device for Random/Direct access to a file?
How do National Parks in the United States, Australia and New Zealand differ from eachother in...
How do National Parks in the United States, Australia and New Zealand differ from eachother in the 19th century?
Can you show me the steps it takes to do a direct allocation based on the...
Can you show me the steps it takes to do a direct allocation based on the following criteria: Maintenance Personnel Printing Developing Machine-hours — 1,000 1,000 3,000 Labor-hours 500 — 500 2,000 Department direct costs $ 5,000 $ 12,000 $ 15,000 $ 10,00
Where do I find price/earnings ratio (PE) and how do I equate it in excel? Is...
Where do I find price/earnings ratio (PE) and how do I equate it in excel? Is it in the income sheet? If so, what is the formula?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT