Disk file system on linux

Introduction to File systems

File systems are one of the things any newcomer to linux must become acquainted with. In the world of Microsoft you never really have to worry about it, the default being NTFS. Linux however, being built on a world of open source and differing opinions, is not limited in this way and so the user should have an understanding of what a file system is, and how it affects the computer.

At the core of a computer, it’s all 1s and 0s, but the organization of that data is not quite as simple. A bit is a 1 or a 0, a byte is composed of 8 bits, a kibibyte is 1024 (i.e. 2^10) bytes, a mebibyte is 1024 kibibytes and so on and so forth. All these bits and bytes are permanently stored on a Hard Drive. A hard drive stores all your data, any time you save a file, you’re writing thousands of 1s and 0s to a metallic disc, changing the magnetic properties that can later be read as 1 or 0. There is so much data on a hard drive that there has to be some way to organize it, like a library of books and the old card drawers that indexed all of them, without that index, we’d be lost. Libraries, for the most part, use the Dewey Decimal System to organize their books, but there exist other systems to do so, none of which have attained the same fame as Mr. Dewey’s invention. File systems are the same way. The ones most users are aware of are the ones Windows uses, the vFat or the NTFS systems, these are the Windows default file systems.

There are several different attributes which are necessary in defining file systems, these include their max file size, max partition size, whether they journal or not.

Journaling

A journaling file system is more reliable when it comes to data storage. Journaling file systems do not necessarily prevent corruption, but they do prevent inconsistency and are much faster at file system checks than non-journaled file systems. If a power failure happens while you are saving a file, the save will not complete and you end up with corrupted data and an inconsistent file system. Instead of actually writing directly to the part of the disk where the file is stored, a journaling file system first writes it to another part of the hard drive and notes the necessary changes to a log, then in the background it goes through each entry to the journal and begins to complete the task, and when the task is complete, it checks it off on the list. Thus the file system is always in a consistent state (the file got saved, the journal reports it as not completely saved, or the journal is inconsistent (but can be rebuilt from the file system)). Some journaling file systems can prevent corruption as well by writing data twice.

Читайте также:  Аналог tracert для linux

Table

Now below is a very brief comparison of the most common file systems in use with the Linux world.

Источник

Linux File System Explained: Boot Loading, Disk Partitioning, BIOS, UEFI and File System Types

The concept of boot loading, disk partitioning, partition table, BIOS, UEFI, File system types, etc. is little known to most of us. We comes across these terminology very often but rarely took the pain to know these and their meaning in details. This article in an effort to fulfil this gap in the most easiest way possible.

Linux File System Types

Partition Table

One of the very first decision we comes across while installing a Linux Distribution is the partitioning of its disk, the file-system to use, implement encryption for security which varies with the change in architecture and platform. One of the most widely used Architecture, INTEL is undergoing some changes and it is important to understand these changes which on the other hand requires knowledge of boot process.

Many developers run both Windows and Linux on the same machine which may be a matter of preference or need. Most of the boot-loaders of today are smart enough to recognize any number of Operating System on the same box and provide menu to boot into the preferred one. Another way to achieve the same goal is to use virtualization using Xen, QEMU, KVM or any other preferred visualization tool.

BIOS Vs UEFI

If I remember correctly, till late 90‘s BIOS which stands for Basic Input/Output System was the only way to boot an Intel System. BIOS holds the partitioning Information in an special area called Master Boot Record (MBR) such that additional code gets stored in first sector of every boot-able partition.

In Late 90‘s Microsoft’s intervention with Intel resulted in Universal Extensible Firmware Interface (UEFI) the initial purpose of which was to boot securely. This mechanism of booting proved to be a challenge for rootkits specially which gets attached with boot sectors and were hard to detect with BIOS.

Boot with BIOS

Booting with BIOS requires placing of boot codes or boot sequence in MBR which is placed in the first sector of boot disk. In case if more than one Operating System is installed the installed boot loader is replaced by one common boot loader which places boot codes on every bootable disk during installation and updation automatically, which means user has the choice to boot into any of the installed OS.

Читайте также:  Операционная система линукс чье производство

