File header

From VSI OpenVMS Wiki
Jump to: navigation, search

A file header is a portion of INDEXF.SYS that contains file information such as file ID, file name, modification date, owner, protection code, pointers to data on disk, etc.

File headers consist of three major parts:

  • An area that contains File ID, organization, owner, protection code and pointers to the map and ACL areas
  • An identification area containing name and date information
  • The map/ACL area containing ACL and pointers (offsets) to data on disk

Viewing a file header

To view a file header, you can use the DUMP/HEADER command. To avoid seeing the ACL list that is also being dumped, specify /BLOCK=COUNT=0.

$ dump/header/block=count=0 a.txt;1

Fragmentation

Sometimes a file can have a large ACL or be very fragmented on the disk; in this case, multiple file headers can be allocated to that file so that the original file header contains the location of the extension file header, and so on.

Alternative ways to view file information

There are ways to view file attributes and information contained in the file header:

  • DIRECTORY /FULL

This command displays the size, owner, important dates associated with the file, and some attributes.

This lexical function lets you access the attributes for a specific file.

Number of Headers

The number of file headers is controlled at the moment of volume initialization with the INITIALIZE /HEADERS or /MAXIMUM_FILES qualifier. The minimum and default value is 16, which is generally insufficient for ODS-2 and ODS-5 volumes. The maximum is the value set with the /MAXIMUM_FILES qualifier. However, if /LIMIT is specified and no value is specified for /HEADERS or /MAXIMUM_FILES, the following defaults apply:

  • /MAXIMUM_FILES: 16711679 files
  • /HEADERS: 0.5 percent of the size of the current device MAXBLOCK (an F$GETDVI item code)

For example, for a 33GB disk, the default number of preallocated header blocks would be approximately 355000.

Note that you cannot change the number of file headers without reinitializing the volume, so be mindful of the value of this qualifier.

/HEADERS is useful when you want to create a number of files and want to streamline the process of allocating space for that number of file headers. If you do not specify this qualifier, the file system dynamically allocates space as it is needed for new headers on the volume.

The default value for the /HEADERS qualifier is generally insufficient for ODS-2 and ODS-5 disks. To improve performance and avoid SYSTEM-F-HEADERFULL errors, VSI recommends that you set this value to be approximately the number of files that you anticipate having on your disk; however, grossly overestimating this value will result in wasted disk space.

The /HEADERS qualifier controls how much space is initially allocated to INDEXF.SYS for headers. Each file on a disk requires at least one file header and each header occupies one block within INDEXF.SYS. Files that have many Access Control Entries (ACE) or are very fragmented may use more than one header.

The default value of 16 leaves room for less than 10 files to be created before INDEXF.SYS must extend; therefore, try to estimate the total number of files that will be created on the disk and specify it here. This will improve disk access performance.

Overestimating the value may lead to wasted disk space. This value cannot be changed without reinitializing the volume. INDEXF.SYS is limited as to how many times it may extend. When the map area in its header (where the retrieval pointers are stored) becomes full, file creation fails with the message "SYSTEM-W-HEADERFULL."