1, adding a hard drive in the virtual machine:
2、
fdisk /dev/sdb
N input add new partitions;
(Enter the e partition for the expansion of the input parameters p to create a primary partition)
Use m Command Usage View
Continue to use the disk partition information see p devices
w save and exit
3, file / dev / sdb1 # View the information is synchronized to the kernel
If not synchronized (input): partprobe
4, format the partition
mkfs.xfs /dev/sdb1
5、
Disposable mounted storage device (restart after failure)
mount /dev/sdb1 /test/
Permanent mount device (at the end add)
vim /etc/fstab
/dev/sdb1 /test/ xfs defaults 0 0
Check with df -h lsblk or success
6, add the swap partition
fdisk /dev/sdb
Remember to save and exit execution w
6.1 SWAP partitions using proprietary format command mkswap
mkswap /dev/sdb2
7, swapon the prepared SWAP partition device mounted to the system
swapon /dev/sdb2
free -m (see the swap partition)
8, in order to efficiently restarted, modify etc / fatab configuration
vim /etc/fatab
/dev/sdb2 swap swap defaults 0 0