[root@zker ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 19G 0 part
├─centos-root 253:0 0 17G 0 lvm /
└─centos-swap 253:1 0 2G 0 lvm [SWAP]
sdb 8:16 0 20G 0 disk
sr0 11:0 1 1024M 0 rom
[root@zker ~]# 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.
Command (m for help): m //打开帮助
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
g create a new empty GPT partition table
G create an IRIX (SGI) partition table
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
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): 1 //设置一个分区
First sector (2048-41943039, default 2048): //默认设置,回车
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): //默认设置,回车
Using default value 41943039
Partition 1 of type Linux and of size 20 GiB is set
Command (m for help): w //保存设置
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@zker ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 19G 0 part
├─centos-root 253:0 0 17G 0 lvm /
└─centos-swap 253:1 0 2G 0 lvm [SWAP]
sdb 8:16 0 20G 0 disk
└─sdb1 8:17 0 20G 0 part
[root@zker ~]# vim /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue Oct 8 19:10:27 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root / xfs defaults 0 0
UUID=80d1e1fd-153b-427f-b8ba-59ce34fbf06e /boot xfs defaults 0 0
/dev/mapper/centos-swap swap swap defaults 0 0
/dev/sdb1 xfs defaults 0 0