解决Linux扩容问题

9 篇文章 0 订阅

问题描述:挂载点 “/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 查看

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值