Computer literacy, help and repair

Linux file systems comparison. Windows file systems

(2010) with some additions and clarifications.

Journaling

Before talking about file systems - let's briefly consider the concept of " logging«.

Journaling in one form or another is used in almost all modern file systems.

Journaling is used only during disk write operations, and is a kind of buffer for all such operations. This approach helps to solve problems that occur during a disk write operation, in which the computer shuts down, for example, due to a power outage. Without journaling, in such cases it is impossible to find out which files were written and which were not or were partially written.

When using journaling, the file is first written to a journal (or "log"). After that, the file is written to the hard drive and then removed from the log, after which the write operation is considered completed. If the power is turned off during the recording, then after turning on the system, the file system can check the journal and find pending operations.

The biggest problem with using logging is that it requires additional system resources. In order to reduce such overhead, journaled file systems do not write the entire file to the journal, but only certain metadata.

Ext file systems

Ext

Means " Extended» (extended) file system, and was the first to be designed specifically for linux-systems. There are 4 file systems in total today. Ext. The very first one is just Ext- was a major update of the OS FS Minix.

Characteristics Ext:

  • maximum file size: 2GB;
  • maximum partition size: 2GB;

The developer is, and the first version appeared in 1992.

We will not consider it, because. You will most likely never encounter it again.

ext2

- non-journaling FS, released in 1993, the main task for which was to support devices up to 2 terabytes in size. Because at ext2 no logging - it performs much fewer write operations to disk, which affects the performance and scope of its application.

Characteristics:

  • maximum file size: 16GB - 2TB;
  • maximum partition size: 2 - 32 TB;
  • the maximum name size is 255 characters.
  • due to the low number of data write-delete operations, it is ideal for various flash drives;
  • at the same time modern SSD- disks have improved indicators of their life cycle (durability of drive elements) and some other features that level out shortcomings ext2 as a non-journaled filesystem.

Ext3

- appeared in 2001, along with the release Linux Kernel 2.4.15. Actually is the same ext2, but with logging support. main goal Ext3 was the possibility of its backward compatibility with ext2 without the need to reformat partitions. The advantages include the fact that most of the testing, bug fixes, etc. for Ext3 was the same as in ext2 what did Ext3 more stable and faster FS.

Characteristics:

  • maximum file size: 16GB - 2TB (depending on block size);
  • maximum partition size: 2 - 32 TB (depending on block size);
  • suitable if you are using ext2 and you want to use logging;
  • due to its performance and stability, it will probably be the most suitable FS for database servers;
  • maybe not the best choice for servers, because does not support snapshots ( shapeshot) FS and difficulties with recovering deleted files.

Ext4

- as well as Ext3 is backward compatible with previous versions of the FS. As a matter of fact, you can mount ext2 or Ext3 how Ext4- and under certain conditions to achieve greater productivity. You can also mount Ext4 how Ext3 without any side effects.

Ext4 The stable version was released in 2008. Is the first FS from the "family" Ext using the mechanism ", which allows you to achieve less file fragmentation and increase the overall performance of the file system. Besides, in Ext4 implemented lazy write mechanism ( ), which also reduces disk fragmentation and reduces CPU load. On the other hand, although the lazy write mechanism is used in many file systems, due to the complexity of its implementation, it increases the likelihood of data loss. See for more details.

Characteristics:

  • maximum file size: 16 TB;
  • maximum filename size: 255 characters.
  • the best choice for SSD;
  • best performance compared to previous Etx-systems;
  • it is also great as a file system for database servers, although the system itself is younger Ext3.

btrfs

- developed by the company Oracle in 2007. Its scheme is similar to ReiserFS, the basic principle of its work is the so-called. . btrfs allows you to dynamically allocate inodes, create snapshots of the FS while it is running, perform transparent file compression and defragment it in production mode.

Although the stable version btrfs not yet included in most distributions linux(today, judging by the post - only SUSE And Oracle Linux) - it may well replace Ext3/4 in the foreseeable future and already provides conversion opportunities Ext3/4 in btrfs. In addition, it is worth mentioning that one of the developers Ext, said that " btrfs is a step into the future.”

