• LVM扩容报错以及 xfs_growfs 和 resize2fs 区别


    最近老套路硬盘扩容报错

    如下报错01)

    [root@localhost ~]# pvcreate /dev/sda1
      Device /dev/sda1 not found.
    [root@localhost ~]# pvcreate /dev/sda2
      Device /dev/sda2 not found.
    [root@localhost ~]# pvcreate /dev/sda3
      Device /dev/sda3 not found.
    
    遇到这个报错是因为没有运行
    partprobe

    如下报错02)

    [root@localhost ~]# vgextend centos /dev/sda1
      Couldn't create temporary archive name.
    [root@localhost ~]# vgextend centos /dev/sda2
      Couldn't create temporary archive name.
    [root@localhost ~]# vgextend centos /dev/sda3
      Couldn't create temporary archive name.

    这个通常是因为root partition 满了(根目录满了),清理一下文件再运行vgextend

    如下报错03)

    [root@localhost ~]# resize2fs /dev/centos/root
    resize2fs 1.42.9 (28-Dec-2013)
    resize2fs: Bad magic number in super-block while trying to open /dev/centos/root
    Couldn't find valid filesystem superblock.

    报错原因是centos7 默认使用了xfs文件系统,

    应该使用命令

    xfs_growfs /dev/centos/root

    所以

    如果使用xfs文件系统

    • xfs_growfs /dev/root_vg/root

    如果使用ext4文件系统

    • resize2fs /dev/root_vg/root
  • 相关阅读:
    (转)C#中Thread.sleep()
    ZigBee无线信道组成
    JSP应用html乱码的终极解决办法
    How to size text using ems
    iframe和frame的区别
    [洛谷P2827]蚯蚓
    [洛谷P3391]【模板】文艺平衡树(Splay)
    [洛谷P4180]严格次小生成树
    HTTP 常见鉴权
    使用 rsync 备份/复制 系统
  • 原文地址:https://www.cnblogs.com/faberbeta/p/13152477.html
Copyright © 2020-2023  润新知