GFS is actually a Network Log File System, which is usually used as a shared storage device by multiple computers. Because GFS is a log file system, if you apply it to a separate computer, it is equivalent to a local log file system, and enjoy the benefits of the log file system. This document describes how to use the GFS File System in Linux.
1. Download and compile
Download GFS file system address: http://www.sistina.com/products_GFS.htm
The GFS file system was previously a fully open source code project that can be downloaded to the source code until the version is GFS-4.2.0. When I wrote this article, I downloaded the source code of GFS4.2.0, but now I can no longer download the code after GFS4.2.0, because GFS starts charging fees. However, 4.1.1 and earlier versions can still be downloaded to: ftp: // ftp.sistina.com/pub/gfs. The trial version can be downloaded for 30 days at http://www.sistina.com/after registration.
1. Compilation Core
This document uses GFS4.2.0 as an example. First, patch the core and run the following script to patch the core:
#./GFS-contribe-4.2.0/scripte/apply_patch-k/usr/src/Linux-p
To answer a string of yes,
Complete patching. Then, run the following command:
# Make menuconfig
# Make dep
# Make bzImage; make modules; make modules_install
# Cp bzImage/boot
Edit/etc/lilo. conf and run lilo
Then restart the system.
2. Install tools and software for the GFS File System
The installation procedure is as follows:
# Tar-zxvf GFS-4.2.0.tar.gz
The compilation process is as follows:
The installation procedure is 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.
Ii. Use the GFS File System
During compilation, GFS is compiled as a load module. Therefore, the GFS module must be loaded first. The command for loading a module is as follows:
# Modprobe nolock
Before loading the GFS module, you must first load the nolock module, because GFS depends on the nolock module.
# Modprobe GFS
During compilation, the GFS file system is compiled in the form of pluggable modules. Therefore, this command is used to load the GFS module.
After the kernel has loaded the support module for the GFS file system, create a GFS file system and use the GFS tool to create the GFS file system. The creation process is 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] #
Note: format the partition/dev/sda8 as the GFS file system and save the log records in the current shard.
After the formatting is completed, the GFS file system is loaded.
# Mount-t GFS/dev/hda8/GFS # Note: load the GFS partition to the/GFS directory.
GFS: Trying to acquire journal lock 0...
GFS: Trying at journal 0...
GFS: Done
The above indicates that the mount is successful and can be used later.
To enable the GFS file system to be automatically loaded after the machine starts later, you need to rewrite the/etc/fstab file and add the following content:
/Dev/hda8/GFS default 0 0
After the system starts, the GFS file system will be automatically loaded.
- Technical Analysis Using Linux and GFS to create Cluster Storage
- Introduction to commands for removing file attributes in Linux
- Introduction to du command parameters and df and dd commands in linux