注:如果发现磁盘加入,但后台查询不到, 执行 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