AIX磁盘更换

合集下载

AIX故障硬盘定位及换盘

AIX故障硬盘定位及换盘

rootvg中有两块盘,做了mirror现在用lsvg -l rootvg查看显示open/stale发现是hdisk0的状态是remove了,hdisk1是actvieerrpt中也显示是hdisk0有问题像问一下,我如何确定哪一块盘是hdisk0,到时候要更换还有就是做了mirror的vg,如何更换硬盘,谢谢!1.登陆AIX,执行#diag2.回车3.选择“Task Selection”4.按PgDn,选择“Hot Plug Task”5.选择“SCSI and SCSI RAID Hot Plug Manager”6.选择“Identify a Device Attached to a SCSI Hot Swap Enclosure Device”7.选择想判定位置的目标DISK,比如:hdisk08.回车,这个时候去观察硬盘,你会发现硬盘的指示灯会显示“红色”,这个硬盘就是你需要判定的目标盘。

9.如果想把这个有故障的硬盘从SCSI剔除,返回上一级菜单选择“Replace/Remove a Device Attached to an SCSI H ot Swap Enclosure Device”10, unmirrorrootvghdiskXreducevgrootvghdiskXrmdev -RdlhdiskX这时候open/stale 状态会变成open/sync换硬盘11,cfgmgr -v12, extendvgrootvg hdisk013,mirrorvg rootvg hdisk0 对于有逻辑卷的LV 拷贝空的LV 14,bosboot -ad /dev/hdisk0 刷新bootkernel15,bostboot -ad /dev/hdisk116,bootlist -m normal hdisk0 hdisk1 cd0这样换盘绝对不会出问题。

AIX下更换磁盘之更换坏盘

AIX下更换磁盘之更换坏盘

AIX下更换磁盘之更换坏盘选择性步骤此步骤为确保当前的hdisk0或hdisk1确为坏盘做准备,可不操作,操作只会增加安全性:1停应用2关机:#shutdown –F3停电拔出坏硬盘,看硬盘上信息FRU Number、Serial Number、Part Number是否对的起来,对应正确再一次确认了此盘是系统中对应的坏盘。

如果不是就记录下FRU Number、Serial Number、Part Number 信息,插上硬盘、开机用lscfg命令(例:lscfg -vl hdisk1)查看其它硬盘的信息。

再次确认出坏盘的正确hdisk号。

以下步骤在机器停止应用的情况下操作,应用包括:HACMP双机(smitty clstop),oracle等等。

1、坏盘为hdisk0,执行以下步骤:1)、破除镜像把HDISK0从ROOTVG中不做MIRROW:#unmirrorvg rootvg hdisk0查看物理卷#lspv这时HDISK0不在和HDISK1为MIRROR输入以下命令# lspv -l hdisk0Dumplv如果有显示上一行dumplv信息,按照以下操作:→如果现在hdisk0仍然处于激活状态,你可以简单地用“migratepv”命令把“dumplv”从hdisk0移到hdisk1:# migratepv -l dumplv hdisk0 hdisk1→如果现在hdisk0处于丢失状态或者已经坏掉,你将需要做如下操作:# lslv dumplv ---> 获得此逻辑卷的属性为你重建做准备LOGICAL VOLUME: dumplv ---VOLUME GROUP: rootvgLV IDENTIFIER: 00097c7f00004c00000000e9732a0422.16 PERMISSION: read/writeVG STATE: active/complete ---LV STATE: opened/syncdTYPE: sysdump ---WRITE VERIFY: offMAX LPs: 512 --- PP SIZE: 16 megabyte(s)COPIES: 1 -------SCHED POLICY: parallelLPs: 20 ---------PPs: 20STALE PPs: 0 --- BB POLICY: relocatableINTER-POLICY: minimum ---RELOCATABLE: yesINTRA-POLICY: middle --- UPPER BOUND: 32MOUNT POINT: N/A --------LABEL: NoneMIRROR WRITE CONSISTENCY: on/ACTIVEEACH LP COPY ON A SEPARATE PV ?: yes# sysdumpdev -Pp /dev/sysdumpnull# rmlv dumplv# mklv -t sysdump -y dumplv rootvg 20 hdisk1# sysdumpdev -Pp /dev/dumplv2)、逻辑去除磁盘把hdisk0从rootvg中去除#reducevg rootvg hdisk0在hdisk1上创建boot image#bosboot –ad /dev/hdisk1改变启动设备的顺序#bootlist –m normal hdisk1 cd0删除HDISK0#rmdev –dl hdisk0#lspv#lscfg –vl hdisk0以上2条命令不会显示hdisk0的相关信息,表示已删除hdisk03)、移出热插拔磁盘1. 当前系统登录用户身份应是root,如果不是以root用户身份登录进入系统;2. 在命令行输入“ smit”;3. 选择 System Storage Management (Physical and Logical Storage);4. 选择 Removable Disk Management;5. 选择 Remove a Disk;6. 从屏幕列示中选择要移出的硬盘hdisk0然后按下回车键;7. 按照屏幕上的指导来移出硬盘;8. 当你被询问“Are you sure?”, 按下回车键. 你选择的硬盘的电源显示灯将保持亮的状态;9. 物理上移出硬盘;10. 按下 F10退出smit菜单.4)、加回热插拔磁盘1. 物理安装新硬盘到硬盘槽里;2. 当前系统登录用户身份应是root,如果不是以root用户身份登录进入系统;3. 在命令行输入“ smit”;4. 选择 Devices.5. 选择 Install/Configure Devices Added After IPL 并且按下回车键.5)、重新镜像rootvg卷组下面的步骤认为用户有一个包含hdisk1的rootvg卷组并且准备镜像rootvg到一个新磁盘:hdisk0.1.把hdisk0加进rootvg卷组:#extendvg rootvg hdisk02.关掉rootvg的 QUORUM功能:#chvg -Qn rootvg3.镜像rootvg#mirrorvg -c 2 rootvg hdisk04.重新生成 boot image#bosboot -ad /dev/hdisk05.更新bootlist#bootlist -m normal hdisk0 hdisk1 cd06.重起系统#shutdown -Fr系统正常运行,完毕。

aix更换硬盘步骤

aix更换硬盘步骤

aix更换硬盘步骤硬盘更换5种情况一.如果disk mirrored,步骤如下:1.删除该磁盘上所以逻辑卷的复件unmirrorvg lv_xx 1 hdiskX 或者rmlvcopy lv_xx 1 hdiskX2.从卷组中删除该磁盘reducevg vg_name hdiskX3.删除该磁盘在ODM中的定义rmdev -dl hdiskX*4.连接新硬盘到系统如果是非热插拔需重启reboot5.添加新硬盘到卷阻extendvg vg_name hdiskY6.创建新的拷贝如果是rootvg:chvg -Qn rootvg(如果是单镜像)mirrorvg -s rootvg 或者mklvcopy(mirrorvg) lv_xx 2 hdiskY syncvg(varyonvg) -v rootvgbosboot -abootlist -m normal hdiskX hdiskYbootinfo -b二.如果磁盘没有镜像但在线状态1.连接新的硬盘到系统2.添加新硬盘到卷组中extendvg vg_name hdiskY3.移动数据到新的硬盘migratepv hdiskX hdiskY如果是rootvg:磁盘中有hd5migratepv -l hd5 hdiskX hdiskYbosboot -ad /dev/hdiskYchpv -c hdiskYbootlist -m normal hdiskX hdiskYmigratepv hdiskX hdiskYsysdumpdev -P /dev/hdX(如果是活动状态)4.从卷组中删除硬盘reducevg vg_name hdiskX5.删除该磁盘在ODM中的定义rmdev -dl hdiskX三.如果没有镜像磁盘彻底损坏,能够varyon状态下(卷组中有可用的磁盘)1.检查所有lv和文件系统在磁盘上的状态lspv -l hdsikY2.移除所有在坏盘上的文件系统的挂载umount /dev/lv_xx3.移除所有在坏盘上的lv和文件系统smit rmfs 或者 rmlv lv_xx4.从卷组中删除硬盘reducevg vg_name hdiskX5.删除该磁盘在ODM中的定义rmdev -dl hdiskY6.添加新硬盘到卷组中extendvg vg_name hdiskZ7.重新创建所以lv和文件系统在新的磁盘上smit crfs 或者 mklv -y lv_xx8.如果有数据的备份,从备份中恢复数据restore -rvqf /dev/rmt0四.如果没有镜像磁盘彻底损坏,不能够varyon状态下(卷组中没有可用的磁盘)如果是rootvg:1. 替换故障磁盘。