Characteristics:

  • maximum partition size: 16 EB;
  • maximum filename size: 255 characters.
  • due to performance, snapshots and other features - btrfs is an excellent file system for the server;
  • Oracle is also developing a replacement for NFS And CIFS, which is called CRFS and which is designed to improve performance for file storages with btrfs;
  • performance tests showed a lag btrfs from Ext4 on solid state media such as SSD and for operations on relatively small files:

ReizerFS

- Introduced in 2001, it implemented many features that could never be realized in Ext*. In 2004 to replace ReizerFS FS was released Reizer4.

At the same time, the development Reizer4 progresses very slowly, and still has limited support (?) in the kernel linux. At present, only ReiserFS .

Characteristics:

  • maximum file size: 1 EB ();
  • maximum partition size: 16 TB;
  • maximum file name size: 4032 bytes, but limited to 255 characters.
  • excellent performance when working with small files such as log files and is great for database servers or mail servers;
  • ReiserFS lends itself well to increasing the size of the volume - but does not support its reduction and encryption at the FS level;
  • future Reiser4 is still in question and btrfs remains the preferred(?) choice between these two FSs.

ZFS

- it is worth mentioning here, because it was also developed by the company Oracle and has features similar to btrfs And ReizerFS. She also became quite famous after the company Apple about the intention to use it as the default FS. First release ZFS took place in 2005.

Due to restrictions due to the license - ZFS cannot be included in the kernel linux, however, its support is possible using the mechanism Linux's (FUSE).

Characteristics:

  • maximum file size: 16 EB ();
  • maximum partition size: 256 ZiB (Zebibyte);
  • maximum file name size: 255 bytes.
  • shows excellent performance when working with large disk arrays;
  • supports the ability to combine disks into arrays, create FS snapshots, and work with "stratified mapping" ( ) data;
  • there may be difficulties when trying to install and use in linux-systems, due to the need to use FUSE.

Swap

Swap— is not a file system at all. File or section with swap-om is used by the kernel's virtual memory system and has no filesystem structure at all. It cannot be mounted and read data from it, because. swap used exclusively by the kernel linux to write memory pages not disk. Usually - swap is used only when the OS lacks free RAM and "dumps" some of the data from memory into swap for her release.

The Linux operating system supports a wide variety of file system types. From a Linux point of view, file systems can be roughly divided into four groups:

  • native file systems. This means that the file system supports all the attributes inherent in Linux: permissions, timestamps, information about the owner of the file, etc.;
  • Non-native file systems. That is, filesystems that do not support Linux attributes;
  • Virtual. These are file systems that have no physical media;
  • network file systems.

Native file systems include:

  • reiserfs

ext2 file system

Ext2 is one of the first file systems used in Linux ( More specifically, the first Linux filesystem is minix. But the possibilities of this fs are very limited, and it was used only at the initial stage of development of Linux.). It was established in 1993. The system is considered very reliable and time-tested. But, since ext2 was developed at a time when a 300 MB hard drive was considered very large, it has some limitations. It does not make sense to use this fs for large partitions, it will start to “slow down” when there are a large number of files in the partition. That is, ext2 is considered slow ( The concept of "slow" is very relative. Ext2 is considered slow on Linux. But if you compare it to the standard FreeBSD filesystem, ext2 is actually pretty fast.). Of course, with the increase in disk sizes, with the advent of new trends, changes were made to the file system that improved its operation and functionality. For example, POSIX ACL support. But still, global changes did not affect her, allowing her to say:

Yes, this is the same, the only file system that suits me completely.

In addition, ext2 has serious limitations:

  • The maximum file size is 2048 GB.
  • The maximum file system size is 32768 GB.
  • The maximum number of subdirectories in one directory is 32768.

Journaled file systems

Now the ext2 file system is practically not used anymore. And it's not even about its limitations, ext2 is a fairly reliable file system. It's all about the loading speed of Linux servers. The server needs to be running all the time. But miracles do not happen, servers sometimes have to be overloaded. Your task is to make sure that after the system crashes they reboot as quickly as possible. When the server is turned on, disks are checked. The procedure for checking file systems, especially large ones, is a rather lengthy procedure. If there are several such file systems, then checking them can take a very long time. And the server should work!

To reduce the time spent on checking and to increase reliability, journaling file systems have been developed. If you have worked with databases, you are probably familiar with the concept of a transaction. Several SQL statements are combined into a transaction. The system must execute all statements. If at least one of them does not work, then the system rolls back to the beginning of the transaction. If the system was disabled while the transaction was in progress, when enabled, if possible, it attempts to execute the remaining statements or return to the start of the transaction.

