13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Physical representation 2236.4 Multiple disksEven personal computers often have several disks. Each disk can have its own independentset of files, in which case the absolute file name can include a disk specification. Forexample, in MS-DOS an absolute file name starts with the name of the disk. For example,one could name a file A:patish.mod to indicate that it is on disk A. If thecurrent working directory is A:, then there is no need to use the absolute name.On large installations, where there may be many disks, it is an inconvenience toremember where each file resides. Instead, all the disks can be treated as a single set offiles. For concreteness, we will assume that a hierarchical file structure is in use. We canimagine various ways to distribute the hierarchy across disks. These methods range fromvery fine grain to very course.The finest grain method allows individual files to cross disk boundaries. Eachpointer to a data block includes both the disk identifier and the block number. The list offree blocks also spans disks. This idea is depicted in Figure 6.14. This method hasdecided advantages: Mammoth files such as file 3 can be stored, even though no one diskcan hold them, and sequential access can be extremely fast, since seeks on some diskscan overlap transfers on others. However, all pointers to disk blocks are longer, and asingle failed disk can make almost all files unreadable. Furthermore, disks such asfloppies cannot be dismounted, since they no longer hold an independent set of files. Ifwe were to remove disk C, not only would file 1 disappear, but also part of file 3.At the other extreme, we can require that each disk be a self-contained subtree ofthe file hierarchy. Such course-grain division is used by Unix. It is shown in Figure6.15. Each of the three disks shown has its own directory structure. When the operatingsystem is first started, only one disk, let’s say disk A, is used. Only files 1 (the root directory),2, 3, and 4 can be accessed. However, the other disks can be mounted into thehierarchy by means of a service call:Mount(device,file name). This call updates the mount table in the file manager.Each entry in the table gives the device number (such as disk B) and the index offile 2file 1file 3disk Adisk BFigure 6.14 Files crossing disk boundariesdisk C

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!