我需要给centos-root
from更多空间centos-home
。
我卸载了/home,之后
lvremove /dev/mapper/centos-home
然后,
lvextend -L 500G /dev/mapper/centos-root
和最终的
mount /home
问题是现在ls
来自的命令/home
给了我:
ls: cannot open directory .: Input/output error.
我已经尝试过xfs_repair /dev/mapper/centos-home
,但结果是xfs_repair: cannot open /dev/mapper/centos-home: Device or resource busy
任何其他想法。我不想重装操作系统。
多谢!
答案1
检查文件系统:
e2fsck -f /dev/mapper/vg_livecd-lv_home
最好做resize
/home 而不是remove
按照步骤:
Step:1 Umount the file system
# umount /home/
Step:2 check the file system for Errors using e2fsck command.
# e2fsck -f /dev/mapper/vg_livecd-lv_home
Step:3 Reduce or Shrink the size of /home to required size.
# resize2fs /dev/mapper/vg_livecd-lv_home 50G
Step:4 Reduce the size using lvreduce command.
# lvreduce -L 50G /dev/mapper/vg_livecd-lv_home
Step:5 Check the filesystem before mount
# e2fsck -f /dev/mapper/vg_livecd-lv_home
Step:6 Mount the file system and verify its size.
# mount /home
-> 增加 LVM 的步骤:
Step1: Check the free available space in the Volume group
# vgdisplay < Volume-Group-Name>
Step2: Increase the size using Lvextend command
# lvextend -L +120G /dev/mapper/vg_livecd-lv_root
Step:3 Run the resize2fs command
# resize2fs /dev/mapper/vg_livecd-lv_root
Step:4 Verify Size
# df -Th