AIX rootvg换故障盘reducevg报错的解决办法

AIX rootvg换故障盘reducevg报错的解决办法

AIX rootvg换盘时reducevg报错的处理办法神州数码--沈飞龙2017-8 作为AIX系统管理员,rootvg的磁盘坏了一个,需要换盘,这是大家经常遇到的事情。

正常情况下,unmirrorvgreducevg换盘extendvgmirrorvg这些都不会遇到什么问题。

但总是有特殊情况,就是我在unmirrorvg成功之后,reducevg总是报错,需要unmount rootvg上的文件系统,生产环境,哪能说停就停呢?1 lsvg–p rootvg检查成员磁盘,确定哪个是救命稻草,哪个盘是坏了的。

从上图中看出,hdisk114磁盘损坏,需要更换。

按照正常步骤,1 unmirrorvgrootvg hdisk114;2 reducevg–d rootvg hdisk114;rmdev–dl hdisk114 –R ;4 hot plug;5 extendvgrootvghdiskXXX(新盘号);6 mirrorvgrootvg;7 bosboot–ad hdiskXXX (新盘号);8 bootlist–M normal –o 检查和设置启动盘。

但是,一切都那么顺利,我就不需要写这个文章了,在第2部,reducevg的时候,先是lg-dumplv 占用,解决以后,有要下umount /oracle 等其他好多个文件系统,我就意识到,这是一个非正常的系统,又是数据库,哪能随便停了让我换系统盘呢,想想办法吧。

首先,你得知道目前系统有点问题,所以操作要小心。

经过尝试多次失败,reducevg报错,于是,reducevg的运行思路,将此任务拆解,使用smit lv 来一个一个的lv进行拆除镜像Step 1Step 2Step 3Step 4 按F4 ,选择rootvg的一个lv注意:原来是镜像,所以是2,现在要拆除,要将2改为1,在PHYSICAL VOLUME names 要选择故障磁盘,如我们这个例子的hdisk114 ,回车,结果OK,那就是成功啦。

[案例] AIX更换故障磁盘12-11

[案例] AIX更换故障磁盘12-11

[案例] AIX更换故障磁盘12-11AIX 更换故障磁盘一、确认卷组中有哪些磁盘,是否做有镜像[root@L2AFC-LC02:/]# lsvg -p datavgdatavg:PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION hdisk2 missing 528 127 105..00..00..00..22hdisk0 active 528 127 105..00..00..00..22[root@L2AFC-LC02:/]# lsvg -l datavgdatavg:LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINTdatalv jfs2 400 800 2 open/syncd /data1loglv00 jfs2log 1 2 2 open/stale N/A1.取消磁盘镜像[root@L2AFC-LC02:/]# unmirrorvg -c 1 datavg hdisk21.从datavg中去除损坏hdisk2[root@L2AFC-LC02:/]# reducevg datavg hdisk21.删除坏盘的raid信息2.smitty dev3.选择Disk Array4.选择Ibm SAS Disk Array5.选择Ibm SAS Disk Array Manager6.选择List SAS Disk Array Configuration7.选择对应的sissas卡,查看坏盘所在的RAID8.选择Delete a SAS Disk Array,删除刚才查到的sissas19.选择Change/Show SAS Disk Array10.选择Change/Show SAS pdisk11.选择pdisk2进行删除12.选择List SAS Disk Array Configuration 确认删除成功1.从系统中去掉坏盘[root@L2AFC-LC02:/]# rmdev -dl hdisk2[root@L2AFC-LC02:/]# rmdev -Rdl pdisk21.拔掉坏盘更换新盘2.重新搜索新盘驱动[root@L2AFC-LC02:/]# cfgmgr -v[root@L2AFC-LC02:/]# lsdev -Cc disk[root@L2AFC-LC02:/]# chdev -l hdisk2 -a pv=yes[root@L2AFC-LC02:/]# lspvhdisk0 00f9cda18c5158c7 datavg activehdisk1 00f9cda18c5197ea rootvg activehdisk2 00f9cda18c519ebf none nonehdisk3 00f9cd9e8c16fd13 rootvg activehdisk4 00f9cda13f7e088f caavg_private activehdisk5 00f9cda140dd5ed6 oravg concurrent1.为hdisk1 和新盘hdisk2重新配置RAID02.smitty dev3.选择Disk Array4.选择Ibm SAS Disk Array5.选择Ibm SAS Disk Array Manager6.选择Create an Array Candidate pdisk and Format to RAID block size,选择sissas17.选择所要创建的RAID组的形式:0,大小512KB,选择要加入的pdisk,把pdisk加入RAID组8.选择Create a SAS Disk Array,选择sissas1,创建RAID9.lspv确认1.将hdisk2重新加入datavg中[root@L2AFC-LC02:/]# extendvg datavg hdisk21.为datavg重新做镜像[root@L2AFC-LC02:/]# mirrorvg -c 2 datavg hdisk0 hdisk2[root@L2AFC-LC02:/]# lsvg -l datavgdatavg:LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINTdatalv jfs2 400 800 2 open/syncd /data1loglv00 jfs2log 1 2 2 open/stale N/A1.确认作业结果[root@L2AFC-LC02:/]# lsvg -p datavg [root@L2AFC-LC02:/]# lsvg -l datavg。

AIX5.3的磁盘镜像、更换操作汇总

AIX5.3的磁盘镜像、更换操作汇总

AIX5.3的磁盘镜像、更换操作汇总1.如何在AIX里面用命令显示AIX是从那块物理硬盘启动的?显示设置的启动顺序,究竟是从哪块盘启#lslv -m hd5#bootinfo -b如果你只是想看mirror是否成功,那就用lslv -m hd5如果是想看当前是使用哪块盘引导启动的,那就用bootinfo -b2.做MIRROR时出错解决方法?# extendvg rootvg hdisk10516-1398 extendvg: The physical volume hdisk1, appears to belong toanother volume group. Use the force option to add this physical volumeto a volume group.-792 extendvg: Unable to extend volume group.解决:因为此hdisk1之前曾经被其它的VG(ROOTVG)使用过,所以你可以用加参数-f 或用smitty 强力创建。

#extendvg -f rootvg hdisk13.创建镜像#mirrorvg rootvg hdisk1 (默认创建2份镜像)#mirrorvg -c 3 rootvg hdisk1 (创建3份镜像)注意必须做镜像同步:Step 1: 重新创建两块硬盘的启动映象,执行下面的命令完成:#bosboot -ad hdisk1Step 2: 修改启动列表,按照下面的方法完成:#bootlist -m normal hdisk0 hdisk1 cd0Step 3: 查看启动列表是否修改成功,参照下面方法及输出:#bootlist -m normal -ohdisk0 blv=hd5hdisk1 blv=hd5cd0同步后在创建LV和文件系统的同步命令:#mirrorvg -S -c 2 rootvg说明:c参数:指出mirrorvg后每个LV必须有的副本数。

AIX 更换磁盘阵列

AIX 更换磁盘阵列

何看机器内的卡及硬盘的微码级别(microcode level)用下面命令可以得到一个SSA卡的微码级别:# lscfg -vl ssa0其中 ssa0 是此SSA卡的设备名称.输出结果中的ROS level及ID 即是微码级别(microcode level).用下面命令可以得到一个硬盘的微码级别:lscfg -vl pdiskX在RS6000系统上安装RAID适配器时,一般通过重新启动系统,AIX操作系统可以自动认到该适配器。

但是在某些情况下,系统会停留在启动RAID适配器的位置,LED面板显示:“0751-P1-I1/Q1”;若运行cfgmgr命令,报0514-407错误。

