正解:
# Check the disk layout
[root@node2 ~]# lsblk
# Partition the disk
[root@node2 ~]# fdisk /dev/vdb
Welcome to fdisk (util-linux 2.37.4).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): n # Add a new partition
Partition type
p primary (1 primary, 0 extended, 3 free) # Primary partition
e extended (container for logical partitions) # Extended partition
Select (default p): p
Partition number (2-4, default 2): # Press Enter
First sector (1026048-20971519, default 1026048): # Press Enter
***Note: The partition size must be larger than the total size, it should not be exactly equal to. It is recommended to add an extra 200M.
Last sector, +/-sectors or +/-size{K,M,G,T,P} (1026048-20971519, default 20971519): +1200M # Partition size
Created a new partition 2 of type 'Linux' and of size 512 MiB.
Command (m for help): w # Save and exit
The partition table has been altered.
Syncing disks.
# Create volume group and logical volume
[root@node2 ~]# vgcreate -s 16M myvg /dev/vdb4
[root@node2 ~]# lvcreate -l 50 -n mylv myvg
# Install vfat support
[root@node2 ~]# yum provides */mkfs.vfat
[root@node2 ~]# yum -y install dosfstools
# Format the logical volume with vfat filesystem
[root@node2 ~]# mkfs.vfat /dev/myvg/mylv
# Create mount point
[root@node2 ~]# mkdir /mnt/mydata
# Update /etc/fstab for automatic mounting
[root@node2 ~]# vim /etc/fstab
/dev/myvg/mylv /mnt/mydata vfat defaults 0 0
# Mount the logical volume
[root@node2 ~]# mount -a