![](https://csdnimg.cn/release/download_crawler_static/86271398/bg1.jpg)
[root@localhost ~]# mkdir /part-ext4 /part-xfs
[root@localhost ~]# fdisk /dev/sdb
[root@localhost ~]# fdisk -l |grep /dev/sdb
Disk /dev/sdb: 10.7 GB, 10737418240 bytes, 20971520 sectors
/dev/sdb1 2048 2099199 1048576 83 Linux
/dev/sdb2 2099200 6293503 2097152 83 Linux
/dev/sdb3 6293504 10487807 2097152 82 Linux swap / Solaris
[root@localhost ~]# mkfs.xfs /dev/sdb2
[root@localhost ~]# mkswap /dev/sdb3
[root@localhost ~]# mkfs.ext4 /dev/sdb1
[root@localhost ~]# swapon /dev/sdb3
[root@localhost ~]# free -m
[root@localhost ~]# tail -2 /etc/fstab
/dev/sdb1 /part-ext4 ext4 defaults 0 0
/dev/sdb2 /part-xfs xfs defaults 0 0
[root@localhost ~]# mount -a
[root@localhost ~]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 974M 0 974M 0% /dev
tmpfs tmpfs 991M 0 991M 0% /dev/shm
tmpfs tmpfs 991M 11M 980M 2% /run
tmpfs tmpfs 991M 0 991M 0% /sys/fs/cgroup
/dev/mapper/centos-root xfs 50G 4.8G 46G 10% /
/dev/sr0 iso9660 4.4G 4.4G 0 100% /media/cdrom
/dev/mapper/centos-home xfs 47G 33M 47G 1% /home
/dev/sda1 xfs 1014M 171M 844M 17% /boot
tmpfs tmpfs 199M 4.0K 199M 1% /run/user/42
tmpfs tmpfs 199M 32K 199M 1% /run/user/0
/dev/sdb1 ext4 976M 2.6M 907M 1% /part-ext4