解答这时有一种可能是该RAID适配器微码版本过低,需要从IBM 网站下载最新的微码。

如何确定该RAID适配器的微码版本是否过低呢?下面以7044-270机器上的2498 PCI 4通道Ultra3 SCSI RAID适配器为例,使用下面的命令可以读到存储在适配器中的微码版本。

1)列出系统中安装的PCI RAID适配器:lsdev -C | grep scraid注意:设备名是所有已安装的PCI 4通道Ultra3 SCSI RAID适配器的名称。

适配器设备名将是scraidX, X为0,1 或其他的数字。

2)检查当前适配器的微码版本:lscfg -vl scraidX(X为系统已安装的适配器的号码。

)命令显示如下:DEVICE LOCATION DESCRIPTIONScraid0 20-58 PCI 4-Channel Ultra3 SCSI RAID AdapterPart Number.................09P1521EC Level....................0H10522Serial Number (00000001)FRU Number..................37L6892 Manufacturer................IBM000Displayable Message.........UL3RAIDDiagnostic Level (03)Device Driver Level (03)Loadable Microcode Level....4.20.01ROS Level and ID............4.00.26Device Specific.(YL)........P2-I9如果FRU Number是37L6892并且当前适配器微码版本(Loadable Microcode Level)是4.20.01,不同与适配器微码最新版本4.70.11,则需要升级微码。

AIX上移除和替换硬盘的标准步骤

AIX上移除和替换硬盘的标准步骤

This document describes the procedures to remove and replace a fixed disk in a volume group. These procedures DO NOT apply in the following environments:1.The disk is in a shared volume group. This would apply toenvironments that use HACMP, RVSD, or any other managementsoftware. Refer to the documentation for that product for correct disk replacement procedures. The SSA User's Guide explains the procedures for changing disks in a RAID or hot swap environment.It is available for download at:/support/docview.wss?rs=505&uid=ssg1S10023482.The disk is in rootvg and the disk contains any one of the followinglogical volumes, which are not mirrored:hd2, hd3, hd4, hd6, hd9var, hd8In this case, you would need to replace the disk and restore froma system backup specifying the correct disks to restore.3.The system is a /usr, dataless, or diskless client.This document applies to AIX Versions 4.3.3 and 5L.Please read the entire document before proceeding and ensure all relevant fixes mentioned in this document or otherwise are installed prior to using these procedures.Removing a physical volume from a volume groupThe basic steps to replacing a disk drive are as follows:1.Deallocate all the physical partitions associated with thephysical volume in the associated volume group.2.Remove the physical volume from the volume group.3.Remove the definition for the disk from the device configurationdatabase.These steps are outlined in more detail in subsequent sections.If there is just one disk in the volume group, proceed to the next section, "How to proceed if the volume group has just one disk." Otherwise, proceed to the section entitled "Deallocating physical partitions from the disk."How to proceed if the volume group has just one diskIf the drive to be replaced is the only drive in the volume group, then remove the volume group definition with:exportvg <VGname>At this point, remove the disk definition using the rmdev command. Details are included in the section "Removing the disk definition from the system" in this document.Checking to see what quorum is set toIf your volume group is mirrored, you could have disabled quorum. The purpose of quorum is explained in the IBM Redbook: LVM: Introduction and Concepts. Here is an excerpt:A quorum is a vote of the number of Volume Group Descriptor Areas and Volume Group Status Areas (VGDA/VGSA) that are active. A quorum ensures data integrity in the event of a disk failure. Each physical disk in a volume group has at least one VGDA/VGSA. When a volume group is created onto a single disk, it initially has two VGDA/VGSA areas residing on the disk. If a volume group consists of two disks, one disk still has two VGDA/VGSA areas, but the other disk has one VGDA/VGSA. When the volume group is made up of three or more disks, then each disk is allocated one VGDA/VGSA.A quorum is lost when enough disks and their VGDA/VGSA areas are unreachable so that a 51% majority of VGDA/VGSA areas no longer exists. In a two-disk volume group, if the disk with only one VGDA/VGSA is lost, a quorum still exists because two of the three VGDA/VGSA areas still are reachable. If the disk with two VGDA/VGSA areas is lost, this statement is no longer true. The more disks that make up a volume group, the lower the chances of quorum being lost when one disk fails.lsvg testvg --> check to see if Quorum is set to 1VOLUME GROUP: testvg VG IDENTIFIER:00097c7f00004c00000000f4a163bc7bVG STATE: active PP SIZE: 16 megabyte(s)VG PERMISSION: read/write TOTAL PPs: 1084 (17344 megabytes)MAX LVs: 256 FREE PPs: 998 (15968 megabytes)LVs: 12 USED PPs: 86 (1376 megabytes)OPEN LVs: 9 QUORUM: 1TOTAL PVs: 2 VG DESCRIPTORS: 3STALE PVs: 1 STALE PPs: 1ACTIVE PVs: 2 AUTO ON: yesMAX PPs per PV: 2032 MAX PVs: 16If replacing the disk drive immediately, then you may not have to turn quorum back on. The mirrorvg command automatically turns quorum off and the unmirrorvg command automatically turns quorum on. If you are dealing with rootvg, the only way to have a change in quorum take effect, is to reboot. If this is a non-rootvg volume group, quorum can be changed by varyingoff the volume group and then varying it back on. To change quorum from the command line, run the following:chvg -Q n vgname --> turns quorum offchvg -Q y vgname --> turns quorum onIn order to varyoff a volume group, unmount all filesystems and make sure all logical volumes are in a closed state. Enter:lsvg -l testvgLV NAME TYPE LPs PPs PVs LV STATE MOUNT POINTtestlv jfs2 1 1 1 closed/sync'd /testfsloglv00 jfs2log 1 1 1 closed/sync'd N/AOnce all the logical volumes are closed, run the following:varyoffvg vgnamevaryonvg vgnameThe new quorum change will be in effect.Deallocating physical partitions from the diskEvery physical partition (PP) on the disk allocated to any logical volume (LV), including file systems or paging spaces, must be deallocated, either by moving the contents of those PPs to another disk or by removing them.To determine what logical volumes have PPs allocated to that disk, run: lspv -l <hdisk#>If the hdisk name no longer exists, and the disk is identifiable only by its 16-digit PVID (you might see this from the output of lsvg -p <VGname>), substitute the PVID for the disk name. For example:lspv -l 0123456789abcdefYou may receive the following error:0516-320 : Physical volume 00001165a97b10c6 is not assigned toa volume group.If so, run the following command:putlvodm -p `getlvodm -v <VGname>` <PVID>VGname refers to your volume group, PVID refers to the 16-digit physical volume identifier, and the characters around the getlvodm command are grave marks, the backward single quote mark. The lspv -l <PVID>command should now run successfully.If another disk in the volume group has space to contain the partitions on this disk, and the disk to be replaced has not failed, the migratepv command may be used to move the used PPs on this disk. See the man page for the migratepv command on the steps to do this.If the partitions cannot be migrated, they must be removed. The output of the lspv -l <hdisk#>, or lspv -l <PVID>, command indicates what logical volumes will be affected. Run the following command on each LV: lslv <LVname>The COPIES field shows if the LV is mirrored. If so, remove the failed copy with:rmlvcopy <LVname> 1 <hdisk#>hdisk#refers to all the disks in the copy that contain the failed disk.A list of drives can be specified with a space between each. Use the lslv -m <LVname> command to see what other disks may need to be listed in the rmlvcopy command. If the disk PVID was previously used with the lspv command, specify that PVID in the list of disks given to the rmlvcopy command. At AIX Version 4.2.1 or higher, the unmirrorvg command may be used in lieu of the rmlvcopy command. See the man pages for rmlvcopy and unmirrorvg, or other documentation, for additional information.If the LV is not mirrored, the entire logical volume must be removed, even if just one physical partition resides on the drive to be replaced and cannot be migrated to another disk. If the unmirrored LV is a JFS file system, unmount the file system and remove it. Enter:umount /<fsname>rmfs /<fsname>If the unmirrored logical volume is a paging space, see if it is active. Enter:lsps -aIf it is active, set it to be inactive on the next reboot. Enter:chps -a n <LVname>After you reboot, remove it by entering:rmps <LVname>Remove any other unmirrored logical volume with the following command: rmlv <LVname>NOTE:If the LV is serving as a dump device, the dump pointer must first be reassigned. The same is true if the LV was mirrored and the copy is being removed. Check the dump pointers by entering:sysdumpdev -lReassign the dump pointers. Enter:sysdumpdev -Pp /dev/sysdumpnull (for the primary device)sysdumpdev -Ps /dev/sysdumpnull (for the secondary device)The pointers can be reassigned to the appropriate logical volume after it is recreated.Deleting the disk from the volume groupUsing either the PVID or the hdisk name, depending on which was used when running lspv -l <hdisk#> in the preceding discussion, run one of the following:reducevg -f <VGname> <hdisk#>reducevg -f <VGname> <PVID>If you used the PVID value and if the reducevg command complains that the PVID is not in the device configuration database, run the following command to see if the disk was indeed successfullyremoved:lsvg -p <VGname>If the PVID or disk is not listed at this point, then ignore the errors from the reducevg command.Removing the disk definition from the systemRemove the hdisk. Enter:rmdev -dl <hdisk#>If the disk was an SSA disk, delete the pdisk. Enter:rmdev -dl <pdisk#>If the disk was an SSA disk, determine which pdisk numbercorresponds to the hdisk. The easiest way to do this is by using the ssaxlate commands. Enter the following:ssaxlate -l hdisk# --> shows the pdisk#(s) definitionssaxlate -l pdisk# --> shows the hdisk# definitionAnother way to do this is with the following commands:lsdev -Cc disk -F name' 'connwherelsdev -Cc pdisk -F name' 'connwhereSee which SSA disk serial number coincides with the hdisk to remove.If the hdisk does not appear, or if the user has been working witha PVID value up to this point, the pdisk whose serial number doesnot coincide with any of the hdisks is likely to be the disk to remove. Other SSA commands might provide additional information.Consult the SSA documentation.If you have been working with a PVID value rather than with an hdisk name, ensure that the PVID is removed from the ODM with thefollowing command. The 32-digit value supplied consists of the PVID plus 16 zeros. For example:odmdelete -q value=0073659c2c6d26f10000000000000000 -o CuAtTo physically remove the hard disk, consult the documentation for that device, or the hardware service organization for the vendor.Adding a new drive to an existing volume groupOnce the new drive has been configured, ensure that a proper PVID has been written to the drive by running:chdev -l <hdisk#> -a pv=clearchdev -l<hdisk#> -a pv=yesNOTE: On SSA drives, the first chdev command may be omitted.Add the drive to the volume group with:extendvg VGname hdisk#You can also use the mkvg command to create a new volume group on the new drive.New logical volumes, paging spaces, file systems, or logicalvolume copies can be re-added with the mklv, mkps, crfs, mklvcopy, or mirrorvg commands, respectively, or by using SMIT.Recommended fixesNOTE:In AIX Versions 4 and 5, use the command instfix -ik <APAR> to determine if a particular fix is installed.There are numerous fixes corresponding to mirroring, pvids, and synching of volume groups in AIX. It is recommended that the customer be at the latest maintenance level (ML) for their different environments. The latest fixes/ML's can be downloaded from "Quick links to AIX fixes"(/servers/eserver/support/unixservers/aixfix es.html).In addition, the filesets that correspond to mirroring and synchronizations of disk drives are bos.rte.lvm and bos.rte.filesystem.。

