Use EXT3 file System _unix Linux in Linux environment

Source: Internet
Author: User

Linux By default the file system used for the Ext2,ext2 file system is indeed efficient and stable. However, with the application of Linux system in the key business, the weakness of Linux file system is gradually revealed; the ext2 file system used by the system by default is not a log file system. This application in key industries is a fatal weakness. This article introduces you to Linux using the ext3 log file system application.
EXT3 file system is directly from the Ext2 file system development, the current EXT3 file system has been very stable and reliable. It is fully compatible with the Ext2 file system. The user can transition smoothly to a log-capable file system. This is actually the original design of the ext3 log file system.

I. Characteristics of EXT3 log file system

1. High Availability

After the system has used the Ext3 file system, the system does not need to check the file system even after the shutdown is abnormal. After the outage occurs, it takes only 10 seconds to recover the ext3 file system.

2, the integrity of the data:

Ext3 file system can greatly improve the integrity of the file system and avoid the accidental downtime of the file system damage. There are 2 modes of ext3 file systems to choose from to ensure data integrity. One of these is the "Keep file system and data consistency" mode. In this way, you will never see the junk files that are stored on disk because of an abnormal shutdown.

3, the speed of the file system:

While using the Ext3 file system, it is sometimes possible to write data more than once while storing the data, but overall, ext3 is better than ext2 performance. This is because the ext3 log function optimizes the drive read-write headers of the disk. Therefore, the performance of the file system is not reduced compared to the Ext2 file system.

4. Data Conversion

It is easy to convert from Ext2 file system to ext3 file system, as long as you simply type two commands to complete the conversion process, users do not have to spend time to back up, restore, format partitions, and so on. With a small tool provided by a ext3 file system TUNE2FS, it can easily convert ext2 file system to ext3 log file system. In addition, the Ext3 file system can be loaded directly into the ext2 file system without any changes.

5, a variety of log mode


EXT3 has a variety of logging modes, a mode of operation is to log all file data and metadata (the data that defines the data in the file system, that is, the data) (data=journal mode), and the other mode of work is to record only the metadata log. Instead of logging data, the so-called data=ordered or Data=writeback mode. System managers can choose between the working speed of the system and the consistency of the file data according to the actual work requirements of the system.

Ii. use of the Ext3 file system

1. Download and compile the core

For core patching, Patch download address: Run after:

#make Menuconfig

In the FileSystem menu, the following options are available to select the kernel support EXT3 file system:

<*> Ext3 journalling File system support (experimental)

JBD (ext3) debugging support

Select support EXT3 file system, save core configuration file, recompile core.

#make Bzimage
#make Module
#make Module_install
#make Install

Kernel compile installation complete. After you start the system with the new kernel, you can create the Ext3 file system.

2. Actual use of the Ext3 file system

To create a new ext3 file system, for example, to format the HDA5 partition on the disk ext3 the file system and log it to the/DEV/HDA1 partition, the procedure is as follows:

[root@test/sbin]#./mke2fs-j/dev/sda5
MKE2FS 1.24a (02-sep-2001)
FileSystem label=
OS Type:linux
Block size=1024 (log=0)
.. .. ..
Creating journal (8192 blocks): Done
Writing superblocks and filesystem accounting Information:done
This filesystem'll be automatically checked every mounts or
180 days, whichever comes. Use Tune2fs-c or-i to override.

When you create a new file system, you can see that the Ext3 file system performs automatic detection for 180 days or when the 31st time is mount, in fact this parameter can be arbitrarily adjusted as needed.

The following is a new filesystem mount to the primary partition Ext3 directory:

#[root@test/sbin]# mount-t EXT3/DEV/SDA5/EXT3

Description: The above/DEV/SDA5 partitions formatted as EXT3 file systems are loaded into the/EXT3 directory.

Ext3 is based on ext2 code and has the same disk format as ext2; This means that a clean uninstall Ext3 file system can be mounted as a ext2 file system. EXT3 file system can still be loaded into the Ext2 file system to use, you can put a file system in Ext3 and ext2 free switch. The ext3 log file on the ext2 file system still exists, but ext2 cannot recognize the log.


3. Convert ext2 file system to ext3 file system


There are several advantages to transferring the Linux system's file system from ext2 to ext3: The usability of the first system is enhanced, the second data integration is improved, the third start speed is improved, and the fourth ext2 and the Ext3 file system are easy to convert to each other.

For example, convert the Ext2 file system to the Ext3 file system, as shown in the following command:

[root@test/sbin]#./tune2fs-j/dev/sda6
TUNE2FS 1.24a (02-sep-2001)
Creating journal Inode:done
This filesystem would be automatically checked every mounts or
180 days, whichever comes. Use Tune2fs-c or-i to override.

In this way, the original ext2 file system is converted into a ext3 file system. Note When you convert the Ext2 file system to a ext3 file system, you do not have to load the partition unloading down to the conversion.

After the conversion is complete, do not forget to change the file system of the corresponding partition in the/etc/fstab file from the original ext2 to ext3. If the partition you are converting is a root partition, you should also use the INITRD boot system to run MKINITRD to make sure that LILO or grub can load the INITRD properly. If you don't do these steps, the root will still be loaded in the Ext2 file system the next time it starts. To view the current file system of the root partition, you can run "cat/proc/mounts" to view the results, and for the conversion of the root file system, you can find detailed instructions from the instructions manual for the EXT3 software package

4. Where the log is stored

You can place the log on another storage device, such as a partition/dev/hda9. For example, to create a ext3 file system on the/DEV/HDA5 and store the log on an external device/dev/hda9, run the following command:

#mke2fs-j Device=/dev/hda9/dev/hda5

5. File System Repair

The e2fsck in the new e2fsprogs supports the Ext3 file system. When a ext3 file system is corrupted, first uninstall the device and repair it using e2fsck:

#umount/dev/hda6
#e2fsck-fy/dev/hda6

In short, the ext3 log file system is currently the Linux system from the Ext2 file system to the log file system is the simplest choice, the implementation of the most concise way. Because it is directly from the Ext2 file system development, the system from the Ext2 file system to the EXT3 log file system upgrade process smooth, can maximize the security of the system data. At present, the Linux system to use the log file system, the most safe way is to select the Ext3 file system.

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.