AIX报错0506-342 无法挂载分区问题解决

故障现象:

一台P550 AIX系统主机,启动后发现数据分区没有挂载上,手动挂载提示如下错误

#mount   /data

Replaying log for /dev/lv_tdprd_bak.mount: 
0506-324 Cannot mount /dev/lv_tdprd_bak on /data: The media is not formatted or the format is not correct.
0506-342 The superblock on /dev/datavg is dirty.  Run a full fsck to fix.

查看系统日志如下:

# errpt
A6DF45AA   0215180108 I O RMCdaemon      The daemon is started.
B38E3397   0215175908 U S SYSDUMP        先前的系统转储信息
C0AA5338   0215175808 U S SYSDUMP        系统转储
9D035E4D   0215175108 P S SYSVMM         数据存储中断,处理器
9DBCFDEE   0215175908 T O errdemon       记录错误日志打开
B6DB68E0   0215043408 I O SYSJ2          FILE SYSTEM RECOVERY REQUIRED
49A83216   0215030208 T H hdisk2         磁盘操作错误
6926ECA8   0215030108 I O SYSJ2          META-DATA I/O ERROR
613E5F38   0215030108 P H LVDD           LVM 检测到 I/O 错误
425BDD47   0215030108 P H hdisk2         磁盘操作错误

故障原因:

由于AIX重启时无法正常重启,强制重启后出现如上错误。这是因为强制关机造成了系统分区的损坏,显示“The media is not formatted or the format is not correct”错误,导致分区无法正常挂载。

解决办法:

执行fsck对磁盘分区进行修复

#fsck  -p  /data

** Phase 1 - Check Blocks and Sizes
....
** Phase 6b - Salvage Block Map
-1 blocks missing
-1 blocks missing
Superblock is marked dirty (FIXED)
1922574 files 375776584 blocks 46344568 free
***** Filesystem was modified *****

修复成功后重新挂载分区,问题解决。

 

 

文件系统无法mount的问题

 故障现象

# oslevel -r
5200-04

# lsvg  
rootvg
datavg

#lspv
hdisk0          0054338ee0b6f496                    rootvg          active
hdisk1          0054338efa398c64                    datavg          active
# lsvg -l datavg
web:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
web         jfs        100   100   1    open/syncd    /ws
loglv00             jfslog     1     1     1    open/syncd    N/A
data              jfs2       284   284   1    closed/syncd  /data
loglv01             jfs2log    1     1     1    closed/syncd  N/A

# mount /data
重新播放 /dev/data 的日志。
mount: 0506-324 不能将 /dev/data2 安装到 /data2:媒体未格式化或格式不正确。
0506-342 /dev/data2 的超级块有错误,运行完整的 fsck 以修订。

查看错误日志表明hdisk1损坏.

# errpt

A6DF45AA   0215180108 I O RMCdaemon      The daemon is started.
B38E3397   0215175908 U S SYSDUMP        先前的系统转储信息
C0AA5338   0215175808 U S SYSDUMP        系统转储
9D035E4D   0215175108 P S SYSVMM         数据存储中断,处理器
9DBCFDEE   0215175908 T O errdemon       记录错误日志打开
B6DB68E0   0215043408 I O SYSJ2          FILE SYSTEM RECOVERY REQUIRED
49A83216   0215030208 T H hdisk2         磁盘操作错误
6926ECA8   0215030108 I O SYSJ2          META-DATA I/O ERROR
613E5F38   0215030108 P H LVDD           LVM 检测到 I/O 错误
425BDD47   0215030108 P H hdisk2         磁盘操作错误

 

 解决步骤

  由于datavg里有2个文件系统,/ws文件系统可以mount,因此先备份此文件系统数据至安全处,然后按如下步骤进行:

 1 运行fsck修复

# fsck /data

 

****************
当前卷是:/dev/data
**阶段 1 — 检查块、文件/目录和目录条目
fsck0507-089 读 /dev/rdata 时发生不可恢复的错误。无法继续。
fsck0507-039 在访问文件系统(11736010956816384-1)时发生严重错误(-10015-1)。
fsck0506-042 执行模块“/sbin/helpers/jfs2/fsck”失败。

# mount /data
重新播放 /dev/data 的日志。
mount: 0506-324 不能将 /dev/data2 安装到 /data2:媒体未格式化或格式不正确。
0506-342 /dev/data2 的超级块有错误,运行完整的 fsck 以修订。

 

超级块修复

Recovering superblock errors

If you receive one of the following errors from the fsck or mount commands, the problem may be a corrupted superblock.

fsck: Not an AIX4 file system

fsck: Not an AIXV4 file system

fsck: Not a recognized file system type

0506-342 The superblock is dirty.  Run a full fsck to fix.

mount: invalid argument

