AIX平台下创建文件系统需要注意的问题

AIX平台下创建文件系统需要注意的问题

本文PDF下载 http://xunzhaoxz.itpub.net/resource/40016/29781

作者:xunzhao【转载时请以超链接形式标明文章出处和作者信息】

链接:http://xunzhaoxz.itpub.net/post/40016/487969

关键字:AIX create file systems HACMP logfile jfslog jfs2log logform chfs 创建文件系统 重建JFSLOG JFS2LOG

这几天在看HACMP相关的一些文档,注意到在HACMP中添加NFS 资源组的时候,需要注意如下问题(即[1][2]),由此扩展开来,在AIX平台下创建文件系统需要注意的问题:

1) HA环境下为了确保发生takeover时能够顺利地接管失效节点的VG等资源,创建文件系统时需要注意:

[1] Ensure that the major number for each volume group is identical on both nodes.

[2] Defined, within each volume group, a logical volume and a file system that will be exported, and named them /ap1_fs and /app2_fs. Ensured that logical volumes names and jfslog names are consistent on both nodes.

当然HA环境下可以通过C-SPOC进行操作确保节点设置一致性。

2) 单机环境下,从方便管理、提高可读性等方面考虑,建议创建文件系统时手工指定LOG文件。

1. 前言:LOG文件简述

IBM红皮书《IBM Certification Study Guide Eserver p5 and pSeries Administration and Support for AIX 5L Version 5.3》中关于LOG文件的描述如下:

[@more@]

7.3 Device logs

The journaled file system log stores transactional information about file system metadata changes.This data can be used to roll back incomplete operations if the machine crashes. JFS file systems are used for logging logical volumes of type jfslog, while JFS2 file systems are used for logging logical volumes of type jfs2log.

Data from data blocks are not journaled. Log devices ensure file system integrity, not data integrity.

After the operating system is installed, all file systems within the rootvg volume group use logical volume hd8 as a common log.

You can create a JFS2 file system that can use inline logs. This means the log data is written into the same logical volume as the file system, and not into the log logical volume.

2. 新建文件系统并指定LOG文件

2.1. 创建typeJFS2LV

[p170:root:/]#smit mklv

29767-%CD%BC%C6%AC1.jpg

2.2. 创建typeJFS2LOGLV

创建了文件系统JFS2LV后,创建相应的JFS2LOG LV用于存放该文件系统的相关日志信息,这样一方面实现了上面提到的管理方便性,另一方面由于每个文件系统使用独立的LOG LV,避免了大数据量并发时LOG LV成为瓶颈,提高了系统的性能。

注意:这里创建的LOG LV必须与JFS2LV在同一个卷组中,否则将无法指定。

[p170:root:/]#smit mklv

29768-%CD%BC%C6%AC2.jpg

2.3. 创建文件系统并手工指定LOG LV

[p170:root:/]#smit crfs

è Add an Enhanced Journaled File System on a Previously Defined Logical Volume

29769-%CD%BC%C6%AC3.jpg

查看/etc/filesystems的变化

[p170:root:/]#tail /etc/filesystems

29770-%CD%BC%C6%AC4.jpg

此时可以得知/tmp/mp4这个文件系统当前使用的log文件为/dev/logtestfs4,查看当前两个LV的状态为closed/syncd说明两个LV目前未使用。

[p170:root:/]#lsvg -l datavg

datavg:

LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT

testfs3 jfs2 1 1 1 closed/syncd /tmp/mp3

loglv00 jfs2log 1 1 1 closed/syncd N/A

logtestfs4 jfs2log 1 1 1 closed/syncd N/A

testfs4 jfs2 1 1 1 closed/syncd /tmp/mp4

29771-%CD%BC%C6%AC5.jpg

2.4. 挂载使用文件系统并验证LOG文件

[p170:root:/]#mount /dev/testfs4 /tmp/mp4

[p170:root:/]#df –g

[p170:root:/]#mount

29772-%CD%BC%C6%AC6.jpg

当前mount结果显示/dev/testfs4使用的log文件是/dev/logtestfs4

再次查看两个LV的状态,已经显示为正在使用中的open/syncd状态。

[p170:root:/]# lsvg -l datavg

datavg:

LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT

testfs3 jfs2 1 1 1 closed/syncd /tmp/mp3

loglv00 jfs2log 1 1 1 closed/syncd N/A

logtestfs4 jfs2log 1 1 1 open/syncd N/A

testfs4 jfs2 1 1 1 open/syncd /tmp/mp4

29773-%CD%BC%C6%AC7.jpg

3. 为已有的文件系统重建LOG文件

本实验以rootvg上的/dev/testfs1为例,默认情况下rootvg上的文件系统使用hd8作为文件系统的LOG

3.1. 查看当前LOG信息:

[p170:root:/]#mount

29774-%CD%BC%C6%AC8.jpg

[p170:root:/]#tail /etc/filesystems

29775-%CD%BC%C6%AC9.jpg

3.2. 卸载需要重建LOG的文件系统

[p170:root:/tmp]#umount /tmp/mp1

[p170:root:/tmp]#mount

29776-%CD%BC%C6%AC10.jpg

3.3. 创建typeJFS2LOG LV

1) 创建LV

[p170:root:/tmp]#mklv -t jfs2log -y logtestfs1 rootvg 1

logtestfs1

[p170:root:/tmp]#

2) 格式化为log文件系统

[p170:root:/tmp]#logform /dev/logtestfs1

logform: destroy /dev/rlogtestfs1 (y)?y

[p170:root:/tmp]#

3) 分配log设备给文件系统使用

[p170:root:/tmp]#chfs -a log=/dev/logtestfs1 /tmp/mp1

[p170:root:/tmp]#cat /etc/filesystems

注意:这里必须使用chfs a指定log文件,而不是直接修改/etc/filesystems文件,否则exportvgimportvg时,文件系统对应的LOG文件将还原为原来的hd8

[p170:root:/tmp]#man chfs

-a log=LVName

Specifies the full path name of the filesystem logging logical volume name of the existing log to be used. The log device for this filesystem must reside on the same volume group as the filesystem.

29777-%CD%BC%C6%AC11.jpg

3.4. 挂载使用文件系统并验证LOG文件

[p170:root:/tmp]#mount /dev/testfs1 /tmp/mp1

[p170:root:/tmp]#cd /tmp/mp1

[p170:root:/tmp/mp1]#ls

abc abc.txt lost+found

[p170:root:/tmp]#

29778-%CD%BC%C6%AC12.jpg

文件系统/tmp/mp1已顺利挂载并可以正常读取出原有数据。

查看/etc/filesystems中关于/tmp/mp1的信息:

29779-%CD%BC%C6%AC13.jpg

29780-%CD%BC%C6%AC14.jpg

/dev/testfs1LOG文件已经被成功重建为/dev/logtestfs1

本次实验至此结束。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22085031/viewspace-1024439/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/22085031/viewspace-1024439/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值