阅读下面我的故事。
我正在使用 LVM2 并提供以下信息:
扫描 VG:
# vgs
VG #PV #LV #SN Attr VSize VFree
unix 1 1 0 wz--n- 115.00g 45.00g
扫描LV
# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
work unix -wi-s- 70.00g
尝试激活VG、LV
# vgchange -ay
device-mapper: resume ioctl failed: Invalid argument
Unable to resume unix-work (254:1)
1 logical volume(s) in volume group "unix" now active
检查LV是否激活
# lvdisplay
/dev/mapper/unix-work: open failed: No such file or directory
--- Logical volume ---
LV Name /dev/unix/work
VG Name unix
LV UUID HzzTTr-rX2d-w1dP-NEQL-QksJ-rmHW-jMTxO7
LV Write Access read/write
LV Status NOT available
LV Size 70.00 GiB
Current LE 17920
Segments 2
Allocation inherit
Read ahead sectors auto
由于最后一个命令结束时出现错误:“/dev/mapper/unix-work:打开失败:没有这样的文件或目录”然后我必须运行 vgmknodes 来手动创建 /dev/ 节点,如下所示
# vgmknodes
The link /dev/unix/work should had been created by udev but it was not found. Falling back to direct link creation.
现在状态“暂停”看起来更好
# lvdisplay
--- Logical volume ---
LV Name /dev/unix/work
VG Name unix
LV UUID HzzTTr-rX2d-w1dP-NEQL-QksJ-rmHW-jMTxO7
LV Write Access read/write
LV Status suspended
# open 0
LV Size 70.00 GiB
Current LE 17920
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:1
尝试挂载LV:
# mount /dev/unix/work /mnt/
mount: /dev/mapper/unix-work already mounted or /mnt/ busy
来自 dmesg 的消息:
[ 1527.566964] device-mapper: table: 254:1: sda3 too small for target: start=94372224, len=136306688, dev_size=224606491
所以,我的问题是:如何唤醒 LV 来挂载它或使用dd
命令从 LVM 分区获取数据?
先谢谢了!
答案1
我认为这与这篇文章有关https://superuser.com/questions/1061454/how-to-resize-back-a-logic-volumen-lvm/1061548
正如 psusi 评论所建议的,/dev/sda3 上的 PV 似乎小于 VG 大小(可能pvresize --setphysicalvolumesize somesizeG
一次完成了 a)
2 个解决方案: - 扩展 /dev/sda3 - 减少 unix-work LV
但需要pvdisplay and /dev/sda3
信息