vmware zabbix扩展磁盘空间

32 篇文章 0 订阅

因空间限制将现zabbix环境添加一块硬盘30G用于扩展

root@zabbix:~# df -l

root@zabbix:/proc# fdisk -l

root@zabbix:/proc/# fdisk /dev/sdb
Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-629145599, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-629145599, default 629145599): 

Created a new partition 1 of type 'Linux' and of size 30 GiB.

Command (m for help): t
Selected partition 1
Partition type (type L to list all types): 8e
Changed type of partition 'Linux' to 'Linux LVM'.

Command (m for help): p
Disk /dev/sdb: 30 GiB, 322122547200 bytes, 629145600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x20d62197

Device     Boot Start       End   Sectors  Size Id Type
/dev/sdb1        2048 629145599 629143552  30G 8e Linux LVM

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

root@zabbix:/proc/# df -h

root@zabbix:/proc/# pvse

root@zabbix:/proc/# vgdisplay 
  --- Volume group ---
  VG Name               zabbix-vg
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  6
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               9.52 GiB
  PE Size               4.00 MiB
  Total PE              25477
  Alloc PE / Size       25417 / 9.29 GiB
  Free  PE / Size       60 / 240.00 MiB
  VG UUID               jwydJN-hcMl-GAax-wIi5-8uYr-8DoL-y4ScQA
   
root@zabbix:/proc/# pvcreate /dev/sdb1
  Physical volume "/dev/sdb1" successfully created

root@zabbix:/proc/# vgdisplay 
  --- Volume group ---
  VG Name               zabbix-vg
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  6
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               9.52 GiB
  PE Size               4.00 MiB
  Total PE              25477
  Alloc PE / Size       25417 / 9.29 GiB
  Free  PE / Size       60 / 240.00 MiB
  VG UUID               jwydJN-hcMl-GAax-wIi5-8uYr-8DoL-y4ScQA
   
root@zabbix:/proc/# vgextend zabbix-vg /dev/sdb1
  Volume group "zabbix-vg" successfully extended

root@zabbix:/proc/# lvextend -L +30G -n /dev/mapper/zabbix--vg-root 
  Size of logical volume zabbix-vg/root changed from 97.29 GiB (24905 extents) to 197.29 GiB (50505 extents).
  Logical volume root successfully resized.
root@zabbix:/proc/# df -h
Filesystem                   Size  Used Avail Use% Mounted on
udev                         7.9G     0  7.9G   0% /dev
tmpfs                        1.6G   93M  1.5G   6% /run
/dev/mapper/zabbix--vg-root  9.6G   6.7G   2.6G  73% /
tmpfs                        7.9G     0  7.9G   0% /dev/shm
tmpfs                        5.0M     0  5.0M   0% /run/lock
tmpfs                        7.9G     0  7.9G   0% /sys/fs/cgroup
/dev/sda1                    472M  471M     0 100% /boot

root@zabbix:/proc/# vi /etc/fstab 

root@zabbix:/proc/scsi# resize2fs /dev/mapper/zabbix--vg-root 
resize2fs 1.42.13 (17-May-2015)
Filesystem at /dev/mapper/zabbix--vg-root is mounted on /; on-line resizing required
old_desc_blocks = 7, new_desc_blocks = 13
The filesystem on /dev/mapper/zabbix--vg-root is now 51717120 (4k) blocks long.

root@zabbix:/proc/# df -h
Filesystem                   Size  Used Avail Use% Mounted on
udev                         7.9G     0  7.9G   0% /dev
tmpfs                        1.6G   93M  1.5G   6% /run
/dev/mapper/zabbix--vg-root  39.5G   6.7G  32G  16% /
tmpfs                        7.9G     0  7.9G   0% /dev/shm
tmpfs                        5.0M     0  5.0M   0% /run/lock
tmpfs                        7.9G     0  7.9G   0% /sys/fs/cgroup
/dev/sda1                    472M  471M     0 100% /boot

为了防止ubuntu系统自动更新让/boot空间不足:

可能为:/etc/apt/apt.conf.d/10periodic

vi /etc/apt/apt.conf.d/20auto-upgrades         //全部改为0不更新

APT::Periodic::Update-Package-Lists "0";

APT::Periodic::Download-Upgradeable-Packages "0";

APT::Periodic::AutocleanInterval "0";

APT::Periodic::Unattended-Upgrade "0";

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值