`
swvip
  • 浏览: 154526 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

重建loglv以及loglv的作用

    博客分类:
  • AIX
阅读更多
F50:[/]#lsvg -l vg00
vg00:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
ibmdata             jfs2       300   300   1    open/syncd    /data
loglv00             jfs2log    1     1     1    open/syncd    N/A
raw                 raw        2     2     1    closed/syncd  N/A
raw1                raw        3     3     1    closed/syncd  N/A
loglv处于open状态时,是不能rm的·
 
F50:[/]#umount /data 
F50:[/]#lsvg -l vg00
vg00:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
ibmdata             jfs2       300   300   1    closed/syncd  /data
loglv00             jfs2log    1     1     1    closed/syncd  N/A
raw                 raw        2     2     1    closed/syncd  N/A
raw1                raw        3     3     1    closed/syncd  N/A
 
F50:[/]#rmlv loglv00
Warning, all data contained on logical volume loglv00 will be destroyed.
rmlv: Do you wish to continue? y(es) n(o)? y
rmlv: Logical volume loglv00 is removed.
 
此时mount /data是不能成功的,所以必须重建一个loglv,除此之外,也可以通过修改/etc/filesystems 文件将指定的loglv指向另一个完好的loglv设备,以下是重建loglv的过程:
F50:[/]#mklv -y loglv00 -t jfslog datavg vg00 1
loglv00
F50:[/]#lspv -l hdisk1
hdisk1:
LV NAME               LPs   PPs   DISTRIBUTION          MOUNT POINT
loglv00               1     1     00..01..00..00..00    N/A
F50:[/]#logform /dev/loglv00
logform: destroy /dev/loglv00 (y)?
F50:[/]#mount /data
Replaying log for /dev/ibmdata.
mount: 0506-324 Cannot mount /dev/ibmdata on /data: The media is not formatted or the format is not correct.
F50:[/]#lsvg -l vg00
vg00:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
ibmdata             jfs2       300   300   1    closed/syncd  /data
loglv00             jfslog     1     1     1    closed/syncd  N/A
raw                 raw        2     2     1    closed/syncd  N/A
raw1                raw        3     3     1    closed/syncd  N/A
F50:[/]#rmlv loglv00
Warning, all data contained on logical volume loglv00 will be destroyed.
rmlv: Do you wish to continue? y(es) n(o)? y
rmlv: Logical volume loglv00 is removed.
F50:[/]#mklv -y loglv00 -t jfslog2 vg00 1
loglv00
F50:[/]#logform /dev/loglv00
logform: destroy /dev/loglv00 (y)?
F50:[/]#mount /data
Replaying log for /dev/ibmdata.
mount: 0506-324 Cannot mount /dev/ibmdata on /data: The media is not formatted or the format is not correct.
F50:[/]#lsvg -l vg00
vg00:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
ibmdata             jfs2       300   300   1    closed/syncd  /data
loglv00             jfslog2    1     1     1    closed/syncd  N/A
raw                 raw        2     2     1    closed/syncd  N/A
raw1                raw        3     3     1    closed/syncd  N/A
F50:[/]#mount /data
Replaying log for /dev/ibmdata.
mount: 0506-324 Cannot mount /dev/ibmdata on /data: The media is not formatted or the format is not correct.
F50:[/]#fsck /dev/ibmdata
The current volume is: /dev/ibmdata
Primary superblock is valid.
J2_LOGREDO:log redo processing for /dev/ibmdata                    
J2_LOGREDO:logredo: /dev/loglv00 is not a log file
j2_logredo.cpp: ERROR in openFilesystems line 1747, openLog
j2_logredo.cpp: ERROR in j2_logredo line 665, openFilesystems
Failure replaying log: -8
exec module "/sbin/helpers/jfs2/logredo" failed.
logredo failed (rc=248).  fsck continuing.
Primary superblock is valid.
*** Phase 1 - Initial inode scan
*** Phase 2 - Process remaining directories
*** Phase 3 - Process remaining files
*** Phase 4 - Check and repair inode allocation map
*** Phase 5 - Check and repair block allocation map
File system is clean.
F50:[/]#mount /data
Replaying log for /dev/ibmdata.
mount: 0506-324 Cannot mount /dev/ibmdata on /data: The media is not formatted or the format is not correct.
F50:[/]#rmlv loglv00
Warning, all data contained on logical volume loglv00 will be destroyed.
rmlv: Do you wish to continue? y(es) n(o)? y
rmlv: Logical volume loglv00 is removed.
F50:[/]#lspv
hdisk0          000af70dca7ae679                    vg00            active
hdisk1          000af70dca7aea4d                    vg00            active
hdisk2          000af70d4d50358c                    rootvg          active
F50:[/]#reducevg vg00 hdisk1
F50:[/]#mklv -y loglv00 -t jfs2log vg00 1
loglv00
F50:[/]#logform /dev/loglv00
logform: destroy /dev/rloglv00 (y)?
F50:[/]#mount /data
F50:[/]#lsvg -l vg00
vg00:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
ibmdata             jfs2       300   300   1    open/syncd    /data
loglv00             jfs2log    1     1     1    open/syncd    N/A
raw                 raw        2     2     1    closed/syncd  N/A
raw1                raw        3     3     1    closed/syncd  N/A
F50:[/]#cd /data
F50:[/data]#ls
ML          gcc         lost+found  lsof        snap.pax.Z
 
在以上过程中,发生了几个错误:
1,把jfs2log类型配成了jfslog,因为文件系统为jfs2,所以必须使用jfs2log
2,按照ibm建议,loglv最好不要和文件系统建在同一个pv上,但是以上把loglv建立在hdisk1上时,却始终不能mount文件系统,不知道是什么原因?
 
   AIX file systems by default are journaled, so every time a write operation is carried out, the system will first log all the changes that it is going to make in the log file,then it will carry out the update, and then it will compare the actual change to the logged
changes. If the two are consistent the operation is considered successful and the log entry can then be discarded. Note: ONLY inode changes are logged and not the changes for the data blocks. This is because it is far more important to be able to recover the structure of the file system, which is what the inodes will allow, rather than the individual data blocks.
   AIX memory maps files in current use. Any writes to files are done first in memory and at a later stage are written out to disk when the sync system call runs - every minute.
    由以上可知,当文件系统需要修改数据时,先将inode的变化记录在loglv中,待到内存中修改完数据 需要写回硬盘的时候,需要与loglv中inode变化 进行比较(同步),如果一致,即写回硬盘保存,如果不同,则不能写回。写回硬盘后,loglv中的该记录就可以丢弃。loglv可重用,即是循环使用。有点类似于非归档模式下oracle数据库redolog。
loglv只记录inode的变化,而不记录数据变化。
 
fsck的时候是否需要读取jfslog的内容呢?
需要··
分享到:
评论

相关推荐

    HACMP 5.x 完全手册-第2部分(配置)

    #### 二、rhosts文件的调整与作用 在HACMP 5.2版本中,出于安全性考虑,系统不再依赖传统的`.rhosts`文件来管理节点间的数据交换和命令执行。取而代之的是使用`/usr/es/sbin/cluster/etc/rhosts`这一路径下的文件来...

    AIX磁盘分区,兄弟们赶快看看

    在IT领域,特别是系统管理和服务器运维中,AIX(Advanced Interactive eXecutive)作为IBM的一个强大UNIX操作...此外,理解并应用AIX的磁盘管理机制对于优化系统性能、提高资源利用率以及应对突发故障具有重要意义。

    删除逻辑卷后如何恢复文件系统

    110-110 used outer middle loglv00 jfslog N/A 111-210 used outer middle lv00 jfs /oracle 211-217 used outer middle lv02 jfs /sun 218-310 used center lv02 jfs /sun 311-325 free center 326-433 free ...

    AIX平台存储迁移方案(mirrorvg)

    loglv00 jfs2 log 12 22 open/syncd N/A ``` - **确认同步完成**: 当所有逻辑卷的状态都变为`syncd`时,使用`lsvg -M newdatavg | grep -i stale | wc -l`检查是否存在未同步完成的逻辑卷。如果结果为0,则表示...

    (重要)AIX command 使用总结.txt

    AIX常用命令://查看机器序列号,IBM的基本信息都可以通过该命令查询得到 #prtconf #oslevel -r == uname -a //操作系统版本 #oslevel //查看操作系统版本ex :5.1.0.0 #oslevel -r //ex:5100-04 == oslevel -q ...

Global site tag (gtag.js) - Google Analytics