Welcome to fdisk (util-linux 2.34). 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. Created a new DOS disklabel with disk identifier 0x29c5f384.
Command (m for help): n Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): p Partition number (1-4, default 1): First sector (2048-419430399, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-419430399, default 419430399):
Created a new partition 1 of type 'Linux' and of size 200 GiB.
Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks.
将分区进行格式化
1
sudo mkfs.ext4 /dev/vdb1
创建挂载目录,并将分区挂载到目录
1 2
sudo mkdir /mnt/vdb sudo mount /dev/vdb1 /mnt/vdb
上面挂载是临时的,重启后会失效,需要修改fstab文件,开启自动挂载
1
echo '/dev/vdb1 /mnt/vdb ext4 defaults 0 0' | sudo tee -a /etc/fstab