Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> 關於 Linux

Oracle Linux 6.4 誤刪 VG 卷組?利用 LVM 備份還原完整復原實戰

編輯:關於 Linux

生產環境 Oracle Linux 6.4 執行 vgremove vg_ossdb 誤刪含有資料邏輯卷 lvoradata 的卷組。幸運的是 LVM 預設在 /etc/lvm/archive/ 保存配置備份。本文詳細記錄:掛載備份伺服器取得 vg_ossdb 備份檔、vgcfgrestore -f 還原卷組配置、vgchange -ay 啟用邏輯卷、fsck 檢查檔案系統、重新掛載 /oradata 完整復原流程,並對比正確操作應用 vgreduce 移除 PV 與 pvremove 清除標籤的差異。

復原關鍵步驟

  1. 尋找備份:ls /etc/lvm/archive/vg_ossdb_*
  2. 還原配置:vgcfgrestore -f /etc/lvm/archive/vg_ossdb_XXXXXX.vg vg_ossdb
  3. 啟用卷組:vgchange -ay vg_ossdb
  4. 檢查檔案系統:fsck -f /dev/vg_ossdb/lvoradata
  5. 掛載:mount /dev/vg_ossdb/lvoradata /oradata

正確移除 PV 流程(對照)

vgreduce vg_ossdb /dev/sdd
vgreduce vg_ossdb /dev/sde
pvremove /dev/sdd
pvremove /dev/sde

LVM 自動備份機制是誤操作救星,vgcfgrestore 能從封存檔完整還原 VG/LV 中繼資料,配合 fsck 確保資料一致性。

Copyright © Windows教程網 All Rights Reserved