Skip to main content

FAQ

無法新增 PV

Device /dev/sdj not found (or ignored by filtering).

Solution: 可能該磁碟有包含其他磁區

# fdisk -l /dev/sdj

WARNING: GPT (GUID Partition Table) detected on '/dev/sdj'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdj: 3848.3 GB, 3848290697216 bytes
255 heads, 63 sectors/track, 467861 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdj1 1 267350 2147483647+ ee GPT
Partition 1 does not start on physical sector boundary.

移除這磁碟裡的所有磁區後再試一次。

無法移除已經損壞 PV 的 VG 與 LV

有一個 PV - /dev/sdc 發生損毀,所屬 VG 與 LV 要移除時遇到錯誤:

    Couldn't find device with uuid APgmaN-yCZG-WfQS-L5zm-vd6g-oEJc-WjzNrT.
    Can't remove locked LV isths_DMS

      Couldn't find device with uuid APgmaN-yCZG-WfQS-L5zm-vd6g-oEJc-WjzNrT.
      WARNING: Partial LV isths_home needs to be repaired or removed.
      WARNING: Partial LV isths_DMS needs to be repaired or removed.
      WARNING: Partial LV pvmove0 needs to be repaired or removed.
      There are still partial LVs in VG vg_db.
      To remove them unconditionally use: vgreduce --removemissing --force.
      Proceeding to remove empty missing PVs.

Solution: VG Name: vg_db

# vgcfgbackup vg_db
Couldn't find device with uuid APgmaN-yCZG-WfQS-L5zm-vd6g-oEJc-WjzNrT.
Volume group "vg_db" successfully backed up.

/etc/lvm/backup/vg_db:

...
logical_volumes {
...
...
}
...

將段落 logical_volumes 整個移除。

執行 vgcfgrestore

# vgcfgrestore vg_db
Restored volume group vg_db

重新掃描再重新執行移除 LV 與 VG

pvs
vgs
lvs
vgremove vg_db
使用 USB 掛載包含有 LVM 的硬碟,出現錯誤訊息