ReiserFS file System _unix Linux in Linux environment

Source: Internet
Author: User

ReiserFS is a very good file system. It is also one of the earliest log file systems for Linux.

ReiserFS's developers are very bold, and the entire filesystem is designed entirely from scratch. At present, ReiserFS can easily manage hundreds of g of file systems, which is very important in enterprise applications.
First, the characteristics of ReiserFS

1. Advanced Logging mechanisms

ReiserFS has advanced log (journaling/logging) functional mechanisms. The logging mechanism guarantees that the corresponding log has been written to the hard disk before each actual data modification. The security of files and data has improved a lot.

2. Efficient use of disk space

ReiserFS does not assign an inode to some small files. Instead, the files are packaged and stored in the same disk partition. The other file systems are placed into one disk partition for each small file. This means that if you have 10,000 small files, you need to occupy 10,000 blocks. Consider how much disk space is wasted.

3. Unique way to search

ReiserFS based on the fast Balance tree (balanced) search, the balance tree is excellent in performance, which is a very efficient algorithm. ReiserFS search 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 the B+tree tree. B*tree query speed is much faster than B+tree. ReiserFS is very fast on file positioning.

In practice, ReiserFS is 8 to 15 times times faster than ext2 when dealing with files less than 1k! ReiserFS is better than ext2 in almost all aspects, please refer to the author's test article for specific data.

4. Support for mass disks


ReiserFS is a very good file system, easy to manage the Hundred G file system, ReiserFS file system maximum support file system size is 16TB. This is ideal for enterprise applications.

5. Excellent performance

Because of its efficient storage and fast small file I/O features, PCs that use the ReiserFS file system spend 1/3 less time starting the X Window System than using the Ext2 file system on the same machine. In addition, the ReiserFS file system supports files of a single file size of 4G, which provides a better choice for the application of large database systems on Linux.

Ii. use of the ReiserFS file system

1, compile the core

In this paper, the installation and use process of the ReiserFS file system under the 2.4.x core is described. The ReiserFS file system is supported by default for versions of kernel version 2.4.x. If your core does not currently support ReiserFS, make sure that the patched version of the download is consistent with your kernel version.

After downloading, log in as root into the system, switch to the/usr/src/linux directory, and execute the 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

For the new core to support the ReiserFS file system, the first thing to do is to turn on the option, the kernel defaults to not support the ReiserFS file system. So, when compiling the kernel, configure the kernel to support the ReiserFS file system.

#make Menuconfig

In the menu "Code maturity Level Options", select "Prompt for development and/or incomplete code/drivers." Options. 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 is about to support the compile-time kernel.

Then compile the core and install the core.

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

Completes the kernel compile installation work.

2. Compile ReiserFS Tools

Below we will compile the ReiserFS tool, the corresponding code is stored in the/usr/src/linux/fs/reiserfs/utils directory, first make the compiler, and then install to install the program. If your core does not include these tools, you will need to download them separately. Download from here:

Extract files:

# tar ZXVF reiserfsprogs-3.x.0j.tar.gz
# CD REISERFSPROGS-3.X.0J
#./configure
# make
# make Install

Complete the compilation and installation of ReiserFS tools.

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

Iii. use of the new file system

1. Creating the ReiserFS File system

To use the new file system, first create a ReiserFS file system:

[root@test/sbin]#./mkreiserfs-f/dev/sda3

The following is the information that is displayed when the partition is formatted:

<-------------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, entry count 0, fsck need 0, format new|
(NEW SD), mode drwxr-xr-x, size, Nlink 2, mtime 09/14/2001 15:26:51 blocks 8
------------------------------------------------------------------------
| 1|1 2 0x1 DIR, Len, entry Count 2, fsck need 0, format old|
###: Name length Object key Hash Gen number
0: "." (1) 1 2 0 1, loc, State 4??
1: ".." (2) 0 1 0 2, loc, State 4??
=======================================================================


Creating ReiserFS of 3.6 format
Block size 4096 bytes
Block Count 128520
... ...
Attention:you SHOULD REBOOT after fdisk!
(y/n) All DATA is LOST on '/dev/sda3 '!


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

The formatting process is slow, depending on the size of the partition, but it is significantly slower than the formatting of the other file systems. When the format is complete, the following information is displayed:

(y/n) All DATA is LOST on '/dev/sda3 '! Y
Initializing journal-0% ..... 20%... 40%... 60%... 80%... 100% left 0, 182/sec
Syncing ...
ReiserFS Core Development sponsored by SuSE Labs (suse.com)
Journaling sponsored by MP3.com.
To learn about the programmers and ReiserFS.
Have fun.

This completes the creation of the ReiserFS partition.

2. Using the ReiserFS file system

To use the new partition, you need to mount it:
# mounut–t Reiserfs/dev/sda3/mnt/fs

The new file system is then mount to the/MNT/FS directory. You can now start storing files using the new file system.

Finally, in order for the system to automatically load the ReiserFS file system each time it is started, you should manually change the/etc/fstab content and add the appropriate partitions to it. This article does not dwell on this.

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.