In our previous post ( RHCS : GFS2 Filesystem configuration in Clustered Environment – Part1 ) we have discussed about the introduction and initial configuration of GFS2. And this post we will go through the administration tasks related to GFS2 filesystems. And this post doesn’t cover entire admin tasks related to GFS2 but covers major day-to-day operations related to GFS2 in Redhat Clustered environment.
Below are the Tasks I will be discussing in this post:
1. GFS2 File System Expansion
2. GFS2 Journal Addition
3. Suspending and Resuming Writing Activities on GFS2 filesystems
4. Repairing GFS2 filesystem
GFS2 File System Expansion
Step 1: Check The Current Filesystem Size, LV size and PV size
Error: The device has grown by less than one Resource Group (RG).
The device grew by 200MB. One RG is 249MB for this file system.
Note: Remembered the point we discussed duringthe GFS2 filesystem creation, the command output was shown as Resource Groups = 2,that means total 500M volume divided into two RGs of each ~250M each. We should minimum allocate atleast the size of one RG, whenever we want to grow the filesystem using gfs2_grow.
Ordinarily, GFS2 writes only metadata to it’s journal. File contents are subsequently written to disk by the kernel’s periodic sync that flushes filesystem buffers. An fsync() call on a file causes the file’s data to be written to disk immediately.
– Applications that rely on fsync() to sync file data may see improved performance by using data journaling.
– Data journaling can result in a reduced fsync() time for very small files because the file data is written to the journal in addition to the metadata.
– The data jourtnaling advantages rapidly reduces as the file size increases. Writing to medium and larger files will be much slower with data journaling turned on.
Suspending Write Activity on GFS2 filesystem, for BackUP purpose
We can suspend write activity to a file system by using the dmsetup suspend command. Suspending write activity allows hardware-based device snapshots to be used to capture the file system in a consistent state. The dmsetup resume command ends the suspension.
Step 1: Suspend the writing activity in the filesystem
Then the previous “rm a” command on session command completed.
Repairing GFS2 Filesystems
Few points to remember:
1. We should not enable FSCK during boot time in /etc/fstab options
2. The fsck.gfs2 command must be run only on a file system that is unmounted from all nodes.
3. Pressing Ctrl+C while running the fsck.gfs2 interrupts processing and displays a prompt asking whether you would like to abort the command, skip the rest of the current pass, or continue processing.
4. You can increase the level of verbosity by using the -v flag. Adding a second -v flag increases the level again.
5. You can decrease the level of verbosity by using the -q flag. Adding a second -q flag decreases the level again.
6. The -n option opens a file system as read-only and answers no to any queries automatically. The option provides a way of trying the command to reveal errors without actually allowing the fsck.gfs2 command to take effect.
I have started unixadminschool.com ( aka gurkulindia.com) in 2009 as my own personal reference blog, and later sometime i have realized that my leanings might be helpful for other unixadmins if I manage my knowledge-base in more user friendly format. And the result is today's' unixadminschool.com.
You can connect me at - https://www.linkedin.com/in/unixadminschool/