linux centos6 lvresize 失败 无法启动 修复
时间:2022-10-09 06:00:00
做虚拟机linux(centos6)添加磁盘 扩容根目录 操作失误 系统无法启动
操作失误如下 (关键动作lvresize -l 2557 /dev/mapper/vg_cognosotherdb-lv_root 2557前应加号)
***********************************************************************************************************************
vgdisplay
--- Volume group ---
VG Name vg_cognosotherdb
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 5
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 3
Max PV 0
Cur PV 2
Act PV 2
VG Size 69.50 GiB
PE Size 4.00 MiB
Total PE 17791
Alloc PE / Size 15234 / 59.51 GiB
Free PE / Size 2557 / 9.99 GiB
VG UUID hzdlZT-8rlX-AXiY-hN9x-DBH0-XOPa-AyEtK1
lvresize -l 2557 /dev/mapper/vg_cognosotherdb-lv_root
WARNING: Reducing active and open logical volume to 9.99 GiB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lv_root? [y/n]: y
Size of logical volume vg_cognosotherdb/lv_root changed from 50.00 GiB (12800 extents) to 9.99 GiB (2557 extents).
/etc/lvm/backup/vg_cognosotherdb.tmp: fsync failed: 输入/输出错误
/etc/lvm/backup/vg_cognosotherdb.tmp: fclose failed: 只读文件系统
Backup of volume group vg_cognosotherdb metadata failed.
Logical volume lv_root successfully resized
Message from syslogd@localhost at Apr 18 10:59:10 ...
kernel:journal commit I/O error
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_cognosotherdb-lv_root
50G 47G 216M 100% /
tmpfs 1.9G 76K 1.9G 1% /dev/shm
/dev/sda1 477M 42M 410M 10% /boot
/dev/mapper/vg_cognosotherdb-lv_home
5.5G 12M 5.2G 1% /home
vgdisplay
-bash: /sbin/vgdisplay: 输入/输出错误
reboot
-bash: /sbin/reboot: 输入/输出错误
***********************************************************************************************************************
恢复步骤 先clone保留一个备份(虽然启不来也要备份) 然后试试PE要恢复分区表的结果PE里不认盘
后来通过centos6安装板启动恢复模式 逆向操作 先把LV最后添加到里面PV删除 然后 lvresize -l 100045 /dev/mapper/vg_cognosotherdb-lv_root 把free给回所有空间LV可启动系统