3.6. Adding Journals to a GFS2 File System
The
gfs2_jadd
command is used to add journals to a GFS2 file system. You can add journals to a GFS2 file system dynamically at any point without expanding the underlying logical volume. The gfs2_jadd
command must be run on a mounted file system, but it needs to be run on only one node in the cluster. All the other nodes sense that the expansion has occurred.
注意
If a GFS2 file system is full, the
gfs2_jadd
command will fail, even if the logical volume containing the file system has been extended and is larger than the file system. This is because in a GFS2 file system, journals are plain files rather than embedded metadata, so simply extending the underlying logical volume will not provide space for the journals.
Before adding journals to a GFS2 file system, you can find out how many journals the GFS2 file system currently contains with the
gfs2_edit -p jindex
command, as in the following example:
# gfs2_edit -p jindex /dev/sasdrives/scratch|grep journal
3/3 [fc7745eb] 4/25 (0x4/0x19): File journal0
4/4 [8b70757d] 5/32859 (0x5/0x805b): File journal1
5/5 [127924c7] 6/65701 (0x6/0x100a5): File journal2
用法
gfs2_jadd -j Number MountPoint
Number
- 指定要添加的新日志数目。
MountPoint
- 指定要挂载 GFS2 文件系统的目录。
示例
这个示例中,在
/mygfs2
目录的文件系统中添加了一个日志。
gfs2_jadd -j 1 /mygfs2
这个示例中,在
/mygfs2
目录的文件系统中添加了两个日志。
gfs2_jadd -j 2 /mygfs2
完整用法
gfs2_jadd [Options
] {MountPoint
|Device
} [MountPoint
|Device
]
MountPoint
- 指定要挂载 GFS2 文件系统的目录。
Device
- 指定文件系统的设备节点。
表 3.4 “添加日志时可用的 GFS2 特定选项” describes the GFS2-specific options that can be used when adding journals to a GFS2 file system.
标签 | 参数 | 描述 |
---|---|---|
-h | 帮助,显示简短用法信息。 | |
-J | Megabytes | 以 MB 为单位指定新日志的大小。默认日志大小为 128MB,最小值为 32MB。要在文件系统添加不同大小的日志,必须为每个不同大小的日志运行 gfs2_jadd 命令。指定的大小会不断下降,因此在生成文件系统时会指定多个日志区段。 |
-j | Number | 用 gfs2_jadd 命令指定要添加的新日志数目,默认值为 1。 |
-q | 静默,降低详细等级。 | |
-V | 显示命令版本信息。 |