Reiserfs File System in Linux

Source: Internet
Author: User

Reiserfs is a very good file system. It is also one of the earliest log file systems used in Linux.

The developers of reiserfs are very ambitious, and the entire file system is completely designed from scratch. At present, reiserfs can easily manage file systems of hundreds of GB, which is very important in enterprise applications.
I. reiserfs features

1. Advanced Log Mechanism

Reiserfs has an advanced log (journaling/logging) function mechanism. The log mechanism ensures that logs are written to the hard disk before each actual data modification. The security of files and data has been greatly improved.

2. Efficient disk space utilization

Reiserfs does not allocate inode to some small files. Instead, these files are packaged and stored in the same disk block. Other file systems place each small file in one disk block. This means that if there are 10000 small files, it will take up 10000 parts. This is a waste of disk space.

3. Unique search methods

The reiserfs is based on the rapid balancing tree (balanced tree) search, which has excellent performance and is a very efficientAlgorithm. When reiserfs searches for a large number of files, the search speed is much faster than ext2. The reiserfs file system uses B * tree to store files, while other file systems use B + tree. B * tree query is much faster than B + tree. Reiserfs is fast in file location.

In practical use, when reiserfs processes files smaller than 1 K, it is 8 to 15 times faster than ext2! Reiserfs is superior to ext2 in almost all aspects. For more information, see the author's test.

4. Support for massive Disks

Reiserfs is an excellent file system that allows you to easily manage hundreds of GB of file systems. The reiserfs file system supports a maximum file system size of 16 TB. This is very suitable for enterprise applications.

5. Excellent Performance

Thanks to its efficient storage and fast small file I/O features, when you start the X Window System Using the reiserfs file system PC, it takes 1/3 less time to use the ext2 file system than on the same machine. In addition, the reiserfs file system supports 4 GB files for a single file, which provides a better choice for applications of large database systems on Linux.

Ii. Use the reiserfs File System

1. Compilation Core

This document describes how to install and use the reiserfs File System on the 2.4.x core. By default, Versions later than version 2.4.x support the reiserfs file system. If your core does not currently support reiserfs, make sure that the downloaded patch version is consistent with your kernel version.

After the download, log on to the system as the root user, switch to the/usr/src/Linux directory, and run the following command:

# Gunzip/path/to/linux-2.2.16-reiserfs-3.5.22-patch.gz
# Patch-P1-I/path/to/linux-2.2.16-reiserfs-3.5.22-patch

To enable the new core to support the reiserfs file system, you must first enable the corresponding options during compilation. Currently, the kernel does not support the reiserfs File System by default. Therefore, when compiling the kernel, you must configure the kernel to support the reiserfs file system.

# Make menuconfig

In the "Code maturity level options" menu, select the "prompt for development and/or incomplete code/drivers." option. Then, go to the file system menu "file systems" and open the following options:

<*> Reiserfs support

Have reiserfs do extra Internal Checking

The reiserfs file system will support the kernel during compilation.

Then compile the core and install the core.

# Make bzimage
# Make Module
# Make module_install
# Make install;

Complete kernel compilation and installation.

2. Compile the reiserfs Tool

Next we will compile the reiserfs tool, the correspondingCodeIs stored in the/usr/src/Linux/fs/reiserfs/utils directory. First, make CompilationProgramAnd then make install to install the program. If these tools are not included in your core, you need to download them separately. Download from here:

Decompress the file:

# Tar zxvf reiserfsprogs-3.x.0j.tar.gz
# Cd reiserfsprogs-3.x.0j
#./Configure
# Make
# Make install

Compile and install the reiserfs tool.

Then start the system with the new core. If there is no problem, the new core already supports the reiserfs file system.

3. Use the New File System

1. Create a reiserfs File System

To use a new file system, first create a reiserfs File System:

[Root @ test/sbin] #./mkreiserfs-F/dev/sda3

The following information is displayed during partition formatting:

<------------- Mkreiserfs, 2001 ------------->
Reiserfsprogs 3. x.0j
========================================================== ======================================
Leaf node (8211) contains level = 1, nr_items = 2, free_space = 3932 rdkey
------------------------------------------------------------------------
| ###| Type | ilen | f/SP | loc | FMT | fsck | key |
| E/CN | need |
------------------------------------------------------------------------
| 0 | 1 2 0x0 SD, Len 44, entry count 0, fsck need 0, format new |
(New SD), mode drwxr-XR-X, size 48, nlink 2, mtime 09/14/2001 15:26:51 blocks 8
------------------------------------------------------------------------
| 1 | 1 2 0x1 Dir, Len 48, entry count 2, fsck need 0, format old |
###: Name Length object key hash Gen number
0: "." (1) 1 2 0 1, Loc 40, state 4 ??
1: ".." (2) 0 1 0 2, Loc 32, state 4 ??
========================================================== ====================================

Creating reiserfs of 3.6 format
Block Size 4096 bytes
Block count 128520
......
Attention: You shoshould reboot after fdisk!
(Y/n) all data will be lost on '/dev/sda3 '!

Type "Y" and press enter to start creating a new file system:

The formatting process is slow, depending on the partition size. However, the formatting of other file systems is much slower. After formatting, the following information is displayed:

(Y/n) all data will be lost on '/dev/sda3 '! Y
Initializing Journal-0%... 20%... 40%... 60%... 80% left 100%/sec
Syncing...
Reiserfs core development already sored by SuSE labs (suse.com)
Journaling stored sored by mp3.com.
To learn about the programmers and reiserfs, please go
Have fun.

Now the reiserfs partition is created.

2. Use the reiserfs File System

To use the new partition, mount it up:
# Mounut-T reiserfs/dev/sda3/mnt/fs

In this way, the new file system will be mounted to the/mnt/fs directory. Now you can use the new file system to store files.

Finally, to enable the system to automatically load the reiserfs file system at each startup, You Should manually change the/etc/fstab content and add the corresponding partitions to it. This article will not go into details here.

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.