【文章內(nèi)容簡介】
sk成為PV方法二:手工運行cfgmgr一個新的磁盤只有被分配給一個VG才可以使用,必須作為一個PV才可以被LVM使用 相應(yīng)命令: chdev l hdisk1 a pv=yesThe following mand is used to turn off the allocation permission for the PV hdisk1 chpv a n hdisk1To turn the allocation permission back on .use the following mand chpv a y hdisk1當一個PV由于損壞要被從該系統(tǒng)刪除時,該PV should be made unavailable : chpv v r pvnameThe following mand will make a PV available to the system chpv v a pvname注意:當運行chpv命令失敗了的時候,檢查/tmp的空間A PV must be unconfigured before it can be removed from the system,The following example shows how to unconfigure a PV and change its state from available to defined rmdev l hdisk1該PV的定義仍然保留在ODM中,使用 d 將 remove the definition from the ODMList PV on the system lspvList PV on the system along with the status of each PV lspv C c diskList PV characteristic lspv hdisk1List all the LV on the PV lspv l hdisk1List PP allocation by PV region lspv p hdisk1List PP allocation table lspv M hdisk1下列的過程描述了如何從一個failing disk移出數(shù)據(jù) before it is removed for repair or replacement首先確定source and destinatino PV are in the same VG lsvg p rootvga、make sure the disk is available lsdev Cc disk b、if the disk is listed and in the available state , make sure it does not belong to another VG lspv c、if the disk is not listed or is not available,you need to check or install the disk d、add the new disk to the Vg extendvg VGNAME hdisknumber確定目標磁盤有足夠的空間可以容納源盤的內(nèi)容如果準備移動的數(shù)據(jù)所在的磁盤屬于rootvg: a、檢查是否 boot logical volume(BLV)也就是hd5在 sourec disk中 lspv l sourcedisknumber | grep hd5 如果在的話: migratepv l hd5 SourceDiskNumber DestinationDiskNumber 注意: migratepv命令cannot migrate striped LV ,if htis is the case , to move data from one PV to another,use the cplv命令 to copy the data,and then use the rmlv mand to remove the old copy migratepv mand is not allowed if the VG is varied on in a concurrent mode b、在目標磁盤上執(zhí)行bosboot命令 當BLV is migrated from a PV ,the boot record on the source should be cleared ,Failure to clear this record may result in a system hang c、在源磁盤上執(zhí)行bosboot c命令 to clear the boot record on the source bosboot a d /dev/DestinationDiskNumber bootlist m normal DestinationDiskNumber mkboot c d /dev/SourceDiskNumber如果你要移動的數(shù)據(jù)所在的磁盤屬于用戶定義的卷組 smitty migratepvTo remove source disk from the Vg ,such as when it is failing reducevg VGNAME SourceDiskNumber在物理的卸掉Source disk之前,運行 rmdev l SourceDiskNumber d創(chuàng)建一個新的VG , mkvg 或 smitty mkvg當使用mkvg創(chuàng)建VG的時候,root filesystem 至少需要2MB的Free space才能夠保證VG成功創(chuàng)建To make a VG to be varied on automatically each time a system is restarted chvg ay newvgTurn off the automatic varying on of the VG at system restart chvg an newvgUnlock a Vg chvg u newvgAdd the PV hdisk3 to Vg newvg extendvg newvg hdisk3The Vg must be varied on before it can be reduced reducevg myvg hdisk3Remove a PV reference reducevg VG PVIDTo remove the system definition of a VG from the ODM database,the VG need to be exported using the exportvg mand,This mand will not remove any user data in the VG ,but will only remove its definition from the ODM database exportvg myvg importvg –y myvg hdisk12你也可以使用exportvg 和importvg來給一個用戶定義的卷組改名 varyoffvg vg00 exportvg vg00 (導(dǎo)出前要先varrry off) importvg –y cadsvg hdisk1A VG that has a paging space volume on it cannot be exported while the paging space is active在導(dǎo)出一個包含活動的paging space的卷組的時候,首先: chps –a n paging_space_name然后重起系統(tǒng),從而該paging space處于inactive的狀態(tài)if you don’t activate the VG that contains file systems, or if you activated the VG through smitty importvg,It is highly remended that you run the fsck mand before you mount the file systems, if you are moving the VG to another system,be sure to unconfigure the disks before moving themThe smitty exportvg mand deletes references to file system in /etc/filesystems,but it leaves the mount points on the system激活一個卷組: varyonvg newvgDeactivate a Vg (The varyoffvg mand will deactivate a VG and its associated LV,This requires that the LV be closed ,which requires that file systems associated with LV be unmounted,) varyoffvg myvgList all the Vg known to the system lsvgList the Vg that are currently active lsvg –oList the characteristics of a VG lsvg rootvgList the LV in a VG lsvg –l rootvgList the PV status within a VG lsvg –p rootvg使用reorgvg命令的兩個必要的條件:VG must be varied onMust have free partitionsThe relocatable flag of each LV must be set to y using the chlv –r mand for the reorganization to take effect,otherwise, the LV is ignored注意:對于LV的relocatable必須用chlv r設(shè)置成 y ,reorgvg命令對含條帶集的邏輯卷無效,同時在該卷組中至少包含一個自由的物理分區(qū)To synchronize the copies on PV hdisk04 and hdisk05 syncvg –p hdisk04 hdisk05To synchronize the copies on VG vg04 and vg05 syncvg –v vg04 vg05 mklv newlv 創(chuàng)建邏輯卷 rmlv newlv 刪除邏輯卷 extendlv newlv 3 擴展該邏輯卷的邏輯分區(qū)(增加了3個LP)使用cplv命令來拷貝一個邏輯卷到另外的新的磁盤或已經(jīng)存在的邏輯卷 cplv –v myvg –y newlv oldlv 該命令將拷貝oldlv的內(nèi)容到一個新的邏輯卷newlv ,如果卷組沒有指定的話,該命令將在相同的卷組中創(chuàng)建一個新的邏輯卷拷貝一個邏輯卷的內(nèi)容到一個已經(jīng)存在的邏輯卷(existinglv卷組中的數(shù)據(jù)將被覆蓋) cplv –e existinglv oldlv如果卷組is varied on in concurrent mode的話,使用cplv命令來創(chuàng)建一個新的LV將失敗 splitlvcopy –y newlv oldlv 2 (以前的oldlv的一個LP對應(yīng)三個PP)該命令執(zhí)行后: oldlv的一個LP對應(yīng)兩個PPnewlv的一個LP對應(yīng)一個PPBefore splitting LV ,You must unmount file system and close the LV下列的LV在系統(tǒng)安裝的時候自動創(chuàng)建hd5 :This is boot logical volume that holds the boot code, it is available only at system startup timehd6: This is the default paging space logical volume that is used by the system to perform paging.hd8 : This LV is used as the default logging space for the JFS,一個分區(qū),4MBhd2 : This LV is used by the /usr file systemhd4 : This LV is used by the / root file systemhd9var : This LV is used bye the /var file systemhd3: This LV is used by the /tmp file systemhd1 : This LV is used by the /home