However it is seen, specially on windows that a non-windows boot loader won’t update the system specially certain programs viz., IE but again there is not hard and fast rule nor it is documented any where.

Boot with UEFI

UEFI is the latest booting technology developed in close collaboration of Microsoft with Intel. UEFI requires the firmware to be loaded is digitally signed, a way to stop rootkits being attached with the boot partition. However the problem in booting Linux using UEFI is complex. Booting Linux in UEFI requires the keys used needs to be make public under GPL which is against the Linux protocol.

However it is still possible to install Linux on UEFI specification by disabling ‘Secure boot‘ and enabling ‘Legacy Boot‘. Boot codes in UEFI is placed under subdirectories of /EFI, special partition in the first sector of disk.

Types of Linux File Systems

A standard Linux Distribution provides the choice of partitioning disk with the file formats listed below, each of which has special meaning associated with it.

ext2, ext3, ext4

These are the progressive version of Extended Filesystem (ext), which primarily was developed for MINIX. The second extended version (ext2) was an improved version. Ext3 added performance improvement. Ext4 was a performance improvement besides additional providing additional features.

JFS

The Journaled File System (JFS) was developed by IBM for AIX UNIX which was used as an alternative to system ext. JFS is an alternative to ext4 currently and is used where stability is required with the use of very few resources. When CPU power is limited JFS comes handy.

ReiserFS

It was introduced as an alternative to ext3 with improved performance and advanced features. There was a time when SuSE Linux‘s default file format was ReiserFS but later Reiser went out of business and SuSe had no option other than to return back to ext3. ReiserFS supports file System Extension dynamically which was relatively an advanced feature but the file system lacked certain area of performance.

XFS

XFS was a high speed JFS which aimed at parallel I/O processing. NASA still usages this file system on their 300+ terabyte storage server.

Btrfs

B-Tree File System (Btrfs) focus on fault tolerance, fun administration, repair System, large storage configuration and is still under development. Btrfs is not recommended for Production System.

Читайте также:  Sed linux несколько команд
Clustered File Format

Clustered file System is not required for booting but best suited in shared environment form storage point of view.

Non-Linux File Format

There are lots of File format not available under Linux but are used by other OS’s. Viz., NTFS by Microsoft, HFS by Apple/Mac os, etc. Most of these can be used under Linux by mounting them using certain tools like ntfs-3g to Mount NTFS file system but not preferred under Linux.

Unix File Format

There are certain File formats used widely in Linux but not preferred under Linux specially for installing Linux root System. e.g., UFS of BSD.

Ext4 is the preferred and most widely used Linux file System. In certain Special case XFS and ReiserFS are used. Btrfs is still used in experimental environment.

Disk Partitioning

The first stage is disk Partitioning. While partitioning we should keep the below points in mind.

  1. Partition keeping backup and recovery in mind.
  2. Space limitation mark in partition.
  3. Disk management – Administrative Function.

Logical Volume Management

LVM is a complex partitioning used in Large Storage Installation. The LVM structure overlays the actual physical disk partitioning.

Swap

Swap is used for memory paging in Linux specially during System Hibernation. The current stage of System is written to Swap when the system is paused (Hibernate) at a point of time.

A System which will never go hibernation needs a swap space equal to the size of its RAM.

Encryption

The last stage is encryption which ensures data safely. Encryption can be at the level of Disk as well as Directory. In Disk encryption, the whole disk is encrypted can requires some kind of special codes to decrypt it.

However its an complex issue. The decryption code can not remain on the same disk undergoing encryption hence we need certain special hardware or let the motherboard do it.

The disc encryption is relatively easy to achieve and is less complex. In this case the decryption code remains on the same disk, somewhere in different directory.

Disk encryption is necessary in server building and may be a legal issue based the the geographical location you are implementing it.

Here in this article, we tried throwing lights on File System Management as well as disk management in much more depth fashion. That’s all for now. I’ll be here again with Another Interesting article worth knowing. Till then Stay tuned and connected to Tecmint and don’t forget to provide us with your valuable feedback in the comment section below.

Источник

Оцените статью
Adblock
detector