首页 > 其他 > 详细

记一次 lvm 扩容

时间:2020-06-13 09:59:01      阅读:42      评论:0      收藏:0      [点我收藏+]

家里的笔记本,安装 fedora 的时候根分区只留了 20G,而且没有对 home 单独分区。发现空间有些紧张,扩容一下。

# 卸载一个物理分区,数据记得提前备份好
sudo umount /dev/sda7
# 将空闲的分区拓展到 vg 中 vgextend - Add physical volumes to a volume group
# 可以通过 vgs 或者 vgdisplay  拿到 vg 的 name,这里是 fedora_bogon
sudo vgextend fedora_bogon /dev/sda7
# 把所有的空闲空间放到逻辑卷  lvextend - Add space to a logical volume
sudo lvextend -l +100%FREE /dev/fedora_bogon/root
# 此时分区还没有识别到扩容的空间,需要校正一下,我的分区是 ext4 的,使用resize2fs
# The resize2fs program will resize ext2, ext3, or ext4 file systems.   It  can  be  used  to
#      enlarge  or  shrink  an  unmounted  file  system  located  on device.  If the filesystem is
#      mounted, it can be used to expand the size of the mounted filesystem, assuming  the  kernel
#      and  the file system supports on-line resizing.  (Modern Linux 2.6 kernels will support on-
#      line resize for file systems mounted using ext3 and ext4; ext3 file  systems  will  require
#      the use of file systems with the resize_inode feature enabled.)
sudo resize2fs /dev/fedora_bogon/root
# 有些教程里提到 xfs_growfs,这个是针对 xfs 分区的,在我这并不适用。

# !!!非常重要 sudo vim fstab 检查一下开机挂载的文件系统是否都还在,否则重启会失败。切记。

记一次 lvm 扩容

原文:https://www.cnblogs.com/highgogo/p/13111371.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!