Transaction log support has been added to modern file systems. From the point of view of the file system, all operations on a file look like a single transaction. Looking more closely at file operations in Linux, writing or modifying a file is a rather complicated procedure, consisting of many actions on the data on the disk. When using the transaction log, before any physical changes are made to the disk, a new transaction is opened in the log, which will record all the actions that will be performed on the file system. And only after the transaction is saved to disk, changes will be made to the file system.

If the file system is disabled incorrectly, the verification program first looks at the transaction log and, based on the data in it, will try to either return (roll back) the system at the time the transaction began, or, if possible, complete the actions described in the transaction. Considering the fact that the journal is small (in the ext3 file system it is 32 MB), the process of restoring the file system is greatly accelerated.

ext3 file system

When it became necessary to implement journaled file systems in Linux, RedHat developed the ext3 file system. RedHat took the path of least resistance - they took the well-known ext2 as a basis and added journal support.

Physically, ext2 is identical to ext3. This feature made it possible to use the same utilities for working with ext3 (creating, checking and configuring file systems) as for working with ext2.

Despite the addition of a journal, ext3 is faster than ext2. The advantages of ext3 should also include the ability to log not only necessary actions, but also data, which other journaling systems do not allow. Due to this feature, ext3 is considered very reliable.

Ext3 supports three modes of operation:

  • Writeback - in this mode there is no data logging. The so-called metadata (file inode, links to blocks) are first placed in the log. Only after they have entered the journal is the data written to the file system.
  • Ordered (default mode) - This mode is similar to the one described above. The only difference is that in writeback mode, all metadata is written to the journal first, and only after that changes to the file system occur. And in the ordered mode, when information about a block is placed in the journal, this block is immediately changed in the file system. Then information about the next block is put into the log, and the block is written, and so on. That is, the data changes in parallel with the change in the log.
  • Journal - full logging mode. The log contains metadata and data. And only after that there is a change in the file system.

ReiserFS file system

