The GFS file system is actually a log file system that is often used as multiple computers to share the same storage device. Because GFS is a log file system, it benefits from the log file system if applied to a single computer, which is exactly equivalent to the local log file system. This article introduces you to the use of the GFS file system in a Linux environment.
First, download and compile
The GFS file system was formerly a fully exposed project of the source code and can be downloaded to the source code when the version is GFS-4.2.0. In writing this article, the author downloads to the GFS4.2.0 source code, but now can not download the code after GFS4.2.0, because GFS began to charge.
1, compile the core
This paper takes GFS4.2.0 as an example to explain. Start with the core patch, run the following script, for the core patching:
#./gfs-contribe-4.2.0/scripte/apply_patch–k/usr/src/linux–p
Answer a bunch of yes,
Complete the patching work. Then, run the following command:
#make Menuconfig
#make DEP
#make Bzimage;make modules; Make Modules_install
#cp Bzimage/boot
Edit/etc/lilo.conf, and after running Lilo, reboot the system.
2, install the GFS file system supporting tools software installation steps are as follows:
#tar –ZXVF gfs-4.2.0.tar.gz
The compilation process is as follows:
#./configure
#make
#make Install
Compile and install the GFS tool complete.
Second, using the GFS file system
At compile time, the GFS is compiled into a loadable module, so when used, the GFS module is first loaded. The load module commands are as follows:
#modprobe Nolock
Load the NOLOCK module first before loading the GFS module, because GFS relies on the NOLOCK module
#modprobe GFs
At compile time, the GFS file system is compiled in a pluggable module, so the GFS module is loaded with this command.
After the kernel loads the support module for the GFS file system, the next step is to create a GFS file system that uses the GFS tool to create the GFS file system, as follows:
[root@test/sbin]#./mkfs_gfs-j 5/dev/sda8–p Nolock
Device:/dev/sda8
blocksize:4096
FileSystem size:177484
Journals:5
Resource groups:10
Locking Protocol:
Lock Table:
Syncing ...
All done
[root@test/sbin]#
Description: Format the partition/dev/sda8 as a GFS file system and save the log records in this subregion.
When the format is complete, the GFS file system is loaded
# mount–t Gfs/dev/hda8/gfs # #说明: Load the GFS partition into the/gfs directory
Gfs:trying to acquire journal Lock 0 ...
Gfs:trying at journal 0 ...
Gfs:done
The above indicates successful mount, and then you can use it.
In order to automatically load the GFS file system after the machine starts, you need to rewrite the/etc/fstab file and add the following:
/dev/hda8/gfs Default 0 0
The GFS file system is automatically loaded later when the system starts.