victorylee
作者victorylee·2022-05-31 16:10
软件开发工程师·浪潮商用机器有限公司

GPFS应用:GPFS中WORM (write once and read many)的应用场景和操作步骤

字数 1232阅读 1207评论 0赞 4

GPFS的高级功能实战操作系列

目录

GPFS性能调优系列:

GPFS运维系列:


GPFS应用:GPFS中WORM (write once and read many)的应用常见和操作步骤

WORM (write once and read many) 文件是指写入一次,然后相关文件只能读不能写或修改。使用这种类型文件,可以对重要文件进行保护,防止被篡改。实现该需求需要使用一个不可变的fileset,操作步骤如下:

1. 创建一个独立的fileset (independent fileset)

[root@gpfs02 gpfs1]# mmcrfileset gpfs2 fileset2

Fileset fileset2 created with id 1 root inode 134144.

[root@gpfs02 gpfs1]#

[root@gpfs02 gpfs1]# mmlsfileset gpfs2

Filesets in file system 'gpfs2':

Name Status Path

root Linked /gpfs/gpfs2

fileset2 Unlinked --

[root@gpfs02 gpfs1]#

2. 将filese link到GPFS中的一个目录上,该目录当前必须不存在

mmlinkfileset _-J _directory

[root@gpfs02 gpfs1]# mmlinkfileset gpfs2 fileset2 -J /gpfs/gpfs2/fileset2

Fileset fileset2 linked at /gpfs/gpfs2/fileset2

[root@gpfs02 gpfs1]#

3. 创建测试文件,此时文件可读可写

创建一个有读写权限的文件 testfile,然后添加一些内容在文件中,操作如下:

4. 检查fileset所属文件夹属性,并修改文件夹的属性

使用下面的命令将文件夹修改为只读:

5. 检查fileset,此时文件可读,但不能修改

[root@gpfs02 fileset2]# echo 'hello ' >> testfile

-bash: testfile: Read-only file system

[root@gpfs02 fileset2]# chmod +w testfile

chmod: changing permissions of 'testfile': Operation not permitted

[root@gpfs02 fileset2]# cat testfile

test test

test

test

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

4

添加新评论0 条评论

Ctrl+Enter 发表

作者其他文章

相关文章

相关问题

相关资料

X社区推广