Create a directory tree See page 108, 109, 110
Operations of Adding a New FileStore PropertiesLocate a free inodeas 47Record the file information in the inodeStore DataLocate disk blocks for file content such as 627, 200, and 992.Record AllocationRecord the sequence of block numbers in the disk allocation section of the inodeAdd Filename to DirectoryAdd the new entry (47, userlist) to the directory.
Looking inside a directoryDirectory is a special kind of file that contains a list of names of files.Ls – 1ia  demodir  //i for inode numberLs –ia /			//root and parent of root 				//point to itself
The file system in practiceWhat will happen when you type:> cat userlistThe kernel searches the directory for the filename: userlist, inode number 47 foundLocate the real inode 47 in inode table. The inode contains a list of data block numbers.Go to the data block one by one to read the data with read system call.The permission is also checked from inode
STRUCTURE OF A REGULAR FILEThe blocks marked "direct”contain the numbers of disk blocks that contain real data.The block marked "single indirect" refers to a block that contains a list of direct block numbers.To access the data via the indirect block, the kernel must read the indirect block, find the appropriate direct block entry, and then read the direct block to find the data.
STRUCTURE OF A REGULAR FILEThe block marked "double indirect" contains a list of indirect block numbers, and the block marked "triple indirect" contains a list of "double indirect " block  numbers refers to a block that contains a list of direct block numbers.Assume that a logical block = I K bytesA block number is addressable by a 32 bit (4 byte) integer.Then a block can hold up to 256 block numbers.
A single indirect data block can hold 256 block numbers (1024 bytes/4 bytes)
Chapter 4 1

Chapter 4 1

  • 6.
    Create a directorytree See page 108, 109, 110
  • 11.
    Operations of Addinga New FileStore PropertiesLocate a free inodeas 47Record the file information in the inodeStore DataLocate disk blocks for file content such as 627, 200, and 992.Record AllocationRecord the sequence of block numbers in the disk allocation section of the inodeAdd Filename to DirectoryAdd the new entry (47, userlist) to the directory.
  • 12.
    Looking inside adirectoryDirectory is a special kind of file that contains a list of names of files.Ls – 1ia demodir //i for inode numberLs –ia / //root and parent of root //point to itself
  • 13.
    The file systemin practiceWhat will happen when you type:> cat userlistThe kernel searches the directory for the filename: userlist, inode number 47 foundLocate the real inode 47 in inode table. The inode contains a list of data block numbers.Go to the data block one by one to read the data with read system call.The permission is also checked from inode
  • 15.
    STRUCTURE OF AREGULAR FILEThe blocks marked "direct”contain the numbers of disk blocks that contain real data.The block marked "single indirect" refers to a block that contains a list of direct block numbers.To access the data via the indirect block, the kernel must read the indirect block, find the appropriate direct block entry, and then read the direct block to find the data.
  • 16.
    STRUCTURE OF AREGULAR FILEThe block marked "double indirect" contains a list of indirect block numbers, and the block marked "triple indirect" contains a list of "double indirect " block numbers refers to a block that contains a list of direct block numbers.Assume that a logical block = I K bytesA block number is addressable by a 32 bit (4 byte) integer.Then a block can hold up to 256 block numbers.
  • 17.
    A single indirectdata block can hold 256 block numbers (1024 bytes/4 bytes)