4 MAJOR LINUX FILE SYSTEM: EXT4 , XFS, ZFS, BTRFS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hey guys what's up welcome to xps tech i'm vinit and in today's video we'll talk about the major file systems available in linux now linux as technology is known for giving you choices be it the long list of available distributions different desktop environment support for various hardware architecture for every element you have tons of options to choose from however i think one of the most important decision is selecting the right file system for your storage devices this is one area that can hugely impact your system performance reliability efficiency and security hence the overall experience depends a lot on the right file system linux distro supports variety of different file systems the most popular and widely used especially for desktops is the ext file system which has been there for a long time and the present version is ext4 however new and modern file systems like xfs zfs and b3fs are now getting into the mainstream these file system brings a lot of new advanced features and a completely new design architecture so in today's video we'll take a detailed look into these file systems check out their disk management strategies and the features that makes them so special alright so let's start now before we get into the advanced stuff let's first get a quick one-on-one on file systems also as per the wikipedia definition a file system controls how data is stored and retrieved without a file system data placed in a storage medium would be one large body of data with no way to tell where one piece of data stops and the next begins so i think the definition makes it very clear every storage media be it hard disk cd dvd usb thumb drive any media where you store data needs a file system for managing the data let's say we have 1 tb of hard disk now before we store any data on this disk we need to format it with the file system now formatting at the lowest level means changing the values of all the bits to zeros then the hard disk is divided into equally sized sectors the size of a sector is usually 512 bytes now these sectors are grouped together to make a cluster or data block which can be of minimum one sector to maximum 64 sectors the default size of a data block is usually four kilobytes now once hard disk is divided into blocks the starting few blocks are reserved for storing disk management information the first block is reserved for boot sector which contains information about file systems and internal data structure used the second block is for inodes containing metadata about files including mapping of logical address to physical address on the disk then you have data blocks where your files are actually stored the important disk parameters are maximum size of a disk allowed the maximum size of partition the maximum size of a file they all are dependent upon the data structure used and the bits used for address pointers which varies from file system to file system for example if you use 32 bits for addressing data blocks on disk the total address possible is 2 to the power 32 which is 2 terabytes for a block size of 512 bytes and 16 terabytes for a block size of 4 kilobytes also this was a very broad overview on how file system works all right now let's start with our first file system which is ext4 now fourth extended file system is a journaling file system for linux we'll come to the journaling part in a bit now ext4 is the fourth version there were three version prior to this latest one now ext file system splits the disk into equally sized sectors now these sectors are grouped to form a block size of a block can be between one kilobyte to 64 kilobyte but it's typically of four kilobytes blocks are in turn grouped into larger units called block groups now in exg4 instead of a fixed size block groups there's a concept of extents now an extent is a range of contiguous physical blocks a single extent in ext4 can map up to 128 megabytes of contiguous space considering a block size is of four kilobytes now extend helps in improving large file performance by placing them in contiguous space and as it is larger than a block group a large file is stored in few number of extent which in turns requires few number of pointers to describe the location of all the data in large files hence reducing fragmentation now the initial disk blocks are allocated for special purpose first block is used for storing boot sector next is the super block every partition contains a super block that have metadata about other file system structures then we have inode's bitmap block which is just a map containing zeros and ones that corresponds to block occupied or vacant next is inodes which stores the metadata about files and pointers to their physical block address and at last we have data zone containing all the actual files now ext uses 32 bit for inode pointers plus every single inode can contain a maximum of 12 direct pointers associated with the address of the file system blocks therefore for a block size of 4 kilobytes the maximum file size allowed is 16 terabytes and the maximum volume size is one exabyte which is pretty sufficient for most regular use alright so that was the disk layout of ext4 now let's look at the features that makes this file system special the first feature is that ext is a journaling file system a journaling file system maintains a journal containing the changes that are in process so they are not in committed state in this state if the system crashes or loses power the items that were not committed in the journal are re-run this helps recover the system more quickly with a lower likelihood of it becoming corrupted next feature is delayed allocation where data is stored in a buffer before it is written into data blocks the delayed allocation allows the file system to make better choices about how to allocate those blocks reducing fragmentation and increasing performance significantly ext4 also supports online defragmentation there's no need to unmount the disk for defragmentation e4 defrag is the utility available which is an online block and extent level defragmentation utility all right now let's talk about the second popular linux file system which is xfs now xfs is widely used in enterprise environment it is the default file system in rh el and it's also used in many well-known scientific institutions like cern and fermilab to manage petabytes of storage for scientific experiments now xfs is a file system that is ideal for storing and managing large amount of data and large files it provides great disk io performance it's perfect in computing environments with large number of cpus and huge disk arrays like ext xfs is also a journaling file system but it is a 64-bit file system instead of 32-bit because it has 64-bit address space we can have a disk size of 16 xp bytes inode pointer is also of 64 bit so maximum file size is 8 xb bytes the maximum extent size is 8 gb instead of 128 mb of ext4 now in xfs file system the disk is partitioned into allocation groups now allocation groups are equally sized linear region within the file system they are somewhat similar to the block groups but are typically much larger than block groups a location group can have a maximum size of 1 terabyte but are typically sized between 0.5 to 4 gigabytes the specialty here is that each allocation group manages its own inodes and free space separately each allocation group can almost be thought of as an individual file system that maintains its own space usage this provides scalability and parallelism so multiple threads and processes can perform io operations on the same file system simultaneously instead of using bitmaps to track free disk blocks xfs uses b trees which are way more efficient now coming to the features the first important feature of xfs is direct io with this feature we can now bypass the kernel file cache and go directly from the user buffer to the underlying i o hardware avoiding the copy into the kernel address space significantly reduces the cpu utilization for large iu request it also allows multiple parallel writers to files using direct io now another unique feature is guaranteed raid io that allows application to reserve bandwidth to the file system xfs dynamically calculates the performance available from storage devices and can reserve bandwidth sufficient to meet the requested performance now online defragmentation is also supported using a defragmentation utility another important feature is that you can also do resizing of file system online without having to unmount the device using the xfs grow fs utility but it is only possible as long as there is remaining unallocated space on the device holding the file system all right next is the zettabyte file system or zfs in short now zfs is a robust scalable and easy to administer file system zfs supports maximum disk size up to 256 quadrillion zettabyte and hence the name zettabyte the main difference between zfs and other file system is that zfs is a combined file system that acts both as a volume manager as well as the file system it is mainly used in server operating system and is a default file system for ubuntu server and back in the days it almost made its way to the apple mac os server as well in recent years many linux distros has also started supporting zfs now in terms of maximum disk size supported zfs is one level above xfs as it uses 128 bit file system hence the maximum file size is 16 xb bytes so storage wise zfs supports highest amount of disk size and it will be difficult to reach the limit all right now let's take a look at the disk structure and layout in zfs now zfs takes a very different approach to internal file management here all the disks available are combined to create one large storage pool there's a storage pool allocator which is like a volume manager but it's a lot more it decides how the files are stored in physical disk and does all the logical to physical address conversion and data management so in zfs the first step is to create a storage pool after that we create file systems under it here zfs file systems are nothing but like folders in root directory these file systems share disk space with all the systems in the pool now you can see why it is so popular in server environment you can create one file system for each department it's really simple you no longer need to predetermine the size of a file system disk space is allocated automatically from the storage pool as file system grows when new storage is added all the file system within the pool can immediately use the additional disk space without any additional work it's pretty similar to adding ram memory in the computer when a memory dim is added to a system there's no need to run any commands to configure memory all processes on the system automatically uses the additional memory some of the feature that makes zfs special is transaction semantic feature which essentially means that during a write operation the data is not overwritten it is written on a separate buffer this is also called copy on write used by b3fs this ensures that the data is consistent even in cases when system loses power or crashes midway during write process the other important feature is checksum for data consistency snapshots of file system for quick recovery a new raid configuration called raid z is also available to guarantee data integrity you also have a built-in scrub function which regularly examines all data and repairs silent corruption and other problems hence zfs has a better data protection against corruption alright so the last file system that we are going to talk about today is b3fs or better fs now b3fs is a high performance copy on write file system it offers similar kind of features as zfs but on top of it it has some of the most advanced features that makes it a better file system overall also unlike zfs it is not proprietary and is considered as a linux answer to zfs it has gained a lot of traction in recent years and is now seen as the future next generation linux file system that will be replacing the time and tested ext4 it is also used by many big businesses for their technological solutions including the tech giants facebook and whatsapp for managing their storage requirements now as the name suggests it uses binary tree as the underlying data structure to manage every element of the file system management like zfs b3fs also has one storage pool that consists of all storage disks inside storage pool we create sub volumes sub volumes are like partition that can be dynamically resized at will b3fs is a 64-bit file system so the maximum volume size as well as the maximum size of file is 16 xb bytes now one of the unique feature of b3fs is that you can take snapshot of a single volume snapshot is like a copy of some volume that you can roll back to and it's very flexible you can make the snapshot read-only or read write snapshots another feature is transparent file compression which is done in background automatically to optimize storage capacity utilization the default compression method used is z-lib but it provides lzo and z-std compression as well you can even mix compression methods for files now b3fs also provides built-in rate support for data integrity raid 1 5 6 and 10 all are supported b3fs is also an ssd aware file system and has ssd optimization feature which is not seen in any other file system it avoids unnecessary seek optimization as there's no moving parts in ssd and aggressively sends rights in clusters this results in larger write operation and faster right throughput the online file system defragmentation is also available that does defragmentation when the disk is mounted and actively performing operations the b3 file system also has a built-in utility called b3fs dash convert which you can use to convert an existing ext23 or four disk to a b3fs file system now b3fs is a stable file system but there are few features that are still under development you can check the status of each feature in this page alright so these were some of the important features of b3fs of course there are many other features that i have not covered in this video i'll put the link to the reference material and detailed guides in the description of this video you can go over these for more in-depth information all right so that was all for today i hope now you have a fair sense of idea about these popular linux file systems now i've tried to cover these file system in detail but i'm sure there are many features that i've left if you want me to make separate detailed video on these file system let me know in the comment section also if you like this video hit the like button and also subscribe to xps tech for more such videos on linux a huge shout out to all the subscribers of xps tech channel thank you for supporting me alright so thank you again for watching and i'll see you next time
Info
Channel: XPSTECH
Views: 8,728
Rating: undefined out of 5
Keywords: linux, file system, ext4, xfs, zfs, btrfs, file system explained, Ext4 disk layout, disk architecture, btrfs features, linux file system features, RAID, RAID-Z, Copy on Write, Extent, Max Disk Size, Maximum file size, Linux file systems, ZFS file system, XFS File system, BTRFS File system
Id: 2HobXqXcyVE
Channel Id: undefined
Length: 16min 2sec (962 seconds)
Published: Sat Jun 12 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.