AIX 更换根卷盘

AIX 更换根卷盘

已确认是HDISK0坏,去之后先做三件事情1、在主机上执行bosboot –ad /dev/hdisk12、在主机上执行bootlist –m normal hdisk1 (使用bootlist –m normal –o 来显示是否在PV中存在启动逻辑卷)。

3、确认/backup文件系统的重要性,如果重要先将数据备份出来4、问客户以前有无备份带,如无通过磁带备份操作系统.smit mksysb ,他们直接连接了一个HP的磁带库,看有没有空闲带子,如没有就先不备了。

5、对/backup对应的lv做mirror 命令如下mklvcopy fslv03 2 hdisk1syncvg –l fslv03 &执行topas命令确认是否HDISK0 和HDISK1在同步当同步结束后,执行lsvg –l rootvg查看其中LV 状态是否为open/syncd 6、执行lsvg –l rootvg确认LPs 列:PPs列是否为1:2,举例如下V NAME TYPE LPs PPs PVs LV STATE MOUNT POINThd5 boot 1 2 2 closed/syncd N/Ahd6 paging 4 8 2 open/syncd N/Ahd8 jfs2log 1 2 2 open/syncd N/Ahd4 jfs2 1 2 2 open/syncd /hd2 jfs2 15 30 2 open/syncd /usrhd9var jfs2 3 6 2 open/syncd /varhd3 jfs2 25 50 2 open/syncd /tmphd1 jfs2 1 2 2 open/syncd /homehd10opt jfs2 3 6 2 open/syncd /optlg_dumplv sysdump 8 16 2 open/syncd N/A #7、执行unmirrorvg动作,1)rmlvcopy fslv03 1 hdisk02)rmlvcopy fslv02 1 hdisk03)unmirrorvg rootvg hdisk04)lsvg –l rootvg5)reducevg rootvg hdisk06)rmdev –dl hdisk07)插入新盘到空闲槽位8)执行cfgmgr9)lsdev –c disk 确认识别出新盘10)执行lspv11)extendvg rootvg hdisk012)mirrorvg '-S' rootvg &13)等待同步结束14)bosboot –ad /dev/hdisk015)bootlist –m normal hdisk1 hdisk016)bootlist –m hdisk1 hdisk0 –o17)确认故障盘物理位置,拔出。

aix更换mirror硬盘hdisk0

aix更换mirror硬盘hdisk0

