18.4 Introduction to File Systems

   

A file system is a structure in which files and directories are stored. A file system determines how disk space will be allocated to different files on the disk. The file system also keeps records of allocated and free space on a disk. The file system maintains a directory tree for listing files and directories existing on the file system. It keeps owner and group information and user access permissions for files and directories.

HP-UX creates multiple file systems. If you are using LVM, each logical volume contains one file system. Thus, the number file systems created is eight by default. Multiple file systems are used for a number of reasons. A file system can be managed and repaired while other file systems are in use. You can also extend or reduce individual volumes so that disk space may be utilized in a more efficient way.

The area allocated to a file system is divided into two major parts , the user area and the metadata area. The user area contains actual user data (the data that you store in files). The metadata area contains file system structural information partitioned as follows .

  • The Superblock contains information about the file system type, size , and pointers to other metadata structures. HP-UX keeps multiple copies of the superblock.

  • Inodes keep records of file attributes, such as the owner and group of the file, file permissions, type of file, number of hard links associated with the file, time and date stamps, and file size. It also has pointers to the file data area. Every file is associated with an inode. Inodes are referenced by numbers . Inode 02 always represents the root directory.

  • The directory area keeps records of file names and related inode numbers.

When you use the cat command to display the contents of a file, HP-UX goes to the directory area to find the inode number associated with the file. It then locates the inode and from it gets a pointer to the data area of the file. After that, it displays the contents of that area on your terminal screen.

File System Types

HP-UX supports many types of file systems. High Performance File System (HFS) is used for the /stand mount point where the HP-UX kernel is stored. Journaled File System (JFS) is used for other volumes in LVM. Network File System (NFS) is used for mounting file systems over the network from a file server. CD-ROM File System (CDFS) is used for storing files on CD-ROM.

Every file system has its own characteristics and methods of storing information. From the user point of view, all file systems are the same, as the same commands are used for file manipulation in all file systems.

One system can simultaneously have all supported types of file systems. You can use the fstyp command to determine what type of file system is on a particular device.

More on Hard and Soft Links

File links are created using the ln command and are used to access a single file with multiple file names. By default, the ln command creates a hard link. For example, to link the file /home/boota/myfile with /home/boota/linkfile , you can use following command.

 ln /home/boota/myfile /home/boota/linkfile 

After using this command, linkfile will be created and will contain the same data as myfile . On the file system level, a directory entry with the name linkfile is created, which points to the same inode used by myfile . Hard links can be created only within a file system; you cannot link directories with hard links.

To create a soft link, you use the -s option with the ln command. When creating a soft link, HP-UX creates a file entry with its own inode number in the directory area. This inode number then points to a data block that contains the file name to which the link is established. Soft links can link directories and can be used between file systems.

If you delete a file that has soft links, the links are not actually deleted, as they have their own inodes. But when you try to access a linked file for which the original file has been deleted, an error message will be shown.


   
Top


HP Certified
HP Certified: HP-UX System Administration
ISBN: 0130183741
EAN: 2147483647
Year: 2000
Pages: 390
Authors: Rafeeq Rehman

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net