You are here: Home » Network » Administration » Everything you want to know about the filesystems

Everything you want to know about the filesystems

The filesystem is the methods and data structures used by the operating system used to store information about files and their contents on the partition. It is a way of organizing files on disk. The word is also used in the sense of disk partitions. This can be a bit confusing.

The difference between the disk and partition, or the file system is important. Several programs (programs include creating file systems) are working on the basis of sectors; if the operation of a system file is destroyed or seriously damaged. Most programs work based on the file system, they will not work on a partition that does not contain it (or a partition that contains bad system files).

Before using the partition or drive as a file system should be to prepare it, to create the right structure. This process is called creating a file system.

Most file systems used by Unix is generally similar (or are functionally similar). However, the details may vary significantly. Common ideas are superblock, inode, data block, directory block, and indirect block. Superblock contains information about the system as a whole, eg. Size (the exact content depends on the filesystem). I-node contains all information about a file, except its name. The name is stored in the directory together with the number of i-node. The directory entry includes the name, number and i-node files. I-node contains the numbers of several data blocks, which are used to store the file. Automatically allocating space allows you to store only a few numbers, but if necessary it will be dynamically Allocating additional space. Allocating blocks dynamically called direct. The name indicates that in order to find the number of the data block must be found first intermediate block. Typically, UNIX file system allows you to create holes in the files. They are created using lseek. That is, the system goes to zero on occurrence of a given location. However, it does not address the disk. This happens often for small binaries, Linux shared libraries, some databases, and on other occasions. Holes are stored by recording a special value in the address field of an indirect block or inode. This special address means that the file is a hole.

Linux supports an enormous amount of file systems. I will try to bring the most important of them.

  • minix – the oldest, considered the most reliable, but it has significant limitations (missing time stamps, file names can be maxymalnie 30 characters, the file system can have up to 64 MB).
  • ext4 – was developed as a series of backward-compatible extensions to ext3, provides support for volumes up to 1 exbibyte (EIB). The size of a single file must not exceed 16 Tb.
  • reiserfs – was one of the first journaling file systems, journaling provides atomicity file system operations, unlike the ext2, for which the response time of the file system is unpredictable.
  • msdos – compatible with MS-DOS (OS / 2 and Windows NT) FAT file system.
  • nfs – network file system allows sharing file systems over a network, you can create diskless.
  • hpfs – filesystem from OS/2.

The choice is often dictated by the file system is a matter of compatibility. If you can use these systems, but if the compatibility is not required to choose the best ext2, since it has all the necessary capabilities and this is efficient.