Welcome to fdisk (util-linux 2.31.1). Changes will remain in memory only, until you decide towrite them. Be careful before using the writecommand.
Command (mforhelp): m ------------------获取帮助 Help:
DOS (MBR) a toggle a bootable flag bedit nested BSD disklabel c toggle the dos compatibility flag
Generic d deletea partition F list free unpartitioned space llist known partition types n addanew partition pprint the partition table t changea partition type v verify the partition table i print information about a partition
Misc mprint this menu uchangedisplay/entry units x extra functionality (experts only)
Script I load disk layout from sfdisk script file O dump disk layout to sfdisk script file
Save & Exit wwrite table to disk andexit q quit without saving changes
Create anew label g create anewempty GPT partition table G create anewempty SGI (IRIX) partition table o create anewempty DOS partition table s create anewempty Sun partition table Command (mforhelp): n ----------创建新分区 Partition type p primary (1 primary, 0 extended, 3 free) e extended (container for logical partitions) Select (default p): p --------------选择主分区 Partition number (2-4, default 2): 2 -------------分区号,默认是2(系统不一样,默认值不一样) First sector (41940992-52428799, default 41940992): --------直接回城选择默认 Last sector, +sectors or +size{K,M,G,T,P} (41940992-52428799, default 52428799): ----直接回城选择默认
Created anew partition 2 of type'Linux'and of size 5 GiB.
Command (mforhelp): t -----------修改分区格式 Partition number (1,2, default 2): 2 ----------刚才选择的分区号(对应上面的2) Hex code (type L tolistall codes): 8e --------8e是lvm磁盘类型
Changed type of partition 'Linux'to'Linux LVM'.
Command (mforhelp): p ------打印分享信息(可以看到刚才选择的2,多出/dev/sda2,也就是要增加的5G空间) Disk /dev/sda:25 GiB, 26843545600 bytes, 52428800 sectors 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: 0x4a53929f
Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048419409914193894420G 83 Linux /dev/sda2 4194099252428799104878085G 8e Linux LVM
Command (mforhelp): w -----------------保存 The partition table has been altered. Syncing disks.