ReiserFS is developed by Hans Reiser and his company Namesys (http://www.namesys.com). It is a very fast file system, well suited for storing large numbers of small files.

It managed to solve the problem of placing small files on the disk. For example, in ext2/3, a whole block will be occupied on the disk to allocate a file containing a single character. An ext2/3 block can be 1 to 8 KB in size ( the size depends on the size of the file system). And in ReiserFS, data from several files can be placed in one block. Moreover, if the file size is very small, the data can be placed in the inode, that is, directly in the metadata.

The file system is based on optimized trees (B tree). This increases the speed of searches in the file system and removes the issue of limiting the number of files and directories in a directory.

This file system also copes with large files very confidently.

The ReiserFS version 3.6 file system has the following limitations:

  • The maximum file size is 8 TB (for 32-bit computers);
  • The maximum file system size is 16 TB.

Now the next version of ReiserFS is being developed - the fourth. It is expected to be included in the 2.6.17 or 2.6.18 kernels.

JFS File System

This file system is developed by IBM and distributed under the GNU GPL. A description of JFS can be found online at . JFS is used not only in Linux, but also in other operating systems, such as AIX and OS/2.

JFS is a journaling file system. Its main strong point is the use in conjunction with LVM (Logical Volume Manager). LVM allows you to combine several physical hard disk partitions into one logical one, which can then be partitioned like an ordinary hard disk. At the same time, some types of LVM allow you to connect new disk space on the fly. And if you use the ext3 file system on growing partitions, at one point you will receive a message about the impossibility of creating a new file. The fact is that when formatting a partition in ext3, a finite number of inodes are reserved in it in advance, depending on the size. That is, the maximum number of files is known in advance. If the size of the file system does not increase, then this number of inodes is enough for normal operation. JFS has the ability to dynamically grow the file system and the number of inodes. Due to this property, when the size of the file system increases, there is no limit on the number of files created.

The JFS file system has the following limitations:

  • The maximum file size is limited by the bitness of the operating system.
  • The maximum file system size is 512 TB.

XFS file system

The XFS file system was developed by SGI (formerly Silicon Graphics, Inc.). XFS was born in 1994 and originally shipped with the IRIX operating system. SGI is famous for its video production workstations and storage servers. Therefore, the file system is optimized to serve a large number of huge files and to support large directories. Due to its structure, it also supports a large number of small files just as well. In terms of speed, it is comparable to the ReiserFS file system, and in terms of reliability it surpasses the Hans file system ( How much data was lost by me in the ReiserFS file system from scratch. Saved only backup. Therefore, now I do not use ReiserFS on servers.).

Large file support is possible because XFS is a 64-bit file system. And the speed of the file system is achieved through the use of B + trees to search and describe internal structures.

The internal structure of the file system is quite complex, and I do not see the need for a brief description of its structure. Especially since there are good articles on the Internet that describe XFS in detail:

Microsoft file systems

Speaking of file systems from Microsoft, Linux supports FAT and NTFS. With FAT, everything is very simple, the structure of the file system is known, so it is fully supported in Linux. The only thing to consider when using FAT, there are two varieties of it in Linux:

  • msdos - FAT12/16.
  • vfat - FAT32.

FAT support should be enabled if you intend to use floppy disks and various USB drives: flash cards, hard drives, etc. The fact is that they are all usually formatted in FAT.

NTFS is a little more complicated. This file system is normally supported in read-only mode. It is not recommended to use it in recording mode. Although the write mode is supported, but if you read the documentation for the NTFS drivers, you will see that it is written in capital letters: in write mode, you can only change the contents of existing files, in no case can you create new files, delete or resize existing ones - this can destroy file system.

iso9660 and udf file systems

These file systems are used to store information on CDs and DVDs.

Initially, iso9660 was a very simple file system with a lot of limitations. For example, file names as in MS DOS, a limit on the number of directory attachments. Therefore, several add-ons have been written for iso9660 that expand its capabilities. Including, add-ons that allow you to save the attributes of UNIX files. All add-ons are supported by the file system driver, and there should not be any difficulties during operation. Moreover, the iso9660 driver supports, oddly enough, the recording mode. It is used when creating CD-ROM images.

With udf too it is not noticed special problems. Thus, working with CDs and DVDs is supported in Linux without any restrictions.

proc file system

It belongs to the category of virtual file systems. A very useful file system. In the work of the administrator, you will very often refer to its capabilities. In one of the first chapters on the organization of the Linux file system, I briefly talked about the purpose of this file system. Just a reminder that the files that are in the /proc directory are a mapping of the kernel data area to the file system. That is, if you view the contents of any file, you are actually seeing a certain part of the kernel data area.

Below I will describe some interesting files that you can find in the /proc directory. The contents of the files on your system will differ from the contents of the files shown as examples.

/proc/cmdline

Contains the command line passed to the kernel when it was started.

# cat cmdline BOOT_IMAGE=Linux-2613 ro root=303 #

/proc/cpuinfo

Information about the processor or processors.

# cat cpuinfo processor: 0 vendor_id: GenuineIntel cpu family: 6 model: 9 model name: Intel(R) Pentium(R) M processor 1400MHz stepping: 5 cpu MHz: 1399.050 cache size: 1024 KB fdiv_bug: no hlt_bug: no f00f_bug: no coma_bug: no fpu: yes fpu_exception: yes cpuid level: 2 wp: yes flags: fpu vme de pse tsc msr mce cx8 sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 tm pbe est tm2 bogomips: 2800.93 #

/proc/devices

List of devices.

# cat devices Character devices: 1 mem 2 pty 3 ttyp 4 /dev/vc/0 4 tty 4 ttyS 5 /dev/tty 5 /dev/console 5 /dev/ptmx 7 vcs 10 misc 13 input 14 sound 21 sg 116 alsa 128 ptm 136 pts 171 ieee1394 180 usb 226 drm 254 pcmcia Block devices: 3 ide0 7 loop 8 sd 11 sr 65 sd #

/proc/dma

Using DMA channels.

# cat dma 4: cascade #

/proc/filesystems

List of supported file systems.

# cat filesystems nodev sysfs nodev rootfs nodev bdev nodev proc nodev sockfs nodev pipefs nodev futexfs nodev tmpfs nodev inotifyfs nodev eventpollfs nodev devpts ext3 ext2 nodev ramfs msdos vfat iso9660 ntfs udf nodev mqueue nodev usbfs #

/proc/interrupts

Interrupt distribution.

# cat interrupts CPU0 0:850627 XT-PIC timer 1:9691 XT-PIC i8042 2:0 XT-PIC cascade 7:2 XT-PIC parport0 8:1 XT-PIC rtc 9:6620 XT-PIC acpi 11:238626 XT -PIC Intel 82801DB-ICH4, yenta, yenta, eth0, eth1, ohci1394, ehci_hcd:usb1, uhci_hcd:usb2, uhci_hcd:usb3, uhci_hcd:usb4, [email protected]:0000:01:00.0 12:65575 XT-PIC i8042 14:11538 XT-PIC ide0 NMI: 0 LOC: 0 ERR: 0 MIS: 0 #

/proc/modules

List of loaded modules.

# Cat modules irtty_sir 5248 0 - Live 0xf8a09000 sir_dev 13548 1 irtty_sir, Live 0xf8a1d000 irda 107768 1 sir_dev, Live 0xf8a3f000 crc_ccitt 1792 1 irda, Live 0xf8a04000 parport_pc 24324 0 - Live 0xf8a16000 parport 30920 1 parport_pc, Live 0xf8a0d000 uhci_hcd 30416 0 - Live 0xf89e7000 ehci_hcd 27656 0 - Live 0xf897a000 usbcore 103740 3 uhci_hcd, ehci_hcd, Live 0xf8990000 ohci1394 31092 0 - Live 0xf895e000 ieee1394 86392 1 ohci1394, Live 0xf891e000 ipw2100 78204 0 - Live 0xf8936000 ieee80211 18948 1 ipw2100, Live 0xf8918000 ieee80211_crypt 4488 1 ieee80211, Live 0xf88f8000 eepro100 26512 0 - Live 0xf8909000 pcmcia 30568 4 - Live 0xf8900000 firmware_class 7680 2 ipw2100, pcmcia, Live 0xf88f2000 yenta_socket 20748 4 - Live 0xf8879000 rsrc_nonstatic 11264 1 yenta_socket, Live 0xf8875000 pcmcia_core 34640 3 pcmcia, yenta_socket, rsrc_nonstatic, Live 0xf88e2000 #

/proc/mounts

Contains a list of mounted file systems.

# cat mounts rootfs / rootfs rw 0 0 /dev/root / ext3 rw 0 0 proc /proc proc rw,nodiratime 0 0 sysfs /sys sysfs rw 0 0 none /dev ramfs rw 0 0 /dev/hda5 /usr ext3 rw 0 0 /dev/hda6 /home ext3 rw 0 0 /dev/hda1 /mnt/win ntfs ro,noatime,nodiratime,uid=0,gid=0,fmask=0177,dmask=077,nls=iso8859-1, errors= continue,mft_zone_multiplier=1 0 0 devpts /dev/pts devpts rw 0 0 usbfs /proc/bus/usb usbfs rw 0 0 #

/proc/partitions

Contains a list of partitions of all connected drives.

# cat partitions major minor #blocks name 3 0 58605120 hda 3 1 10485688 hda1 3 2 506520 hda2 3 3 9775080 hda3 3 4 1 hda4 3 5 9775048 hda5 3 6 28062688 hda6 #

/proc/pci

List of devices found on the PCI bus.

This file can be used to diagnose why some devices are not working. Pay attention to interrupts: if it is 0, it means that the device was not allocated an interrupt for some reason. I will not give the full contents of this file, it is very large.

# cat pci PCI devices found: Bus 0, device 0, function 0: Host bridge: Intel Corporation 82855PM Processor to I/O Controller (rev 3). Prefetchable 32 bit memory at 0xd0000000 . Bus 0, device 1, function 0: PCI bridge: Intel Corporation 82855PM Processor to AGP Controller (rev 3). Master Capable. latency=96. Min Gnt=12. Bus 0, device 29, function 0: USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 1). IRQ 11. I/O at 0x1800 . #

/proc/swaps

Contains a list of mounted swap files and partitions.

# cat swaps Filename Type Size Used Priority /dev/hda2 partition 506512 0 -1 #

/proc/version

Contains version information about the operating system and the Linux kernel.

# cat version Linux version 2.6.13-rc3-my ( [email protected]) (gcc version 3.3.6) #3 Tue Jul 19 22:25:23 GMT+3 2005 #

Process Information

In addition to files, /proc contains directories that have a number as their name. Each directory describes a process whose PID matches the directory name. The files in this directory describe the parameters of the process. The contents of one of the directories is shown below.

# ls /proc/4624auxv [email protected] [email protected] maps mounts oom_score seccomp statm task/ cmdline environ fd/ mem oom_adj [email protected] stat status wchan #

Only a few of the files in the example contain information that would be understandable without preprocessing.

cmdline

Contains command line arguments.

# cat cmdline -su #

environ

Contains the values ​​of the process environment environment variables.

# cat environ HZ=100TERM=xtermPATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/binHOME=/rootSHELL=/bin/bashUSER=rootLOGNAME=rootMAIL =/var/spool/mail/root #

status

Contains process status information in a human-readable format.

# cat status Name: bash State: S (sleeping) SleepAVG: 98% Tgid: 4510 Pid: 4510 PPid: 4498 TracerPid: 0 Uid: 0 0 0 0 Gid: 0 0 0 0 FDSize: 256 Groups: 0 1 2 3 4 6 10 11 VMSIZE: 2832 KB VMLCK: 0 KB VMRSS: 1724 KB VMDATA: 388 KB VMSTK: 88 KB VMEXE: 628 KB VMLIB: 1628 KB VMPTE: 12 KB Threads: 1 Sigq: 0/7168 SIGPND: 000000000000000000000000 Sigblk : 0000000000010000 SigIgn: 0000000000384004 SigCgt: 000000004b813efb

Other directories

In addition to the directories describing the processes of the system, other directories can be found in /proc. Below is the purpose of some of them:

  • idea- information about devices connected to the ide interface.
  • irq- information about the distribution of interrupts.
  • net- network information. The contents of the arp table and the routing table. Statistics on network interfaces and protocol. Etc.
  • scsi- information about SCSI devices.
  • sys- contains changeable system parameters.

/proc/sys

The /proc/sys file system is a separate big topic. Using the files in this directory, you can change the system parameters on the fly. It is enough to write the desired value to a specific file. I will not describe /proc/sys, there is too much information and too much you need to know in order to understand what files are used for. Therefore, I will tell you where to find the documentation and description for this file system:

Sysfs is used by the udev program to dynamically create device files.

To be honest, many people think about finding the best file system for their computer. Windows and MacOS X users have little choice, with only one standard file system available, NTFS and HFS+. In the Linux operating system, everything is different, there are many file systems available for every taste. ext4 is very widely used in Linux, but there are several reasons to try something new. For example btrfs vs xfs. But is she really better than others? Let's first look at the most popular file systems and how they work, so to speak, make a small comparison.

If you are unfamiliar with the basics of file systems, I will say a few words about this so that you can better understand what is the difference between btrfs vs ext4 vs xfs. File systems are used to control how data is written to disk, access to that data, and store information, metadata, about files. It's not easy to program, but file systems are constantly improving. New functionality is constantly being developed, and they become more efficient.

Why are sections needed?

Many users have vague ideas about why disk partitions are needed. All operating systems support creating and deleting partitions. Linux uses more than one partition on a disk, even when using the standard installation procedure. One of the main purposes of partitioning disks is to increase security in case of errors.

When dividing a hard disk into partitions, data can be grouped and divided. If errors occur, only those that were on the damaged partition will be lost. The data on all other partitions will most likely remain safe and sound. This was especially important when Linux did not yet have journaling filesystems, and any unexpected power outage could lead to disaster.

The increased security and reliability of using partitions means that if one part of the operating system becomes corrupted, data on other partitions will still be available. At the moment, this is the most important factor in using partitions. For example, users may use scripts or programs that fill up disk space. If the disk contains only one large partition, then when the free space runs out, the system will completely stop working. But if users store data on different partitions, then the overflow will affect only one partition, while the system and other partitions will continue to function normally.

Keep in mind that a journaled file system only protects against corruption during power outages and unexpected disconnection of storage devices. But it will not protect you from bad blocks and logical errors in the file system. In such cases, you need to use a multiple disk array (RAID).

Why choose another file system?

The EXT4 file system is an improved version of EXT3, which, in turn, is nothing more than a redesigned EXT2. EXT4 is a very stable file system that has been the default choice in most Linux distributions over the past few years. But its code is already decently outdated. Also, Linux users want new features and functionality that EXT4 doesn't have, but other filesystems do, such as btrfs vs xfs. There is software that implements these features, but filesystem level support will be much faster. Next, we will briefly review each of the proposed file systems so that you can choose which btrfs or ext4 file system is best for you.

ext4 file system

Ext4 has some limitations that even now are quite impressive. The maximum file size is 17 terabytes. And this is much more than the capacity of a hard drive available to the average buyer. At the same time, the largest partition size that can be created with ext4 is 1 exabyte, which is approximately 11529215 terabytes. As you know, Ext4 is faster than EXT3. Like all modern file systems, it is journaled, which means that EXT4 will keep a log of the location of files on disk, as well as write any data changes there. Despite all these features, it does not support transparent compression, data deduplication, and transparent encryption. Snapshots are technically supported, but this is only an experimental feature.

Btrfs file system

Btrfs is a file system designed from the ground up. It exists because its developer wanted to extend the functionality of the standard file system with features such as snapshots, concatenation, checksums, transparent compression, and more. Btrfs does not depend on Ext4, but implements its best ideas and benefits, as well as its own additional features that will be very useful to users, and especially enterprises. For enterprises running serious programs with very large databases, a single file system space on multiple disks will be very useful. Data deduplication will reduce the actual disk space used by the data. And mirroring data with Btrfs will become much easier.

Users can still create multiple partitions since they don't need to mirror data on different drives. Considering that Brtfs can span multiple hard drives, it supports 16 times more disk space than Ext4. The maximum partition size in Btrfs is 16 exabytes, the maximum file size is the same. In the EXT4 vs btrfs comparison, the latter comes first.

XFS file system

XFS is considered an extended file system. It is a high performance 64-bit, journaled file system. XFS support was added to the kernel in 2002. And in 2009 it was used in Red Hat Enterprise Linux 5.4. The maximum file size in this file system is eight exabytes. But XFS has some limitations. For example, the partition of this FS cannot be reduced, and there is also poor performance when working with a large number of files. RHEL 7.0 now uses XFS as the default file system.

Conclusion and Conclusions

Unfortunately, the date of the final release of Btrfs is not exactly known. But officially, this next generation file system is still classified as unstable. However, if you are installing the latest version of Ubuntu, the installer will offer the option to select Btrfs as the primary file system. When Btrfs becomes stable is unknown, but Ubuntu will not use it as the default filesystem until it is considered fully stable.

Btrfs is currently used as the default root filesystem in OpenSUSE. As you can see, the developers have a huge front of work, since not all the features have been implemented yet, and it also lags behind in performance when comparing Ext4 vs btrfs.

So which is better to use? So far, Ext4 has been the winner despite identical performance. But why? The answer is convenience and popularity. Ext4 is still a great file system for workstations and desktops. It is supplied by default, and therefore the user will receive it simply by installing the OS. In addition, Ext4 supports partitions up to 1 exabyte and files up to 16 terabytes, which is still a lot.

Btrfs offers large volumes up to 16 exabytes for both partitions and files, as well as improved fault tolerance. But it is still positioned as an add-on to the file system, and is not integrated into the FS operating system. For example, to format a partition in Btrfs, the Btrfs toolkit must be installed.

Even if the data transfer rate is not very important, there is such a characteristic as the speed of working with files. Btrfs has many useful features: copy-on-write, checksums, snapshots, sanitization, data self-healing, deduplication, and other interesting enhancements that keep data safe. It only lacks the ZFS - Z-RAID feature, so RAID is still in the experimental stage. For normal data storage, Btrfs is better suited than Ext4, but time will actually show how it will be. Whether to use btrfs or ext4 is just a matter of personal preference.

For now, Ext4 is the best choice for general users, as it is distributed as the default file system, and is faster than Btrfs when transferring files. Btrfs is definitely worth a try, but it's too early to completely replace ext4, it won't be until a few years from now. It's funny, the same thing was said a few years ago, a lot has changed since then, but Btrfs is still not considered stable.

If you have a different opinion on this, please leave a comment!

By the way, if you use Windows and Linux on the same machine, you might be interested in my article.

Similar posts