The backup superblock can be copied over the primary superblock via one of these commands:

     dd count=1 bs=4k skip=31 seek=1 if=/dev/lv00 of=/dev/lv00 (JFS)

     dd count=1 bs=4k skip=15 seek=8 if=/dev/lv00 of=/dev/lv00 (JFS2) (Version

5 only)

     fsck -p /dev/lv00 (works for both JFS and JFS2)

Once the copying over is completed, check the integrity of the file system by issuing:

     fsck /dev/lv00

In many cases, copying the backup superblock to the primary superblock will recover the file system. If this does not work, you will have to recreate the file system and restore the data from a backup.

3 Formats a logical volume

 # logform /dev/loglv01 
logform: destroy /dev/rloglv01 (y)?y

# fsck /data

 

****************
当前卷是:/dev/data
**阶段 1 — 检查块、文件/目录和目录条目
fsck0507-089 读 /dev/rdata 时发生不可恢复的错误。无法继续。
fsck0507-039 在访问文件系统(11736010956816384-1)时发生严重错误(-10015-1)。
fsck0506-042 执行模块“/sbin/helpers/jfs2/fsck”失败。

# mount /data
重新播放 /dev/data 的日志。
mount: 0506-324 不能将 /dev/data2 安装到 /data2:媒体未格式化或格式不正确。
0506-342 /dev/data2 的超级块有错误,运行完整的 fsck 以修订。

恢复备份的数据

   客户的系统日志里已经表明此datavg的硬盘已经坏了,由以上几步都无法解决问题,因此只能换新盘并重新建立/data文件系统,恢复备份的数据.客户50G的数据大约有3G的无法恢复,只能客户自己再手工恢复了(重新输入数据).如果平时没有做好数据备份那只能哭了,因此一定要做好平时的数据备份.

 

#lspv
hdisk0          000af70d4d50358c                    rootvg          active
hdisk1          000af70dca7aea4d                    datavg          active
hdisk2          000af70dca7ae679                    sunvg           active
#lsvg -l datavg
datavg:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
raw1                raw        5     5     1    closed/syncd  N/A
loglv00             jfs2log    1     1     1    closed/syncd  N/A
fslv00              jfs2       192   192   1    closed/syncd  /solaris
lv00                raw        4     4     1    closed/syncd  N/A
#mount /solaris
mount: 0506-324 Cannot mount /dev/fslv00 on /solaris: There is a request to a device or address that does not exist.
比较奇怪,以前没遇到过
errpt,没有得到有效的信息
/etc/filesystems文件也正常
fsck /solaris的时候发现问题所在了
#fsck /solaris

The current volume is: /dev/fslv00
Open volume exclusive read or write returned, rc = 6
fsck: 0507-289 Device unavailable or locked by another process.
         Cannot continue.
原因是被锁定了,这时才回想起来,昨天同事问了一个varyonvg -s的问题,
从新varyoffvg ,再次varyonvg 
#varyoffvg datavg
#varyonvg datavg
#mount /solaris
#df -k
Filesystem    1024-blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4           180224    110672   39%     2753     4% /
/dev/hd2          2867200    134992   96%    39835     6% /usr
/dev/hd9var         16384      4996   70%      441    11% /var
/dev/hd3            65536     28484   57%      283     2% /tmp
/dev/hd1            16384     15756    4%       87     3% /home
/proc                   -         -    -         -     -  /proc
/dev/hd10opt       114688      4668   96%     2629    10% /opt
/dev/test          327680    326048    1%        5     1% /tst
/dev/fslv00       3145728   1113040   65%      638     1% /solaris
问题解决,
再仔细察看了一下-s参数的作用

-s   使卷组只在系统管理方式中可用。逻辑卷命令能对卷组执行操作,但是不能为输入或输出打开逻辑卷。 
     注:逻辑卷命令也不能读取或写入用 -s 标志联机的卷组中的逻辑卷。如果逻辑卷命令试图写入用 -s 标志联机的卷组内的某个逻辑卷(如 chvg 或 mklvcopy),那么可能显示错误消息,表明它们不能写入和/或读取逻辑卷。
   在使用-s参数激活卷组的情况下,卷组的lv是出于closed状态,lvm命令对其操作也是无效的。

 

 

For jfs2 , Check and recover file system
The fsck utility was enhanced to also handle JFS2-type file systems. This utility checks the file system for consistency and repairs problems found.

# fsck -V jfs2 /myfs
****************
The current volume is: /dev/lv01
File system is clean.

All observed inconsistencies have been repaired.
If the -V flag is not specified, fsck will figure out the JFS type by the VFS type specified for this file system and work in the assumed way:

# fsck /myfs
****************
The current volume is: /dev/lv01
File system is clean.
All observed inconsistencies have been repaired.


本文转自 Mr_sheng 51CTO博客,原文链接:http://blog.51cto.com/sf1314/2054667


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值