磁盘扩容

注:如果发现磁盘加入,但后台查询不到, 执行 echo "- - -" >/sys/class/scsi_host/host*/scan

[root@localhost ~]# fdisk /dev/sdb

Welcome to fdisk (util-linux 2.23.2).

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

Building a new DOS disklabel with disk identifier 0xa76d6815.

Command (m for help): n

Partition type:

  p  primary (0 primary, 0 extended, 4 free)

  e  extended

Select (default p): p

Partition number (1-4, default 1):

First sector (2048-20971519, default 2048):

Using default value 2048

Last sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519):

Using default value 20971519

Partition 1 of type Linux and of size 10 GiB is set

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

partprobe /dev/sdb

[root@localhost ~]# fdisk -l

mkfs.ext4 /dev/sdb1

pvcreate /dev/sdb1

pvdisplay

vgextend centos /dev/sdb1

pvs

lvs

lvextend -L +10G -n /dev/mapper/centos-root

xfs_growfs /dev/centos/root

df -h

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容