AIX根盘镜像更换hdisk(dump device问题)AIX如果paging swap和dump device不同,系统不会mirror dump device(The system dump devices ”primary /dev/hd6 and secondary /dev/sysdumpnull" should not be mirrored.),下面是系统正常情况下的dump device的信息:# lsvg —l rootvgrootvg:LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINThd5 boot 1 2 2 closed/syncd N/Ahd6 paging 244 488 2 open/syncd N/Ahd8 jfs2log 1 2 2 open/syncd N/Ahd4 jfs2 8 16 2 open/syncd /hd2 jfs2 40 80 2 open/syncd /usrhd9var jfs2 40 80 2 open/syncd /varhd3 jfs2 16 32 2 open/syncd /tmphd1 jfs2 40 80 2 open/syncd /homehd10opt jfs2 80 160 2 open/syncd /optlg_dumplv sysdump 16 16 1 open/syncd N/A# sysdumpdev —lprimary /dev/lg_dumplvsecondary /dev/sysdumpnullcopy directory /var/adm/rasforced copy flag TRUEalways allow dump FALSEdump compression ON# lslv -l lg_dumplvlg_dumplv:N/APV COPIES IN BAND DISTRIBUTIONhdisk0 016:000:000 0% 000:000:000:000:016目前dump device只有一个,在hdisk0上,如果hdisk0出现故障,系统可以从hdisk1启动,系统运行也不会有问题,只是没有dump device,所以如果需要更换hdisk0,需要特别注意一些别的问题,具体步骤:1 unmirror rootvgsmitty unmirrorvg或者unmirrorvg rootvg hdisk02 查看unmirror后vg的状态# lsvg —l rootvgrootvg:LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINThd5 boot 1 1 1 closed/syncd N/Ahd6 paging 244 244 1 open/syncd N/Ahd8 jfs2log 1 1 1 open/syncd N/Ahd4 jfs2 8 8 1 open/syncd /hd2 jfs2 40 40 1 open/syncd /usrhd9var jfs2 40 40 1 open/syncd /varhd3 jfs2 16 16 1 open/syncd /tmphd1 jfs2 40 40 1 open/syncd /homehd10opt jfs2 80 80 1 open/syncd /optlg_dumplv sysdump 16 16 1 closed/syncd N/A3 Reduce VGsmitty reducevg或者reducevg rootvg hdisk0将会报错:rmlv: Warning, all data belonging to logical volume lg_dumplv on physical volume hdisk0 will be destroyed.rmlv: Do you wish to continue? y(es) n(o)? 0516-016 ldeletepv: Cannot delete physical volume with allocated partitions. Use either migratepv to move the partitions or reducevg with the —d option to delete the partitions.0516-884 reducevg: Unable to remove physical volume hdisk0.解决方法:3。

aix下磁盘的有关操作

aix下磁盘的有关操作

aix disk manage先用cfgmgr –v找到新加的硬盘。

一:1.将一块新盘添加到rootvg当中#smit extendvgForce the creation of a volume group? no* VOLUME GROUP name [rootvg]* PHYSICAL VOLUME names [hdisk1]#lspvhdisk0 000cf05c5941a1f6 rootvg activehdisk1 000cf05ca13d72ec rootvg active#lsvg rootvgVOLUME GROUP: rootvg VG IDENTIFIER: 000cf05c00004c000000011bc16b24daVG STATE: active PP SIZE: 32 megabyte(s)VG PERMISSION: read/write TOTAL PPs: 1088 (34816 megabytes) MAX LVs: 256 FREE PPs: 946 (30272 megabytes) LVs: 10 USED PPs: 142 (4544 megabytes)ACTIVE PVs: 2 AUTO ON: yes......................... 注意TOTAL PPs、ACTIVE PVs项2.在该新添加盘当中分出一个LV,并将其挂载到系统当中,确认其可用性#smit mklvLogical volume NAME [ora_data]* VOLUME GROUP name rootvg* Number of LOGICAL PARTITIONS [30]PHYSICAL VOLUME names [hdisk1]Logical volume TYPE [jfs2].................................. 注意MAXIMUM NUMBER of LOGICAL PARTITIONS项的值#lsvg -l rootvg.....................................loglv01 jfs2log 1 1 1 open/syncd N/Aora_data jfs2 30 30 1 closed/syncd N/A#lslv ora_dataLOGICAL VOLUME: ora_data VOLUME GROUP: rootvgLV IDENTIFIER: 000cf05c00004c000000011bc16b24da.11 PERMISSION: read/writeVG STATE: active/complete LV STATE: closed/syncdTYPE: jfs2 WRITE VERIFY: offMAX LPs: 512 PP SIZE: 32 megabyte(s).....................................#smit crfsAdd an Enhanced Journaled File System->Add an Enhanced Journaled File System on a Previously Defined Logical Volume->* LOGICAL VOLUME name ora_data* MOUNT POINT [/ora_data].................................#mount /ora_data#df -g3.扩大该LV的空间、镜像该LV,并更改其所在文件系统大小#lslv ora_data...............................MAX LPs: 512 PP SIZE: 32 megabyte(s)COPIES: 1 SCHED POLICY: parallelLPs: 30 PPs: 30.......................................#smit extendlv* LOGICAL VOLUME name ora_data* Number of ADDITIONAL logical partitions [+10]PHYSICAL VOLUME names [hdisk1]...................................#lslv ora_dataMAX LPs: 512 PP SIZE: 32 megabyte(s)COPIES: 1 SCHED POLICY: parallelLPs: 40 PPs: 40....................................#smit mklvcopy* LOGICAL VOLUME name ora_data* NEW TOTAL number of logical partition copies 2 PHYSICAL VOLUME names [hdisk0]......................................#lslv ora_dataMAX LPs: 512 PP SIZE: 32 megabyte(s)COPIES: 2 SCHED POLICY: parallelLPs: 40 PPs: 80........................................#df -g /dev/ora_data/dev/ora_data 1.44 1.44 1% 4 1% /ora_data #smit chfsChange / Show Characteristics of an Enhanced Journaled File System-> File system name /ora_dataNEW mount point [/ora_data]SIZE of file systemUnit Size 512bytesNumber of units [5966080]........................................#df -g /dev/ora_data/dev/ora_data 2.41 2.41 1% 4 1% /ora_data 4.删除镜像、卸载该LV并将其从硬盘中删除#smit rmlvcopy* LOGICAL VOLUME name ora_data* NEW maximum number of logical partition copies 1...........................................#lslv ora_dataMAX LPs: 512 PP SIZE: 32 megabyte(s)COPIES: 1 SCHED POLICY: parallel LPs: 77 PPs: 77....................................#umount /ora_data#smit rmlvLOGICAL VOLUME name [ora_data]#lsvg -l rootvgloglv01 jfs2log 1 1 1 open/syncd N/A..........................................5.从rootvg中移除该磁盘#smit reducevgRemove a Physical Volume from a Volume Group->* VOLUME GROUP name rootvg* PHYSICAL VOLUME names [hdisk1]....................................#lspvhdisk0 000cf05c5941a1f6 rootvg active hdisk1 000cf05ca13d72ec None 二:1.将一块新磁盘添加到系统中并新建为一个独立VG#smit mkvgAdd an Original Volume Group->VOLUME GROUP name [datavg]Physical partition SIZE in megabytes 8* PHYSICAL VOLUME names [hdisk1]..................................#lspvhdisk0 000cf05c5941a1f6 rootvg active hdisk1 000cf05ca13d72ec datavg active 2.在该磁盘中分出两个LV,并将其挂载到系统当中,确认其可用性#smit mklv 注意MAXIMUM NUMBER of LOGICAL PARTITIONS项的值#lsvg -l datavgLV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT dream jfs2 300 300 1 closed/syncd N/Aibm jfs2 500 500 1 closed/syncd N/A#smit crfs#lsvg -l datavgLV NAME TYPE LPs PPs PVs LV STATE MOUNT POINTdream jfs2 300 300 1 closed/syncd /dreamibm jfs2 500 500 1 closed/syncd /ibm#mount /ibm#mount /dream#df -g/dev/ibm 3.91 3.91 1% 4 1% /ibm/dev/dream 2.34 2.34 1% 4 1% /dream3.扩大、镜像LV,并更改其所在文件系统大小#smit extendlv* LOGICAL VOLUME name dream* Number of ADDITIONAL logical partitions [+300]PHYSICAL VOLUME names [hdisk1]POSITION on physical volume middleRANGE of physical volumes minimumMAXIMUM NUMBER of PHYSICAL VOLUMES [10]to use for allocationAllocate each logical partition copy no注意Allocate each logical partition copy项,选no#lsvg -l datavgLV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT dream jfs2 400 400 1 open/syncd /dreamibm jfs2 800 800 1 open/syncd /ibm#smit mklvcopy#lslv ibm #lslv dream#df -g/dev/dream 2.34 2.34 1% 4 1% /dream/dev/ibm 3.91 3.91 1% 4 1% /ibm#smit crfs#df -g/dev/dream 1.39 1.39 1% 4 1% /dream/dev/ibm 4.39 4.39 1% 4 1% /ibm4.删除镜像、卸载并删除两个LV#smit rmlvcopy#lslv dream #lslv ibm#umount /ibm #umount /dream#smit rmlv 注意在删除LV之前,请确认文件系统已从系统中卸载 5.从系统中删除VG,使其成为一个全新的磁盘#smit reducevg#lspvhdisk0 000cf05c5941a1f6 rootvg active hdisk1 000cf05ca13d72ec None 三:1.将新磁盘添加到系统当中,并确认其处于可用状态#chdev -l hdisk1 -a pv=yes2.用新添加的PV mirror rootvg#smit extendvg#smit mirrorvgVOLUME GROUP name rootvgMirror sync mode [Foreground]PHYSICAL VOLUME names [hdisk1]Number of COPIES of each logical partition 23.删除rootvg mirror,退出rootvg#smit unmirrorvg#smit reducevg四:1.换页空间基本操作#lsps -ahd6 hdisk0 rootvg 512MB 1 yes yes lv #smit pgsp#swapon /dev/paging00注意在删除换页空间前必须使其处于非激活状态#swapoff /dev/paging00五:在AIX5.3系统里输入smit mkvg,出现以下三个选项:Add an Original V olume GroupAdd a Big V olume GroupAdd a Scalable V olume Group1、添加一个普通的VG2、创建一个Big类型的VG. 该类型VG最大可含128个PV,512个LV。

aix使用migratepv换盘

aix使用migratepv换盘

Aix下使用migratepv换硬盘(v 100706)版本说明目录版本说明 (2)1适用环境及问题描述 (4)2收集相关信息 (4)3处理过程 (4)1适用环境及问题描述己作mirror的vg,在当前操作的小机上有多余的硬盘槽位2收集相关信息用root用户登入操作系统1.[root:/]errptIDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION49A83216 0111232508 T H hdisk0 DISK OPERATION ERROR2.errpt -aj 49A832163.snap -ac4.lsvg -o|lsvg -li5.lsvg -o|lsvg -pi6.lsvg -l rootvg7.bootlist -m normal -o3 处理过程1.errpt -a查看有关hdisk0故障的详细报告;2.现场观察hdisk0状态灯为不正常状态;3.lspv hdisk0查看hdisk0磁盘的从属关系:[root:/]lspv hdisk0PHYSICAL VOLUME: hdisk0 VOLUME GROUP: rootvgPV IDENTIFIER: 000d202d530d2928 VG IDENTIFIER 000d202d00004c0000000101ba50e580 PV STATE: activeSTALE PARTITIONS: 0 ALLOCATABLE: yesPP SIZE: 32 megabyte(s) LOGICAL VOLUMES: 10TOTAL PPs: 542 (17344 megabytes) VG DESCRIPTORS: 1FREE PPs: 194 (6208 megabytes) HOT SPARE: noUSED PPs: 348 (11136 megabytes)FREE DISTRIBUTION: 86..00..00..00..108USED DISTRIBUTION: 23..108..108..108..01经查,hdisk2为hdisk0(系统启动盘)的镜像;4.插入一块同样大小(XXGB)硬盘到另外插槽,cfgmgr识别出为hdisk##;5.chdev -a pv=yes -l hdisk##让磁盘变得可用;6.extendvg rootvg hdisk4将hdisk##加入卷组rootvg当中;7.migratepv hdisk0 hdisk##将hdisk0中所有信息移动到hdisk##中:root:/]migratepv hdisk0 hdisk##0516-1011 migratepv: Logical volume hd5 is labeled as a boot logical volume.0516-1246 migratepv: If hd5 is the boot logical volume, please run 'chpv -c hdisk2' as root user to clear the boot record and avoid a potential bootoff an old boot image that may reside on the disk from which thislogical volume is moved/removed.8.chpv -c hdisk0移除hdisk0中启动信息;9.bosboot -ad /dev/hdisk##在hdisk##中加入启动信息;10.reducevg rootvg hdisk0将hdisk0从rootvg中去除;11.rmdev -l hdisk2 -d将hdisk0所有信息从系统中删除;12.取出hdisk2;13.bootlist -m normal hdisk1 hdisk0 对原有启动顺序进行更改,将hdisk##取代hdisk0;14.bootlist -m normal -o查看更改后的启动顺序是否生效:[root:/]bootlist -m normal -o整个过程完成。

AIX更换硬盘方法

AIX更换硬盘方法

当主机硬盘丢失#lsvg -lp rootvg 结果rootvg:PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTIONhdisk0 active 542 0 00..00..00..00..00hdisk1 missing 542 0 00..00..00..00..00#chpv -va hdisk1 看看能不能找回来如果找不回来,则必须尽早予以跟换,跟换前必须做好备份!先查看机器是否有磁带机,若无则1、外置磁带机连接#cfgmgr -v#lsdev -Cc tape 看一下rmt0 是不是avaiable2、内置磁带机则直接备份#smitty mksysb3、查看硬盘的S/N,P/N 号#lscfg - vl hdisk*查看物理卷?lspv?查看逻辑卷组?lsvg?查看在用的逻辑卷组?Isvg? - o?# lsvg -o#sysdumpdev - I4、查看所有硬盘(包括逻辑盘)的状态# lsdev -Cc disk查看7133 磁盘柜硬盘状态?#lsdev? - Cc?pdisk5、把HDISKO从ROOTV中不做MIRROW?#unmirrorvg?rootvg?hdisk0? (长时间40 分钟)查看物理卷?#lspv?这时HDISK0不在和HDISK1 为MIRROR?把hdisk0 从rootvg 中去除?#reducevg?rootvg?hdisk0? (长时间0 分2 钟)在HDISK1 上创建boot?image?#bosboot? - ad?hdisk1?改变启动设备的顺序?#bootlist? - m?normal?hdisk1?cdO?删除HDISK0?#rmdev? - l?hdisk0? - d?#lspv?#lscfg? - vl?hdisk0?以上2条命令不会显示HDISKO的相关信息?(如果无法unmirrorvg 和rmdev 的话,就只能直接关机换盘了。

AIX磁盘阵列数据迁移

AIX磁盘阵列数据迁移

新商盟体验站今晚要更换数据库小机的磁盘阵列了,为保万无一失,上午特意把几个能实现迁移PV的命令都验证了一遍,各有优缺点,简单总结如下:方法1:镜像法1、把新存储的pv加入到卷组extendvg xxvg hdisk52、把新加入的盘做成镜像mirrorvg xxvg hdisk53、把旧盘从镜像组中删除unmirrorvg xxvg hdisk34、把旧盘从卷组中删除reducevg xxvg hdisk3优点:让人感觉更安全?不担心被终止执行。

缺点:命令多,太罗嗦。

疑问:不通大小的pv能做mirrorvg吗?能可能不支持多pv的卷组镜像?支持方法2:迁移法1、把新盘加入卷组extendvg xxvg hdisk52、把旧盘上的lv转移到新盘migratepv hdisk3 hdisk53、把旧盘从卷组中删除reducevg xxvg hdisk3优点:灵活,可以迁移单个lv,并且支持把大pv上的数据迁移到小pv(只要数据量能被装下)缺点:步骤稍多疑问:被意外终止会怎样?方法3:替换法用hdisk5替换hdisk3replacepv hdisk3 hdisk5优点:方便,快捷,安全,一部搞定。

是更换pv专用命令。

支持意外终止后断点续传。

缺点:只能换成相同容量或者更大的pv。

目标pv小是不允许的。

例子:replacepv hdisk40 hdisk7 把hdisk40换成hdisk70516-1232 replacepv:NOTE: If this program is terminated before the completion due to a system crash or ctrl-C, and you want to continue afterwardsexecute the following commandreplacepv -R /tmp/replacepv17891800如果意外终止可以用replacepv -R /tmp/replacepv17891800 命令继续执行。

AIX更换硬盘方法

AIX更换硬盘方法

A I X更换硬盘方法(总3页) -CAL-FENGHAI.-(YICAI)-Company One1-CAL-本页仅作为文档封面,使用请直接删除当主机硬盘丢失#lsvg -lp rootvg 结果rootvg:PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION hdisk0 active 542 0 00..00..00..00..00hdisk1 missing 542 0 00..00..00..00..00#chpv -va hdisk1 看看能不能找回来如果找不回来,则必须尽早予以跟换,跟换前必须做好备份!先查看机器是否有磁带机,若无则1、外置磁带机连接#cfgmgr -v#lsdev -Cc tape 看一下 rmt0是不是avaiable2、内置磁带机则直接备份#smitty mksysb3、查看硬盘的S/N,P/N号#lscfg –vl hdisk*查看物理卷 lspv查看逻辑卷组lsvg查看在用的逻辑卷组 lsvg –o# lsvg -o#sysdumpdev –l4、查看所有硬盘(包括逻辑盘)的状态# lsdev -Cc disk查看7133磁盘柜硬盘状态#lsdev –Cc pdisk5、把HDISK0从ROOTVG中不做MIRROW#unmirrorvg rootvg hdisk0 (长时间40分钟)查看物理卷#lspv这时HDISK0不在和HDISK1为MIRROR把hdisk0从rootvg中去除#reducevg rootvg hdisk0 (长时间0分2钟)在HDISK1上创建boot image#bosboot –ad hdisk1改变启动设备的顺序#bootlist –m normal hdisk1 cd0删除HDISK0#rmdev –l hdisk0 –d#lspv#lscfg –vl hdisk0以上2条命令不会显示HDISK0的相关信息(如果无法unmirrorvg 和 rmdev 的话,就只能直接关机换盘了。

AIX-RAID5更换硬盘步骤

AIX-RAID5更换硬盘步骤

AIX-RAID5更换硬盘步骤如何看机器内的卡及硬盘的微码级别(microcode level)用下面命令可以得到一个SSA卡的微码级别:# lscfg -vl ssa0其中 ssa0 是此SSA卡的设备名称.输出结果中的ROS level及ID 即是微码级别(microcode level).用下面命令可以得到一个硬盘的微码级别:lscfg -vl pdiskX在RS6000系统上安装RAID适配器时,一般通过重新启动系统,AIX操作系统可以自动认到该适配器。

但是在某些情况下,系统会停留在启动RAID适配器的位置,LED面板显示:“0751-P1-I1/Q1”;若运行cfgmgr命令,报0514-407错误。

解答这时有一种可能是该RAID适配器微码版本过低,需要从IBM 网站下载最新的微码。

如何确定该RAID适配器的微码版本是否过低呢?下面以7044-270机器上的2498 PCI 4通道Ultra3 SCSI RAID适配器为例,使用下面的命令可以读到存储在适配器中的微码版本。

1)列出系统中安装的PCI RAID适配器:lsdev -C | grep scraid注意:设备名是所有已安装的PCI 4通道Ultra3 SCSI RAID适配器的名称。

