Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

3.7.2. gfs2_tool 명령으로 데이터 저널링 활성화 및 비활성화

다음의 명령으로 /mnt/gfs2/gfs2file GFS2 파일에 데이터 저널링을 활성화합니다.
[root@roth-01 ~]# gfs2_tool setflag jdata /mnt/gfs2/gfs2file 
lsattr 명령을 사용하여 jdata 플래그가 설정되어 있는지 확인할 수 있습니다.
[root@roth-01 ~]# lsattr /mnt/gfs2
---------j--- /mnt/gfs2/gfs2file
디렉토리에 gfs2file 플래그가 설정되어 있을 경우, 결과적으로 디렉토리에 생성된 모든 파일 및 디렉토리는 저널링됩니다.
다음의 명령으로 /mnt/gfs2 디렉토리에 gfs2_dir라는 새로운 하부 디렉토리를 생성하고, 디렉토리에 jdata 플래그를 설정한 후, 플래그가 올바르게 설정되었는 지를 확인합니다. 그 후, 이러한 명령은 디렉토리에 gfs2file 파일을 생성한 후 파일해 대한 플래그가 올바르게 설정되었는지를 확인합니다.
[root@roth-01 ~]# mkdir /mnt/gfs2/gfs2_dir
[root@roth-01 ~]# gfs2_tool setflag jdata /mnt/gfs2/gfs2_dir
[root@roth-01 ~]# lsattr /mnt/gfs2
---------j--- /mnt/gfs2/gfs2_dir
[root@roth-01 ~]# touch /mnt/gfs2/gfs2_dir/newfile
[root@roth-01 ~]# lsattr /mnt/gfs2/gfs2_dir
---------j--- /mnt/gfs2/gfs2_dir/newfile
다음의 예에서와 같이, 파일이나 디렉토리에서 jdata 플래그를 삭제하기 위해 gfs2_tool clearflag jdata 명령을 사용할 수 있습니다.
[root@roth-01 ~]# gfs2_tool clearflag jdata /mnt/gfs2/gfs2file 
[root@roth-01 ~]# lsattr /mnt/gfs2
------------- /mnt/gfs2/gfs2file