[root@worker2 zjc]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sr0 11:0 1 1024M 0 rom nvme0n1 259:0 0 15G 0 disk ├─nvme0n1p1 259:1 0 300M 0 part /boot ├─nvme0n1p2 259:2 0 1.5G 0 part [SWAP] └─nvme0n1p3 259:3 0 13.2G 0 part / nvme0n2 259:4 0 1G 0 disk [root@worker2 zjc]# mkdir /myminio1 [root@worker2 zjc]# fdisk /dev/nvme0n2
Welcome to fdisk (util-linux 2.32.1). 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 0x21103257.
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-2097151, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-2097151, default 2097151):
Created a new partition 1 of type 'Linux' and of size 1023 MiB.
Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks.
[root@worker2 zjc]#
结果:
1 2 3 4 5 6 7 8 9
[root@worker2 zjc]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sr0 11:0 1 1024M 0 rom nvme0n1 259:0 0 15G 0 disk ├─nvme0n1p1 259:1 0 300M 0 part /boot ├─nvme0n1p2 259:2 0 1.5G 0 part [SWAP] └─nvme0n1p3 259:3 0 13.2G 0 part / nvme0n2 259:4 0 1G 0 disk └─nvme0n2p1 259:5 0 1023M 0 part