Use JFS File System in Linux

Source: Internet
Author: User
Article Title: Use JFS File System in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
JFS is a log file system developed by IBM for linux. From IBM's strength and attitude towards Linux, JFS should be the most powerful file system in the future.
JFS provides a log-based byte-level file system developed for a high-performance transaction-oriented system. JFS can restore the file system to a consistent state within several seconds or minutes. JFS ensures that data on disks will not be lost or damaged in case of any unexpected downtime.
  
   I. JFS file system features
1. A larger storage space
The Minimum File System Supported by JFS is 16 Mb. The maximum file system size is 512 trillion bytes (TB ). JFS is a true 64-bit file system. All structured fields in the JFS file system are 64-bit.
  
2. Dynamic Disk inode allocation
JFS dynamically allocates space for the disk inode as needed and releases the space that is no longer needed. This method avoids the traditional method of retaining a fixed amount of disk inode space during file system creation. You do not need to consider the maximum number of files and directories contained in the file system.
3. disk-based addressing Structure
JFS uses a disk-zone-based addressing structure. JFS allocation attempts to allocate a minimum number of disk areas, so that each disk area is as large as possible. This is conducive to large I/O transmission and improves the disk read/write performance.
4. Variable Block Size
JFS supports block sizes of 512, 1024, 2048, and 4096 bytes, allowing you to optimize space utilization based on the application environment. The smaller block size reduces the number of internal storage fragments and improves space utilization. The system default block size is 4096 bytes.
  
   Ii. Use the JFS File System
1. Compile the kernel to support the JFS File System
First download the latest 2.4.x core, ftp://ftp.kernel.org /. Then download the JFS System Software Package: Kernel. Store the downloaded file in the/usr/src directory.
Unpack the jfs software package in 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
Four files are obtained:
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
Where the jfs-2.4.common-v1.0.4-patch file is used for all 2.4 cores, The jfs-2.4.0-v1.0.4-patch is used for 2.4.0-2.4.2. Jfs-2.4.5-v1.0.4-patch can be used for core 2.4.5 and 2.4.6.
Read the README file carefully. Do not use the wrong patch file.
Next we patch the core:
# Patch? P1 jfs-2.4.5-v1.0.4-patch
Patch completed.
Last run
# Make menuconfig
Add the new file system to the core compilation configuration file. perform the following Kernel configuration:
Use 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 select the "JFS filesystem support." option. Configure the core to support the JFS file system. Configure other core options.
<*> JFS filesystem support
# Compile the support of the JFS file system into the kernel, or compile it into a module loading mode. See the following options:
   JFS filesystem support
I suggest you directly compile the JFS file system into the kernel, which is conducive to improving 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 new kernel entries to use the new kernel boot system. Add the following lines to the lilo. conf file:
Image =/boot/vmlinuz-2.4.5-jfs
Label = jfs
Read-only
Root =/dev/hda5
Then run lilo to make the change take effect.
# Lilo
  
   3. Create a JFS File System
1. view the system's support for the JFS File System
If the new kernel is correctly started, it indicates that the core already supports the JFS file system. You can view the following processes:
# Lsmod
7? SW 0: 00 [jfsIO]
8? SW 0: 00 [jfsCommit]
9? SW 0: 00 [jfsSync]
If you see the above processes, this indicates that the system core already supports the JFS file system.
In addition, there should be three files in the/proc/fs/jfs directory:
JfsFYI
Logmgr
TxAnchor
  
2. Download and compile the JFS File System Tool
License Software Package.
: Http://oss.software.ibm.com/developer/opensource/jfs/project/pub/jfsutils-1.0.7.tar.gz
The compilation and installation process is 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 extra Executable File mkfs. jfs will be added in/usr/sbin, and we will use it to format the partition into a jfs file system.
  
3. Create a JFS File System
Create a JFS file system and format the hda6 partition into a JFS file system. The following content is displayed during formatting:
# Mkfs-t jfs/dev/hda6
Mkfs. jfs development version: $ Name: v0_3_1 $
Warning! All data on device/dev/hda6 will be lost!
Continue? (Y/N) y
\
Format completed successfully.
5120608 kilobytes total disk space.
After running, the JFS file system has been created in the hda6 partition.
4. Load the JFS File System
First, create a directory jfs to mount the JFS file system to it:
# Mkdir jfs
Mount the new partition to the jfs directory:
# Mount? T jfs/dev/hda6/jfs
In this way, the new file system is loaded to the/jfs directory. Now you can use the new file system.
  
   4. Use the JFS File System
1. common partitions use JFS File System
After the Linux kernel supports the JFS file system, all partitions on the disk can be formatted as the JFS file system. In general, it is recommended that partitions such as/usr,/usr/sbin adopt non-log file systems, while JFS file systems are used for partitions with frequent read/write requirements. This helps improve system performance.
2. Use the JFS File System in the Main Boot Area
The primary partition is the linux boot partition, which stores the basic files required for system startup. The following describes how to use the JFS File System for the primary partition. First, back up all common file directories on the primary partition:
# Cd/
# Cp-a bin etc lib boot dev home usr var [...]/jfs
# Mkdir/jfs/proc
  
Before using the JFS file system to start up, you should also change the/etc/fstab file and use the corresponding partition as the root partition. The original root partition is as follows:
LABEL = // ext2 defaults 1 1
It should be changed:
/Dev/hda6/jfs defaults 1 1
Then, compile the/etc/lilo. conf file and change the primary boot partition to/dev/hda6. Set label to jfs and set the default start to jfs.
As follows:
Default = jfs
...
Image =/boot/vmlinuz-2.4.0-jfs
Label = jfs
Read-only
Root =/dev/hda6
Run lilo.
Finally, after the reboot system is started, you will get a linux environment for the pure jfs file system. The rest is to reformat the original primary partition into jfs, then mount it to a directory in the primary partition.

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.