事件現象: 最近同事在擴展VG時遇到了“Snapshot origin volumes can be resized only while inactive: try lvchange -an”錯誤 # partprobe # mkfs -t ext3 /dev/sdd3 # pvcreate /d... ...
事件現象:
最近同事在擴展VG時遇到了“Snapshot origin volumes can be resized only while inactive: try lvchange -an”錯誤
# partprobe
# mkfs -t ext3 /dev/sdd3
# pvcreate /dev/sdd3
# vgextend VolGroup03 /dev/sdd3
# lvextend -l +40G /dev/mapper/VolGroup03-LogVol00 /dev/sdd3
/dev/VolGroup05/LogVol00-PS-user-snapshot: read failed after 0 of 4096 at 279105699840: Input/output error
/dev/VolGroup05/LogVol00-PS-user-snapshot: read failed after 0 of 4096 at 279105757184: Input/output error
/dev/VolGroup05/LogVol00-PS-user-snapshot: read failed after 0 of 4096 at 0: Input/output error
/dev/VolGroup05/LogVol00-PS-user-snapshot: read failed after 0 of 4096 at 4096: Input/output error
/dev/VolGroup01/LogVol00-PS-user-snapshot: read failed after 0 of 4096 at 85865725952: Input/output error
/dev/VolGroup01/LogVol00-PS-user-snapshot: read failed after 0 of 4096 at 85865783296: Input/output error
/dev/VolGroup01/LogVol00-PS-user-snapshot: read failed after 0 of 4096 at 0: Input/output error
/dev/VolGroup01/LogVol00-PS-user-snapshot: read failed after 0 of 4096 at 4096: Input/output error
Snapshot origin volumes can be resized only while inactive: try lvchange -an
出錯原因:
被擴展的VG存在LVM快照(LVM snapshot),所以擴展VG時出現上面錯誤。因為這個LVM快照是PlateSpin使用,上面沒有什麼數據一定需要保留。所以使用lvremove刪除邏輯捲LV,然後擴展VG。 最後創建LV解決。
解決方案
# stat /dev/VolGroup03/LogVol00-PS-user-snapshot
# lvremove /dev/VolGroup03/LogVol00-PS-user-snapshot
# lvextend -L +40G /dev/mapper/VolGroup03-LogVol00 /dev/sdd3
# resize2fs /dev/mapper/VolGroup03-LogVol00
# lvcreate -L 20G -s -n LogVol00-PS-user-snapshot /dev/VolGroup03/LogVol00
如果出於保險起見,那麼需要備份LVM快照數據,然後卸載捲組(unmount), 然後就按照上面步驟繼續操作