我在CentOS 7電腦上安裝了VMware Workstation 15 Pro,再裏面安裝了VMware ESXi主機。今天,我在VMware Workstation裏爲這臺主機添加了一塊NVMe的硬盤,大小隻有5G。從SSH登陸進去運行命令行,看看這個ESXi主機裏的操做系統上如何對磁盤進行分區和格式化。bash
# df -h //看到了以下的結果: Filesystem Size Used Available Use% Mounted on VMFS-6 142.5G 84.8G 57.7G 60% /vmfs/volumes/datastore1 vfat 249.7M 155.2M 94.6M 62% /vmfs/volumes/0ef1c67e-54175993-9656-932280ba9446 vfat 285.8M 172.9M 112.9M 60% /vmfs/volumes/5d653d0f-64439c8c-7b4c-000c298b51e3 vfat 249.7M 146.5M 103.2M 59% /vmfs/volumes/3e062d7e-1ad90a51-07ec-d5b812fdb036 vfat 4.0G 33.2M 4.0G 1% /vmfs/volumes/5d653d15-461dfccc-77a2-000c298b51e3 [root@172:~] fdisk -l *** *** The fdisk command is deprecated: fdisk does not handle GPT partitions. Please use partedUtil *** Found valid GPT with protective MBR; using GPT Disk /dev/disks/mpx.vmhba0:C0:T0:L0: 629145600 sectors, 0 Logical sector size: 512 Disk identifier (GUID): 5e307c8f-fd9c-488d-b3bc-d83d6fbd4321 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 629145566 Number Start (sector) End (sector) Size Name 1 64 8191 4064K 2 7086080 15472639 4095M 3 15472640 314572766 142G 5 8224 520191 249M 6 520224 1032191 249M 7 1032224 1257471 109M 8 1257504 1843199 285M 9 1843200 7086079 2560M Disk /dev/disks/t10.NVMe____VMware_Virtual_NVMe_Disk________________VMWare_NVME2D0000____00000001: 5120 MB, 5368709120 bytes, 10485760 sectors 652 cylinders, 255 heads, 63 sectors/track Units: sectors of 1 * 512 = 512 bytes Disk /dev/disks/t10.NVMe____VMware_Virtual_NVMe_Disk________________VMWare_NVME2D0000____00000001 doesn't contain a valid partition table
上面使用fdisk -l查看硬盤分區信息,提示說這個命令已通過時了,要使用partedUtil對磁盤進行格式化。ide
另外,還看到了那塊空白的磁盤,盤符看起來怪怪的。ui
# partedUtil
Not enough arguments操作系統
Usage:
Get Partitions : get <diskName>命令行
//獲取磁盤的信息3d
Set Partitions : set <diskName> ["partNum startSector endSector type attr"]*code
//設置磁盤信息
Delete Partition : delete <diskName> <partNum>
Resize Partition : resize <diskName> <partNum> <start> <end>
Get Partitions : getptbl <diskName>
Set Partitions : setptbl <diskName> <label> ["partNum startSector endSector type/guid attr"]*
Fix Partition Table : fix <diskName>
Create New Label (all existing data will be lost): mklabel <diskName> <label>
Show commonly used partition type guids : showGuids
Get usable first and last sectors : getUsableSectors <diskName>
Fix GPT Table interactively : fixGpt <diskName>
Show Partition Information : partinfo <diskName> <partNum>
Add Partition Information : add <diskName> <label> ["partNum startSector endSector type/guid attr"]orm