适配器设备名将是scraidX, X为0,1 或其他的数字。

2)检查当前适配器的微码版本:lscfg -vl scraidX(X为系统已安装的适配器的号码。

)命令显示如下:DEVICE LOCATION DESCRIPTIONScraid0 20-58 PCI 4-Channel Ultra3 SCSI RAID AdapterPart Number.................09P1521EC Level....................0H10522Serial Number (00000001)FRU Number..................37L6892 Manufacturer................IBM000Displayable Message.........UL3RAIDDiagnostic Level (03)Device Driver Level (03)Loadable Microcode Level....4.20.01ROS Level and ID............4.00.26Device Specific.(YL)........P2-I9如果FRU Number是37L6892并且当前适配器微码版本(Loadable Microcode Level)是4.20.01,不同与适配器微码最新版本4.70.11,则需要升级微码。

AIX服务器磁盘操作命令汇总

AIX服务器磁盘操作命令汇总

一、rootvg的磁盘操作先用cfgmgr –v找到新加的硬盘。

# lspvhdisk0 00092204880d7036 rootvghdisk1 none none显示结果中,hdisk1是一个新硬盘,没有分配pvid,可以用下面的命令为hdisk配置成一个物理卷:# chdev –l hdisk1 –a pv=yes该命令就给磁盘hidsk1分配一个唯一的pvid,并将pvid写在该磁盘的引导记录中。

