Common Ext3 file systems in Linux server operating systems

Source: Internet
Author: User
Article Title: Common Ext3 file systems in Linux server operating systems. Linux is a technology channel of the IT lab in China. Some basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source Ext3 file systems are developed directly from Ext2 file systems. Currently, Ext3 file systems are very stable and reliable, it is fully compatible with the Ext2 file system, allowing you to smoothly transition to a file system with sound log functions. The idea of the Ext3 log file system is to make any advanced modifications to the file system in two steps. First, store a copy of the block to be written in the log. Second, when the I/O data sent to the log is transferred completely (that is, the data is submitted to the log ), block is written to the file system. When the I/O data transfer to the file system is terminated (that is, the data is submitted to the file system), the block copies in the log are discarded.
Ext3 log Mode
Ext3 can log only the metadata and file data blocks. Specifically, Ext3 provides the following three log modes:
Log (Journal)
All data and metadata changes in the file system are logged. This mode reduces the chance of losing the modifications made to each file, but it requires a lot of extra disk access. For example, when a new file is created, all its data blocks must be copied as a log record. This is the safest and slowest Ext3 log mode.
Subscription (Ordered)
Only changes to the file system metadata are recorded in the log. However, the Ext3 file system groups metadata and related data blocks so that metadata can be written into data blocks before being written to the disk. In this way, you can reduce the chances of data corruption in the file. For example, make sure that any write access to the larger file is fully protected by logs. This is the default Ext3 log mode.
Writeback)
Only changes to the metadata of the file system are recorded in logs. This is the method found in other log file systems and the fastest mode.
Log block device (JBD)
The Ext3 file system does not process logs, but uses the Journaling Block Device or the general kernel layer called JBD. The Ext3 file system calls the JDB routine to ensure that its subsequent operations will not damage the disk data structure in case of a system failure. The interaction between Ext3 and JDB is essentially based on three basic units: log records, atomic operations, and transactions.
Log records are essentially descriptions of the low-level operations to be performed by the file system. In some log file systems, the log records only include the modified byte range and the starting position of the byte in the file system. However, the log records used by the JDB layer are composed of the entire buffer modified by low-level operations. This method may waste a lot of log space (for example, when a low-level operation only changes a bit of the bitmap), but it is still quite fast, because the JBD layer operates the buffer zone and the buffer header directly.
Any system call to modify a file system is usually divided into a series of low-level operations to manipulate the disk data structure. If these low-level operations are not completed, the system will crash and the disk data will be damaged. To prevent data corruption, the Ext3 file system must ensure that each system call is processed in an atomic manner. Atomic operations are a set of low-level operations on the disk data structure. These low-level operations correspond to a separate high-level operation.
For efficiency reasons, the JBD layer uses the log processing grouping method to group the log records processed by several atomic operations in a single transaction. In addition, all log records related to a processing must be included in the same transaction. All log records of a transaction are stored in the continuous log block. The JBD layer processes each transaction as a whole. For example, the block used by the transaction is recycled only when all data in the log records of a transaction is submitted to the file system.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.