In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to choose Btrfs and LVM-ext4, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Fedora 33 introduces a new default file system, Btrfs, in its various desktop versions. For years, Fedora has been using ext4 on top of logical volume management Logical Volume Manager (LVM) volumes, and the introduction of Brtfs is a big shift for Fedora. There is a compelling reason to change the default file system. While Btrfs is an exciting next-generation file system, ext4 on LVM is mature and stable. This guide aims to explore their advanced features to make it easier to choose between Btrfs and LVM-ext4.
Let's talk about the conclusion first.
The simplest advice is to stick to the default values. The newly installed Fedora 33 environment defaults to Btrfs, and the version of Fedora before the upgrade will continue to use the settings originally installed, usually LVM-ext4. For existing Fedora users, the easiest way to get Btrfs is a fresh installation. However, a fresh installation is more destructive than a simple upgrade. Unless there is a special need, such interference may be unnecessary. The Fedora development team has carefully considered these two default values, so be confident in either choice.
What about other file systems?
There are now many file systems for Linux systems. This number has exploded with the addition of a combination of volume managers, encryption methods, and storage mechanisms. So why care about btrfs and LVM-ext4? These two settings are probably the most common for Fedora users. In Fedora 11, ext4 on top of LVM became the default disk layout, and before that ext3 was used.
Since Btrfs is the default setting for Fedora 33, the vast majority of existing users will consider whether to stand still or jump forward. Faced with the newly installed Fedora 33 environment, experienced Linux users may wonder whether to use the new file system or return to the file system they are familiar with. Therefore, among the many possible storage options, many Fedora users will want to know how to choose between Btrfs and LVM-ext4.
The commonness of the two
Although there are core differences between the two file systems, Btrfs and LVM-ext4 actually have a lot in common. Both are mature and well-tested storage technologies. LVM has been used since the early days of Fedora Core, and ext4 became the default setting for Fedora 11 in 2009. Btrfs was incorporated into the Linux mainline kernel in 2009, and the file system is widely used by Facebook. SUSE Linux Enterprise 12 made it the default file system in 2014. Therefore, it also has a long running time in the production environment.
Both systems are good at preventing file system corruption caused by accidental power outages, although they are implemented in different ways. The configurations they support include using a single disk setting and spanning multiple devices, and both configurations can create near-instant snapshots. There are a variety of tools to help manage both systems, including the command line and the graphical interface. Both solutions are equally effective on home desktops and high-end servers.
Advantages of LVM-ext4
The structure of ext4 on LVM
The ext4 file system focuses on high performance and scalability without much extra fancy. It can effectively prevent fragmentation after a long time, and provides a good tool when fragmentation occurs. Ext4 is rock solid because it builds on the previous generation of ext3 file systems and brings years of in-system testing and bug fixes.
Most of the advanced features in the LVM-ext4 environment come from LVM itself. LVM is "under" the file system, which means it supports any file system. Logical volumes Logical volume (LV) are generic block devices, so virtual machines can use them directly. This flexibility allows each logical volume to use the right file system and respond to a variety of situations with the right options. This hierarchical approach also follows the Unix philosophy of "gadgets work together".
The volume group volume group (VG) abstracted from the hardware allows LVM to create flexible logical volumes. Each logical volume is extracted from the same storage pool, but has its own settings. Resizing volumes is much easier than resizing physical partitions because there is no restriction on the orderly placement of data. The LVM physical volume physical volume (PV) can be any number of partitions and can even be moved between devices while the system is running.
LVM supports read-only and read-write snapshots, which makes it easy to create consistent backups from the active system. Each snapshot has a defined size, and changing the source volume or snapshot volume takes up space. Alternatively, logical volumes can be part of the sparse configuration pool thinly provisioned pool. This allows snapshots to automatically use the data in the pool instead of the fixed-size blocks defined when the volume was created.
LVM with multiple disk drives
LVM really shines when there are multiple devices. It natively supports most RAID levels, and each logical volume can have a different RAID level. LVM will automatically select the appropriate physical device for the RAID configuration, or the user can specify it directly. Basic RAID support includes data striping for performance (RAID0) and mirroring for redundancy (RAID1). Logical volumes can also use advanced settings such as RAID5, RAID6, and RAID10. LVM RAID support has matured because LVM uses device mapper (dm) and multi-device (md) kernel support at the underlying level, just like mdadm does.
For systems with fast and slow drives, logical volumes can also be cache volumes. The classic example is a combination of SSD and traditional disk drives. Cache volumes use faster drives to store more frequently accessed data (or as write caches), while slow drives are used to process large amounts of data.
A large number of stable functions in LVM and the reliability of ext4 have long been proved in previous use. Of course, the more functions you have, the more complex you are. When configuring LVM, it is challenging to find the right functional options. For single-drive desktop systems, the features of LVM, such as RAID and cache volumes, do not apply. However, logical volumes are more flexible than physical partitions, and snapshots are useful. For normal desktop use, the complexity of LVM can become an obstacle to recovery of problems that a typical user may encounter.
Advantages of Btrfs
Btrfs structure
Lessons learned from previous generations of file systems guide the functional design of building to Btrfs. Unlike ext4, it can span multiple devices directly, so it has features that are usually found only in the volume manager. It also has features unique to the Linux filesystem space (ZFS has a similar feature set, but don't expect it to appear in the Linux kernel).
Main functions of Btrfs
Perhaps the most important function is to checksum and checksumming all the data. Checksums, along with copy-on-write copy-on-write (COW), provide a key way to ensure file system integrity after an unexpected power outage. More uniquely, the checksum can detect errors in the data itself. Quiet data corruption (sometimes called bitrot) is more common than most people realize. Without proactive verification, corruption may eventually propagate to all available backups. This leaves the user without a valid copy. By verifying all data transparently, Btrfs can immediately detect any such corruption. Enable the correct dup or raid option, and the file system can also repair corruption transparently.
Replication on write is also a basic function of Btrfs because it is critical in providing file system integrity and instant subvolume snapshots. When a snapshot is created from a public subvolume, the snapshot automatically shares the underlying data. In addition, the ex post deduplication deduplication uses the same technique to eliminate the same data blocks. Individual files can use the COW feature by using the reflink option of cp. Reflink replicas are particularly useful for copying large files, such as virtual machine images, which tend to have most of the same data over time.
Btrfs supports spanning multiple devices without the need for a volume manager. Multi-device support provides data mirroring for redundancy and striping to improve performance. In addition, more advanced RAID levels, such as RAID 5 and RAID 6, are supported experimentally. Unlike the standard RAID setting, Btrfs's RAID1 actually allows an odd number of devices. For example, it can use three devices, even if they are of different sizes.
All RAID and dup options are specified at the file system level. Therefore, different options cannot be used for each subvolume. Note that using the multi-device RAID1 option means that even if one device fails, all data in the volume is available, and the validation feature maintains the integrity of the data itself. This is beyond the scope of the current typical RAID setting.
Additional function
Btrfs also supports fast and easy remote backups. Snapshots of subvolumes can be sent to a remote system for storage. By taking advantage of the COW metadata inherent in the file system, these transfers are very efficient by sending only incremental changes in previously sent snapshots. User applications such as snapper make it easy to manage these snapshots.
In addition, Btrfs volumes can have transparent compression, and chattr + c can mark individual files or directories that are compressed. Compression can not only reduce the space consumed by data, but also help extend the life of SSD by reducing the number of write operations. Compression certainly brings additional CPU overhead, but there are many options to trade off.
Btrfs integrates file system and volume manager functions, which means that overall maintenance is simpler than LVM-ext4. Of course, this integration is less flexible, but for most desktops or even servers, the settings are sufficient.
Using Btrfs on LVM
Btrfs can convert ext3/ext4 file systems in-place. In-place conversion means that there is no need to copy the data out and then back. The data block itself does not even need to be modified. Therefore, for existing LVM-ext4 systems, one option is to leave the LVM in place and then simply convert the ext4 to Btrfs. Although feasible and supported, there are a number of reasons why it is not the best choice.
One of the attractions of Btrfs is the easier management of the file system integrated with the volume manager. If you run on LVM, for system maintenance, you still need to make some settings for the additional volume manager. Similarly, LVM settings typically have multiple logical volumes of fixed size and have separate file systems. Although Btrfs supports multiple volumes on a given computer, many good features require a single volume to have multiple subvolumes. If each LVM volume has a separate Btrfs volume, users still need to manage fixed-size LVM volumes manually. Although the ability to shrink the mounted Btrfs file system does make it easier to deal with fixed-size volumes. With the online shrink feature, there is no need to start real-time mirroring.
When using Btrfs's multi-device support, you must carefully consider the physical location of logical volumes. For Btrfs, each logical volume is a separate physical device, and if this is not the case, some data availability features may make the wrong decision. For example, if a single drive fails, using RAID1 for data usually provides protection. If the actual logical volume is on the same physical device, there is no redundancy.
If there is a strong need for certain LVM features, such as raw block devices or cached logical volumes, it makes sense to run Btrfs on top of LVM. In this configuration, Btrfs still provides most of its benefits, such as checksums and incremental snapshots that are easy to send. Although there is some operational overhead associated with using LVM, Btrfs is no more expensive than any other file system.
The above is all the contents of the article "how to choose Btrfs and LVM-ext4". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.