解决Linux扩容问题

问题描述:挂载点 “/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退出。

扫描二维码关注公众号,回复: 9166813 查看本文章

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 查看

发布了77 篇原创文章 · 获赞 123 · 访问量 30万+

猜你喜欢

转载自blog.csdn.net/han0373/article/details/94558054