150810_sbub_2814828.png

 

原有只有100G空间。

现添加多一块硬盘300G。

150906_NIHl_2814828.png

 

 

登陆服务器

[BEGIN] 2018/3/7 13:06:16
Last login: Fri Dec  1 08:49:12 2017 from 10.2.202.38

########    ###    ########  ########  #### ##     ##
     ##    ## ##   ##     ## ##     ##  ##   ##   ##
    ##    ##   ##  ##     ## ##     ##  ##    ## ##
   ##    ##     ## ########  ########   ##     ###
  ##     ######### ##     ## ##     ##  ##    ## ##
 ##      ##     ## ##     ## ##     ##  ##   ##   ##
######## ##     ## ########  ########  #### ##     ##
root@zabbix:~# date
Wed Mar  7 05:06:19 UTC 2018
root@zabbix:~# df -f
df: invalid option -- 'f'
Try 'df --help' for more information.
root@zabbix:~# df -l
Filesystem                  1K-blocks     Used Available Use% Mounted on
udev                          8195228        0   8195228   0% /dev
tmpfs                         1643256    95072   1548184   6% /run
/dev/mapper/zabbix--vg-root 100296400 69644980  26482076  73% /
tmpfs                         8216268        0   8216268   0% /dev/shm
tmpfs                            5120        0      5120   0% /run/lock
tmpfs                         8216268        0   8216268   0% /sys/fs/cgroup
/dev/sda1                      482922   482213         0 100% /boot
root@zabbix:~# 
root@zabbix:~# df- l
-bash: df-: command not found
root@zabbix:~# df -l
Filesystem                  1K-blocks     Used Available Use% Mounted on
udev                          8195228        0   8195228   0% /dev
tmpfs                         1643256    95072   1548184   6% /run
/dev/mapper/zabbix--vg-root 100296400 69653388  26473668  73% /
tmpfs                         8216268        0   8216268   0% /dev/shm
tmpfs                            5120        0      5120   0% /run/lock
tmpfs                         8216268        0   8216268   0% /sys/fs/cgroup
/dev/sda1                      482922   482213         0 100% /boot
root@zabbix:~# cd /proc/scsi/
root@zabbix:/proc/scsi# cd 
root@zabbix:~# ls
root@zabbix:~# cd ..
root@zabbix:/# ls
bin   dev  home        initrd.img.old  lib64       media  opt   root  sbin  sys  usr  vmlinuz
boot  etc  initrd.img  lib             lost+found  mnt    proc  run   srv   tmp  var  vmlinuz.old
root@zabbix:/# cd scsi
-bash: cd: scsi: No such file or directory
root@zabbix:/# cd ..
root@zabbix:/# cd /proc/scsi/
root@zabbix:/proc/scsi# cat scsi
Attached devices:
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: NECVMWar Model: VMware IDE CDR10 Rev: 1.00
  Type:   CD-ROM                           ANSI  SCSI revision: 05
Host: scsi2 Channel: 00 Id: 00 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 1.0 
  Type:   Direct-Access                    ANSI  SCSI revision: 02
root@zabbix:/proc/scsi# echo "scsi add-dingle-dveice 2 0 1 0>/proc/scsi/scsi 
-bash: echo: write error: Invalid argument
root@zabbix:/proc/scsi# echo "scsi add-dingle-dev
-bash: echo: write error: Invalid argument
root@zabbix:/proc/scsi# echo "scsi add-s
root@zabbve
cat scsi
Attached devices:
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: NECVMWar Model: VMware IDE CDR10 Rev: 1.00
  Type:   CD-ROM                           ANSI  SCSI revision: 05
Host: scsi2 Channel: 00 Id: 00 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 1.0 
  Type:   Direct-Access                    ANSI  SCSI revision: 02
Host: scsi2 Channel: 00 Id: 01 Lun: 00
  Vendor: VMware   Model: Virtual disk     Rev: 1.0 
  Type:   Direct-Access                    ANSI  SCSI revision: 02
root@zabbix:/proc/scsi# fdisk -l
Disk /dev/sda: 100 GiB, 107374182400 bytes, 209715200 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: 0xe8d551b9

Device     Boot   Start       End   Sectors  Size Id Type
/dev/sda1  *       2048    999423    997376  487M 83 Linux
/dev/sda2       1001470 209715199 208713730 99.5G  5 Extended
/dev/sda5       1001472 209713151 208711680 99.5G 8e Linux LVM


Disk /dev/mapper/zabbix--vg-root: 97.3 GiB, 104459141120 bytes, 204021760 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


Disk /dev/mapper/zabbix--vg-swap_1: 2 GiB, 2147483648 bytes, 4194304 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


Disk /dev/sdb: 300 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
root@zabbix:/proc/scsi# fdisk /dev/sdb

Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x20d62197.

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 300 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: 300 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  300G 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/scsi# 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   96G   67G   26G  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/scsi# pvse
root@zabbix:/proc/scsi# 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               99.52 GiB
  PE Size               4.00 MiB
  Total PE              25477
  Alloc PE / Size       25417 / 99.29 GiB
  Free  PE / Size       60 / 240.00 MiB
  VG UUID               jwydJN-hcMl-GAax-wIi5-8uYr-8DoL-y4ScQA
   
root@zabbix:/proc/scsi# pvcreate /dev/sdb1
  Physical volume "/dev/sdb1" successfully created
root@zabbix:/proc/scsi# 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               99.52 GiB
  PE Size               4.00 MiB
  Total PE              25477
  Alloc PE / Size       25417 / 99.29 GiB
  Free  PE / Size       60 / 240.00 MiB
  VG UUID               jwydJN-hcMl-GAax-wIi5-8uYr-8DoL-y4ScQA
   
root@zabbix:/proc/scsi# vgextend zabbix-vg /dev/sdb1
  Volume group "zabbix-vg" successfully extended
root@zabbix:/proc/scsi# lvextend -L +100G -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/scsi# 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   96G   67G   26G  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/scsi# cat /etc/fstab 
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/mapper/zabbix--vg-root /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda1 during installation
UUID=1f34b068-e12c-4e6d-9796-13555a14c253 /boot           ext2    defaults        0       2
/dev/mapper/zabbix--vg-swap_1 none            swap    sw              0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0
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/scsi# 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  195G   67G  120G  36% /
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/scsi# 

转载于:https://my.oschina.net/ch66880/blog/1631051

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