微信悬浮二维码
微信扫一扫
关注更多Golang内幕
解决Linux扩容问题-Go语言社区

解决Linux扩容问题

版权声明:本文来源CSDN,博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/han0373/article/details/94558054

问题描述:挂载点 “/dev/xx” 的使用率达100%,空间不够,所以要对其进行分区。

 

解决:

1、通过vmware、vsphere等虚拟机设置,调整增大磁盘空间

2、输入命令: fdisk -l 查看现有情况

3、增加分区

$> fdisk /dev/sda

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)

输入p,默认回车,然后w退出。

 

4、创建、查询物理卷

$> pvcreate /dev/sda4
  dev_is_mpath: failed to get device for 8:4
  Physical volume "/dev/sda4" successfully created

$> vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "vg_root" using metadata type lvm2

5、新增物理卷扩展,“vg_root”

$> vgextend vg_sddb02 /dev/sda4
  Volume group "vg_root" successfully extended

$> lvextend -L +1024G /dev/vg_root
  Extending logical volume lv_root to 1.48 TiB
  Logical volume lv_root successfully resized

6、执行重设

$> resize2fs /dev/vg_root
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/vg_root is mounted on /; on-line resizing required
old desc_blocks = 31, new_desc_blocks = 95
Performing an on-line resize of /dev/vg_root to 396230656 (4k) blocks.
The filesystem on /dev/vg_root is now 396230656 blocks long.

7、成功,输入命令 df -lh 查看

  • 发表于 2019-08-27 15:57
  • 阅读 ( 7 )
  • 分类:Linux

你可能感兴趣的文章

相关问题

推荐好书