Using JFS file System _unix Linux in Linux environment

Source: Internet
Author: User
Tags mkdir

JFS is a log file system developed by IBM for Linux systems. From IBM's strength and its attitude towards Linux, JFS should be the most powerful file system in the future log file system.


JFS provides a log-based byte-level file system that is developed for transaction-oriented high-performance systems. JFS can restore the file system to a consistent state in seconds or minutes. JFS can guarantee that data will not cause loss or damage to disk data in the event of any accidental downtime.

Features of JFS file system

1. Greater storage space

The minimum file system supported by JFS is 16M bytes. The maximum file system size is 512 trillion bytes (TB). JFS is the real 64-bit file system. All JFS file System-structured fields are 64-bit sizes.

2. Dynamic Disk Inode allocation

JFS dynamically allocates space on demand for disk inode, freeing up space that is no longer needed. This approach avoids the traditional method of reserving a fixed amount of space for the disk inode during file system creation. Users do not need to consider the maximum number of files and directories that the file system contains.

3. The addressing structure based on disk area

JFS using a disk-based addressing structure, JFS allocation attempts to make each panel as large as possible by assigning a minimum number of disk-area policies. This facilitates large I/O transfer, and all improvements in disk read and write performance.

4. Variable block size

JFS supports 512, 1024, 2048, and 4096-byte block sizes, allowing users to optimize space utilization based on the application environment. Smaller block sizes reduce the amount of internal storage debris and increase space utilization. The system default block size is 4096 bytes.

Ii. use of the JFS file system


1. Compiling the kernel to support the JFS file system

First download the latest 2.4.x core, then download the JFS System package, the name is: jfs-x.y.z-patch.tar.gz. Store the download file in the/USR/SRC directory.

Unpack the JFS packages under the/usr/src/directory

# TAR–ZXVF Jfs-2.4-1.0.4.tar.gz
# TAR–ZXVF Jfs-2.4-1.0.4-patch.tar.gz

Get four files:

Jfs-2.4.common-v1.0.4-patch
Jfs-2.4.7-v1.0.4-patch
Jfs-2.4.5-v1.0.4-patch
Jfs-2.4.0-v1.0.4-patch

Of these, the Jfs-2.4.common-v1.0.4-patch file is used for all 2.4 cores, Jfs-2.4.0-v1.0.4-patch for 2.4.0-2.4.2. Jfs-2.4.5-v1.0.4-patch can be used in core 2.4.5 and 2.4.6.

Pay attention to carefully read the Readme file, do not use the wrong patch file

Then the core is patched:

# PATCH–P1 < Jfs-2.4.5-v1.0.4-patch

Patching work completed.

Last Run

#make Menuconfig

The new file system is added to the core compilation configuration file for the following kernel configuration:

Using make Menuconfig, in the menu "Code maturity level options," select "Prompt for development and/or incomplete." Options. Then, go to the File system menu "file Systems" and select "JFS filesystem support." Options. Configuration core, so that the core support JFS file system. Other options for configuring the core.


<*> JFS filesystem Support


# #将JFS文件系统的支持编译入内核, or it can be compiled into module loading mode, see the following options:

<M> JFS filesystem Support

The author proposes to compile the JFS file system directly into the kernel, which is helpful to improve the system performance.

Then compile the core:

#make DEP
#make Clean
#make Bzimage
#make Modules
#make Modules_install
#cp ARCH/I386/BOOT/BZIMAGE/BOOT/VMLINUZ-2.4.5-JFS

Finally, edit the/etc/lilo.conf file and add a new kernel entry to boot the system with the new kernel. Add the following lines to the lilo.conf file as shown below:

Image=/boot/vmlinuz-2.4.5-jfs
Label=jfs
Read-only
Root=/dev/hda5

Then run Lilo to make the changes take effect.

#lilo

Iii. creating the Jfs file system

1. View system support for the JFS file system

If the new kernel starts correctly, this indicates that the core already supports the JFS file system. To view system processes, you can see the following processes:

#lsmod
7? SW 0:00 [Jfsio]
8? SW 0:00 [Jfscommit]
9? SW 0:00 [Jfssync]

If you see these processes, this indicates that the system core has supported the JFS file system.

In addition, there should be three more files in the/PROC/FS/JFS directory:

Jfsfyi
Logmgr
Txanchor


2. Download the compile JFS file System tool


In order to use the JFS file system, we also need to create a file system Tools, to IBM's JFS Web site to download the appropriate tool jfsutils-1.0.7.tar.gz software package.

Compile the installation process as follows:

#tar –ZXVF jfsutils-1.0.7.tar.gz
#cd jfsutils-1.0.7
#./configure
#make
#make Install

After the installation is complete, an executable file is MKFS.JFS in the/usr/sbin, which we use to format the partition into a JFS file system.

3. Creating the Jfs File system

The following starts by creating a JFS file system that formats the HDA6 partition into a JFS file system, as shown in the following format:

#mkfs-T Jfs/dev/hda6
MKFS.JFS Development version: $Name: V0_3_1 $
warning! All data on Device/dev/hda6 'll be lost!
Continue? (y/n) Y
\
Format completed successfully.
5120608 kilobytes total disk spaces.

After the run is complete, the JFS file system has been created in the Hda6 partition.

4. Loading the JFS file system

First, create a directory JFS to mount the JFS file system onto it:

#mkdir JFS

Mount the new partition under the JFS directory:

#mount –t JFS/DEV/HDA6/JFS

In this way, the new file system is loaded into the/JFS directory. You can now use the new file system.

Iv. use of the JFS file system

1. Normal partitions use JFS file system

After the Linux kernel supports the JFS file system, you can format all partitions of the disk into the JFS file system. In general, it is recommended that partitions such as/usr,/usr/sbin have a non log file system, and that the JFS file system be used on partitions that are frequently read and write. This is beneficial to improve system performance.


2. The primary boot area uses the JFS file system


The primary partition is the Linux boot partition, which holds the basic files required for system startup. The following starts with the JFS file system for the primary partition, which first backs up all the common file directories on the primary partition:

#cd/
#cp-A bin etc lib Boot dev home usr var [...]/jfs
#mkdir/jfs/proc

You should also change the/etc/fstab file to use the appropriate partition as the root partition before you start using the JFS file system. As follows: The original root partition is:

label=//ext2 Defaults 1 1

Should be changed to read:

/DEV/HDA6/JFS Defaults 1 1

Then, compile the/etc/lilo.conf file and change the primary boot partition to/DEV/HDA6. Set the label to JFS and the default startup setting to JFS.

As shown below:

Default=jfs
...
Image=/boot/vmlinuz-2.4.0-jfs
Label=jfs
Read-only
Root=/dev/hda6

Then, run Lilo, complete.

Finally, the reboot system, after startup, you get a pure JFS file system Linux environment, the rest is to reformat the original primary partition into a JFS, and then mount it to the main partition of a directory on the line.

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.