如果该磁盘已经有了pvid,则此磁盘就配置成了物理卷。

该方法适用于配置之前不能重新启动系统,并且用cfgmgr检测不到的磁盘,此方法需要用户知道硬盘的具体信息。

知道硬盘的类型(Type),硬盘的连接的子类型(Subclass),硬盘连接的父设备名(Parent Name )和硬盘的逻辑位置(Location Code)一搬使用mkdev配置该磁盘,格式如下:# mkdev –c disk –s Subclass –t Type –p ParentName –w Location Code–a pv=yes例:增加一个679M的硬盘,连接到scsi3父设备上,他的scsi id是6,逻辑单元号是0,# mkdev –c disk –s scsi –t 670mb –p scsi3 –w 6,0 –a pv=yes或者调用smit mkdev来配置1.1.将一块新盘添加到rootvg当中#smit extendvgForce the creation of a volume group? no* VOLUME GROUP name [rootvg]* PHYSICAL VOLUME names [hdisk1]#lspvhdisk0 000cf05c5941a1f6 rootvg activehdisk1 000cf05ca13d72ec rootvg active#lsvg rootvgVOLUME GROUP: rootvg VG IDENTIFIER: 000cf05c00004c000000011bc16b24daVG STATE: active PP SIZE: 32 megabyte(s)VG PERMISSION: read/write TOTAL PPs: 1088 (34816 megabytes) MAX LVs: 256 FREE PPs: 946 (30272 megabytes) LVs: 10 USED PPs: 142 (4544 megabytes)ACTIVE PVs: 2 AUTO ON: yes......................... 注意TOTAL PPs、ACTIVE PVs项1.2.在该新添加盘当中分出一个LV,并将其挂载到系统当中,确认其可用性#smit mklvLogical volume NAME [ora_data]* VOLUME GROUP name rootvg* Number of LOGICAL PARTITIONS [30] PHYSICAL VOLUME names [hdisk1]Logical volume TYPE [jfs2].................................. 注意MAXIMUM NUMBER of LOGICAL PARTITIONS项的值#lsvg -l rootvg.....................................loglv01 jfs2log 1 1 1 open/syncd N/Aora_data jfs2 30 30 1 closed/syncd N/A#lslv ora_dataLOGICAL VOLUME: ora_data VOLUME GROUP: rootvgLV IDENTIFIER: 000cf05c00004c000000011bc16b24da.11 PERMISSION: read/writeVG STATE: active/complete LV STATE: closed/syncdTYPE: jfs2 WRITE VERIFY: offMAX LPs: 512 PP SIZE: 32 megabyte(s).....................................#smit crfsAdd an Enhanced Journaled File System->Add an Enhanced Journaled File System on a Previously Defined LogicalVolume->* LOGICAL VOLUME name ora_data* MOUNT POINT [/ora_data].................................#mount /ora_data#df -g1.3.扩大该LV的空间、镜像该LV,并更改其所在文件系统大小#lslv ora_data...............................MAX LPs: 512 PP SIZE: 32 megabyte(s) COPIES: 1 SCHED POLICY: parallelLPs: 30 PPs: 30.......................................#smit extendlv* LOGICAL VOLUME name ora_data* Number of ADDITIONAL logical partitions [+10]PHYSICAL VOLUME names [hdisk1]...................................#lslv ora_dataMAX LPs: 512 PP SIZE: 32 megabyte(s)COPIES: 1 SCHED POLICY: parallelLPs: 40 PPs: 40....................................#smit mklvcopy* LOGICAL VOLUME name ora_data* NEW TOTAL number of logical partition copies 2PHYSICAL VOLUME names [hdisk0]......................................#lslv ora_dataMAX LPs: 512 PP SIZE: 32 megabyte(s)COPIES: 2 SCHED POLICY: parallelLPs: 40 PPs: 80........................................#df -g /dev/ora_data/dev/ora_data 1.44 1.44 1% 4 1% /ora_data#smit chfs Change / Show Characteristics of an Enhanced Journaled File System->File system name /ora_dataNEW mount point [/ora_data]SIZE of file systemUnit Size 512bytesNumber of units [5966080]........................................#df -g /dev/ora_data/dev/ora_data 2.41 2.41 1% 4 1% /ora_data1.4.删除镜像、卸载该LV并将其从硬盘中删除#smit rmlvcopy* LOGICAL VOLUME name ora_data* NEW maximum number of logical partition copies 1...........................................#lslv ora_dataMAX LPs: 512 PP SIZE: 32 megabyte(s)COPIES: 1 SCHED POLICY: parallelLPs: 77 PPs: 77....................................#umount /ora_data#smit rmlvLOGICAL VOLUME name [ora_data]#lsvg -l rootvgloglv01 jfs2log 1 1 1 open/syncd N/A..........................................1.5.从rootvg中移除该磁盘#smit reducevgRemove a Physical Volume from a Volume Group->* VOLUME GROUP name rootvg* PHYSICAL VOLUME names [hdisk1]....................................#lspvhdisk0 000cf05c5941a1f6 rootvg active hdisk1 000cf05ca13d72ec None1.6.用新添加的PV mirror rootvg#smit extendvg#smit mirrorvgVOLUME GROUP name rootvgMirror sync mode [Foreground]PHYSICAL VOLUME names [hdisk1] Number of COPIES of each logical partition 21.7.删除rootvg mirror,退出rootvg#smit unmirrorvg#smit reducevg二、非rootvg的磁盘操作2.1.将一块新磁盘添加到系统中并新建为一个独立VG#smit mkvgAdd an Original Volume Group->VOLUME GROUP name [datavg]Physical partition SIZE in megabytes 8* PHYSICAL VOLUME names [hdisk1]..................................#lspvhdisk0 000cf05c5941a1f6 rootvg activehdisk1 000cf05ca13d72ec datavg active2.2.在该磁盘中分出两个LV,并将其挂载到系统当中,确认其可用性#smit mklv 注意MAXIMUM NUMBER of LOGICAL PARTITIONS项的值#lsvg -l datavgLV NAME TYPE LPs PPs PVs LV STATE MOUNT POINTdream jfs2 300 300 1 closed/syncd N/Aibm jfs2 500 500 1 closed/syncd N/A#smit crfs #lsvg -l datavgLV NAME TYPE LPs PPs PVs LV STATE MOUNT POINTdream jfs2 300 300 1 closed/syncd /dreamibm jfs2 500 500 1 closed/syncd /ibm#mount /ibm#mount /dream#df -g/dev/ibm 3.91 3.91 1% 4 1% /ibm/dev/dream 2.34 2.34 1% 4 1% /dream2.3.扩大、镜像LV,并更改其所在文件系统大小#smit extendlv* LOGICAL VOLUME name dream* Number of ADDITIONAL logical partitions [+300]PHYSICAL VOLUME names [hdisk1]POSITION on physical volume middleRANGE of physical volumes minimumMAXIMUM NUMBER of PHYSICAL VOLUMES [10]to use for allocationAllocate each logical partition copy no注意Allocate each logical partition copy项,选no#lsvg -l datavgLV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT dream jfs2 400 400 1 open/syncd /dreamibm jfs2 800 800 1 open/syncd /ibm#smit mklvcopy#lslv ibm #lslv dream #df -g/dev/dream 2.34 2.34 1% 4 1% /dream/dev/ibm 3.91 3.91 1% 4 1% /ibm#smit crfs#df -g/dev/dream 1.39 1.39 1% 4 1% /dream/dev/ibm 4.39 4.39 1% 4 1% /ibm2.4.删除镜像、卸载并删除两个LV#smit rmlvcopy#lslv dream #lslv ibm#umount /ibm #umount /dream#smit rmlv 注意在删除LV之前,请确认文件系统已从系统中卸载2.5.从系统中删除VG,使其成为一个全新的磁盘#smit reducevg#lspvhdisk0 000cf05c5941a1f6 rootvg active hdisk1 000cf05ca13d72ec None1.将新磁盘添加到系统当中,并确认其处于可用状态#chdev -l hdisk1 -a pv=yes三、AIX系统磁盘更换办法3.1 单rootvg ,单datavg , datavg中一块盘更换注意:在更换硬盘之前,必须做好数据的备份工作。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

