vmware zabbix擴展磁盤空間

因空間限制將現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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章