J4125 小主机,ESXI下 硬盘分区
1 2 | https://www.bilibili.com/read/cv11563836?ivk_sa=1024320u https://blog.csdn.net/lziccard/article/details/113121114 |
1)Esxi 开启ssh.
2)查看硬盘信息
1 | ls /vmfs/devices/disks |
返回如下信息
1 2 3 4 5 6 | t10.ATA_____MSATA_SSD_128G__________________________AA000000000000001501 vml.010000000041413030303030303030303030303030313530314d5341544120 t10.ATA_____MSATA_SSD_128G__________________________AA000000000000001501:1 vml.010000000041413030303030303030303030303030313530314d5341544120:1 t10.ATA_____MSATA_SSD_128G__________________________AA000000000000001501:5 vml.010000000041413030303030303030303030303030313530314d5341544120:5 t10.ATA_____MSATA_SSD_128G__________________________AA000000000000001501:6 vml.010000000041413030303030303030303030303030313530314d5341544120:6 t10.ATA_____MSATA_SSD_128G__________________________AA000000000000001501:7 vml.010000000041413030303030303030303030303030313530314d5341544120:7 t10.ATA_____MSATA_SSD_128G__________________________AA000000000000001501:8 vml.010000000041413030303030303030303030303030313530314d5341544120:8 |
输入如下代码
1 | partedUtil getptbl /dev/disks/t10.ATA_____MSATA_SSD_128G__________________________AA000000000000001501 |
返回如下信息:
1 2 3 4 5 6 7 | gpt 15566 255 63 250069680 1 64 204863 C12A7328F81F11D2BA4B00A0C93EC93B systemPartition 128 5 208896 8595455 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0 6 8597504 16984063 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0 7 16986112 25374719 4EB2EA3978554790A79EFAE495E21F8D vmfsl 0 8 25374720 250066944 AA31E02A400F11DB9590000C2911D1B8 vmfs 0 |
3)删除这块硬盘 ,重新分一个区(120G)
输入如下代码
1 | partedUtil getptbl /dev/disks/t10.ATA_____MSATA_SSD_128G__________________________AA000000000000001501 |
返回如下信息:
1 2 3 4 5 6 | gpt 15566 255 63 250069680 1 64 204863 C12A7328F81F11D2BA4B00A0C93EC93B systemPartition 128 5 208896 8595455 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0 6 8597504 16984063 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0 7 16986112 25374719 4EB2EA3978554790A79EFAE495E21F8D vmfsl 0 |
4)添加2分区
1 2 3 4 5 6 | partedUtil setptbl /dev/disks/t10.ATA_____MSATA_SSD_128G__________________________AA000000000000001501 gpt \ "1 64 204863 C12A7328F81F11D2BA4B00A0C93EC93B 128" \ "5 208896 8595455 EBD0A0A2B9E5443387C068B6B72699C7 0" \ "6 8597504 16984063 EBD0A0A2B9E5443387C068B6B72699C7 0" \ "7 16986112 25374719 4EB2EA3978554790A79EFAE495E21F8D 0" \ "2 25374720 250066944 AA31E02A400F11DB9590000C2911D1B8 0" |
说明:第一位2是vmfs分区编号,
25374720 是25374719 +1,
250066944是最后扇区的位置,
AA31E02A400F11DB9590000C2911D1B8是vmfs分区标识。
原有分区信息直接复制partedUtil getptbl列出来的信息(复制后注意去掉分区编号说明的字母),每一个分区信息用半角引号引起来
25374720 是25374719 +1,
250066944是最后扇区的位置,
AA31E02A400F11DB9590000C2911D1B8是vmfs分区标识。
原有分区信息直接复制partedUtil getptbl
5)再次输入 partedUtil getptbl
1 | partedUtil getptbl /dev/disks/t10.ATA_____MSATA_SSD_128G__________________________AA000000000000001501 |
6)对2分区进行格式化
vmkfstools -C vmfs6 -b 1m -S mSTAT_Datastore
1 | vmkfstools -C vmfs6 -b 1m -S data1 /dev/disks/t10.ATA_____MSATA_SSD_128G__________________________AA000000000000001501:2 |
说明:vmfs6是指用vmfs6格式,如果在其它esxi版本不支持vmfs6时,可以改为vmfs5,
命令最后的“:2”指针对数据分区(类型为3)进行格式化,
-S data1是存储的名字,可自行定义。
命令最后的“:2”指针对数据分区(类型为3)进行格式化,
-S data1是存储的名字,可自行定义。
7)格式化成功后,就可以在esxi控制台看到data1的数据分区
8)把120G的1个区删掉,测试一下能不能分成两个区(40G+80G).
输入如下代码
1 | partedUtil getptbl /dev/disks/t10.ATA_____MSATA_SSD_128G__________________________AA000000000000001501 |
返回如下信息:
1 2 3 4 5 6 | gpt 15566 255 63 250069680 1 64 204863 C12A7328F81F11D2BA4B00A0C93EC93B systemPartition 128 5 208896 8595455 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0 6 8597504 16984063 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0 7 16986112 25374719 4EB2EA3978554790A79EFAE495E21F8D vmfsl 0 |
9)添加2分区,3分区
1 2 3 4 5 6 7 | partedUtil setptbl /dev/disks/t10.ATA_____MSATA_SSD_128G__________________________AA000000000000001501 gpt \ "1 64 204863 C12A7328F81F11D2BA4B00A0C93EC93B 128" \ "5 208896 8595455 EBD0A0A2B9E5443387C068B6B72699C7 0" \ "6 8597504 16984063 EBD0A0A2B9E5443387C068B6B72699C7 0" \ "7 16986112 25374719 4EB2EA3978554790A79EFAE495E21F8D 0" \ "2 25374720 100272128 AA31E02A400F11DB9590000C2911D1B8 0" \ "3 100272129 250066944 AA31E02A400F11DB9590000C2911D1B8 0" |
2分区占1/3,3分区占2/3
(250066944-25374720)/3=74897408
25374720+74897408=100272128
(250066944-25374720)/3=74897408
25374720+74897408=100272128
说明:第一位2是vmfs分区编号,
25374720 是25374719 +1,
100272128是刚才计算的1/3位置,
AA31E02A400F11DB9590000C2911D1B8是vmfs分区标识。
原有分区信息直接复制partedUtil getptbl列出来的信息(复制后注意去掉分区编号说明的字母),每一个分区信息用半角引号引起来
25374720 是25374719 +1,
100272128是刚才计算的1/3位置,
AA31E02A400F11DB9590000C2911D1B8是vmfs分区标识。
原有分区信息直接复制partedUtil getptbl
10)再次输入 partedUtil getptbl
1 | partedUtil getptbl /dev/disks/t10.ATA_____MSATA_SSD_128G__________________________AA000000000000001501 |
11)对2分区,3分区进行格式化
vmkfstools -C vmfs6 -b 1m -S mSTAT_Datastore
1 2 | vmkfstools -C vmfs6 -b 1m -S data2 /dev/disks/t10.ATA_____MSATA_SSD_128G__________________________AA000000000000001501:2 vmkfstools -C vmfs6 -b 1m -S data3 /dev/disks/t10.ATA_____MSATA_SSD_128G__________________________AA000000000000001501:3 |
12)格式化成功后,就可以在esxi控制台看到data2,data3的数据分区
备注:
1. 关于扇区最后位置有人是按 15566 * 255 * 63 – 1 = 250067789 计算,也有人是按 “250069680-40=250069640″ ,这两个我试过都成功不了,我用原本的最后扇区位置 250066944 就成功.
2. 【” \ 】这两个符号一定要用半角,否则会出现如下报错”Too many partitions (30)”.
1. 关于扇区最后位置有人是按 15566 * 255 * 63 – 1 = 250067789 计算,也有人是按 “250069680-40=250069640″ ,这两个我试过都成功不了,我用原本的最后扇区位置 250066944 就成功.
2. 【” \ 】这两个符号一定要用半角,否则会出现如下报错”Too many partitions (30)”.
1 2 3 | Too many partitions (30) Invalid Partition information |