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

Linux 掛載 LVM 分區完整步驟指南

編輯:Linux 教學

將舊伺服器硬盤移至新機器時,若分區為 LVM(Logical Volume Manager)格式,直接 mount /dev/sda2 /opt 會報錯 already mounted or /mnt busy。需先掃描、啟用 LVM 邏輯卷再掛載。

環境資訊

Disk /dev/sda: 500.1 GB
/dev/sda2  Type: 8e Linux LVM

標準掛載流程

  1. 掃描實體卷
    lvm pvscan
    
  2. 啟用卷組
    lvm vgchange -ay
    
  3. 查看啟用後的裝置映射名稱
    ls /dev/mapper/
    

    典型輸出:VolGroup00-LogVol00、VolGroup00-LogVol01 等。

  4. 確認邏輯卷大小(可選)
    lvm lvs
    
  5. 掛載目標邏輯卷
    mount /dev/mapper/VolGroup00-LogVol00 /opt
    

常見問題排查

  • 若 vgchange -ay 無輸出,檢查 /etc/lvm/lvm.conf 中 filter 設定是否阻擋裝置。
  • 若掛載點已存在資料,先備份再掛載,避免遮蓋原有檔案。
  • 開機自動掛載請編輯 /etc/fstab,使用 UUID 或 /dev/mapper/... 路徑。

補充:LVM 基本概念

LVM 將實體硬盤(PV)彙整為卷組(VG),再切割為邏輯卷(LV),支援線上擴容、快照、跨磁碟條帶化等進階功能,是企業級存儲管理的標準做法。

Copyright © Windows教程網 All Rights Reserved