情景 1
如果要替换的磁盘已做了镜像,推荐如下步骤:
1. 删除该磁盘上所有逻辑卷的复件,使用 rmlvcopy 命令或 unmirrorvg 命令。

2. 从卷组中删除该磁盘,使用 reducevg 命令。

3. 使用 rmdev 命令删除该磁盘定义。

4. 物理移除该磁盘。

如果磁盘不是可热交换的(hot-swappable),可能要求重启系统。

5. 使备用的磁盘可用。

如果磁盘是可热交换的(hot-swappble),可运行 cfgmgr;否则,需要重启系统。

6. 把新加的磁盘放入卷组,使用 extendvg 命令。

7. 重建并同步所有逻辑卷的复件,使用 mklvcopy 命令或 mirrorvg 命令。

rootvg 由hdisk0和hdisk1做成mirror,hdisk0报故障
#unmirrorvg rootvg hdisk0
#reducevg rootvg hdisk0
#rmdev -l hdisk0 -d
换故障硬盘
#cfgmgr -v
确认新换硬盘物理卷名为hdiskx
#lspv
#chdev -l hdiskx -a pv=yes
#extendvg rootvg hdiskx
#mirrorvg rootvg
#bosboot -ad /dev/hdiskx
#bootlist -m normal hdisk1 hdiskx
重启,系统从hdisk1启动
datavg由hdisk5和hdisk6做成mirror,hdisk6报故障
#unmirrorvg datavg hdisk6
#reducevg datavg hdisk6
#rmdev -l hdisk6 -d
换故障硬盘
#cfgmgr -v
确认新换硬盘物理卷名为hdiskx
#lspv
#chdev -l hdiskx -a pv=yes
#extendvg datavg hdiskx
#mirrorvg datavg
情景 2
如果要替换的磁盘没有镜像,但仍在起作用,推荐按以下步骤:
1. 使备用磁盘可用。

如果磁盘是可热交换的(hot-swappable),可运行 cfgmgr;否则,需要重启系统。

2. 把新加的磁盘放入卷组,使用 extendvg 命令。

3. 把故障磁盘的所有分区迁移到新磁盘,使用 migratepv 命令、或 migratelp 命令。

如果磁盘是 rootvg 的一部分,应考虑如下方面:
- 如果要替换的磁盘包含一个 BLV 的复件,必须使用 chpv -c 命令清除掉。

- 必须在新磁盘上创建一个新的 BLV 映像,使用 bosboot 命令。

- 必须使用 bootlist 命令更新 bootlist 反映这些变化。

- 如果要替换的磁盘包含分页空间或主 dump 设备,应禁用他们。

migratepv 命令完成后,应重新激活他们。

4. 从卷组中移除故障磁盘,使用 reducevg 命令。

5. 使用 rmdev 命令移除该磁盘定义。

datavg卷组hdisk6,hdisk7,无镜像,hidsk7损坏
#extendvg datavg hdiskx
#migratepv hdisk7 hdiskx
#reducevg hdisk7
#rmdev -l hdisk7 -d
情景 3
如果磁盘没有镜像,已完全损坏,在卷组中有其他可用磁盘,推荐以下步骤:
1. 识别至少有一个分区位于故障磁盘的所有逻辑卷。

2. 关闭逻辑卷并使用 umount 命令卸下所有相关的文件系统。

3. 使用 rmfs 命令移除文件系统和逻辑卷。

4. 使用 reducevg 命令从卷组中移除失败的磁盘。

5. 使用 rmdev 命令移除磁盘定义。

6. 物理移除磁盘。

如果磁盘不是可热交换的,可能需要重启系统。

7. 使备用磁盘可用。

如果磁盘是可热交换的,可运行 cfgmgr;否则,可能需要重启系统。

8. 把新加的磁盘放入卷组,使用 extendvg 命令。

9. 重新创建所有的逻辑卷和相关的文件系统,使用 mklv 命令和 crfs 命令。

10. 如果有数据的备份,从备份中恢复数据。

情景 4
如果磁盘没有镜像,已经完全损坏,在卷组中没有其他可用的磁盘(卷组只包含一个物理卷、或所有的物理卷同时损坏),卷组不是 rootvg,推荐以下步骤:
1. 从系统中导出卷组定义,使用 exportvg 命令。

2. 确认/etc/filesystems 不包含任何不正确的 stanza。

3. 使用 rmdev 命令移除磁盘定义。

4. 物理移除磁盘。

如果磁盘是不可热交换的,可能需要重启系统。

5. 使替代磁盘可用。

如果磁盘是可热交换的,可运行 cfgmgr;否则,可能需要重启系统。

6. 如果有卷组的备份,使用 restvg 命令恢复。

7. 如果没有卷组备份,重新创建卷组、所有的逻辑卷、和相关的文件系统,使用 mkvg 命令。

8. 如果有数据的备份,从备份恢复数据。

情景 5
如果磁盘没有镜像,已完全损坏,卷组中没有其他可用的磁盘(卷组中只有一个物理卷、或所有的物理卷同时失败),并且卷组是 rootvg,推荐如下步骤:
1. 替换故障磁盘。

2. 以维护模式引导系统。

3. 从一个 mksysb 映像恢复系统。

相关文档
最新文档