[root@localhost ~]# fdisk /dev/sdb 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. Device does not contain a recognized partition table. Created a new DOS disklabel with disk identifier 0x75aabeb7. Command (m for help): p #查看当前分区表 Disk /dev/sdb: 10 GiB, 10737418240 bytes, 20971520 sectors Disk model: Virtual disk Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x75aabeb7 Command (m for help): n#创建新分区 Partition type pprimary(0 primary, 0 extended, 4 free) eextended(container for logical partitions) Select (default p): p # 选择主分区 Partition number (1-4, default 1):# 分区号,直接回车使用默认值1 First sector (2048-20971519, default 2048): # 起始扇区,直接回车使用默认 Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-20971519, default 20971519): # 结束扇区,直接回车使用整个硬盘 Created a new partition 1 of type 'Linux' and of size 10 GiB. Command (m for help): t #更改分区类型 Selected partition 1 Hex code or alias (type L to list all): 8e # 设置LVM分区类型 Changed type of partition 'Linux' to 'Linux LVM'. Command (m for help): p # 验证分区表 Disk /dev/sdb: 10 GiB, 10737418240 bytes, 20971520 sectors Disk model: Virtual disk Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x75aabeb7 DeviceBoot StartEndSectors Size Id Type /dev/sdb12048 20971519 2096947210G 8e Linux LVM Command (m for help): w#保存并退出 The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. [root@localhost ~]# |