2021-05-12 14:32:11
製作 ESXi 5.1 的USB快閃記憶體「引導安裝」盤
製作 ESXi 5.1 的USB快閃記憶體"引導安裝"盤
1 準備工作
linux 系統 //我這裡是Ubuntu 12.04
U盤一個 //8GB kingston
ESXi ISO檔案 //vmware 官網下載 VMware-VMvisor-Installer-5.1.0-799733.x86_64.iso,XXXXXX為內部版本號
2. 為U盤建立分割區表
- fdisk /dev/sdb
"d" 刪除全部分割區
"n" 建立遍及整個磁碟的主分割區1
"t" 設定檔案系統為FAT32(LBA),程式碼為"c"
"a" 設定主分割區1的Boot標記
"p" 列印分割區表
結果應類似下表:
Disk /dev/sdb: 8076 MB, 80761322352 bytes
186 heads, 28 sectors/track, 3028 cylinders
Units = cylinders of 5208 * 512 = 2666496 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 3029 7885824 c W95 FAT32 (LBA)
"w" 寫入分割區表並退出
注意:如有疑問可以參考最後的 fdisk 詳細過程。
3. 使用FAT32檔案系統格式化U盤
- mkfs.vfat -F 32 -n ESXi /dev/sdb1
4. 安裝syslinux並寫入MBR
- syslinux /dev/sdb1
- cat /usr/lib/syslinux/mbr.bin > /dev/sdb
5. 掛載U盤
- mount /dev/sdb1 /mnt/usb
6. 掛載ESXi安裝程式ISO映象
- mount -o loop VMware-VMvisor-Installer-5.1.0-799733.x86_64.iso /mnt/iso
7. 將ISO映象的內容複製到U盤
- cp -r /mnt/iso/* /mnt/usb/
8. 將isolinux.cfg檔案重新命名為syslinux.cfg
- mv /mnt/usb/isolinux.cfg /mnt/usb/syslinux.cfg
9. 編輯syslinux.cfg 檔案
- vim /mnt/usb/syslinux.cfg
在/mnt/usb/syslinux.cfg 檔案中,將APPEND -c boot.cfg 一行更改為 APPEND -c boot.cfg -p 1。
10. 拷貝一個新的menu.c32檔案到U盤,覆蓋原來的檔案
- cp /usr/lib/syslinux/menu.c32 /mnt/usb/
注意:這步並不在VMware vSphere官方手冊 中,如沒有此步驟,引導時會出現“menu.c32: not a COM32R image”這樣的錯誤。
11. 解除安裝U盤
umount /mnt/usb
12. 解除安裝ISO映象
umount /mnt/iso
完工:現在U盤可以引導安裝ESXi 5.1 了
fdisk 詳細過程,注意紅色字
- fdisk /dev/sdb
Command (m for help): p
Disk /dev/sdb: 8166 MB, 8166703104 bytes
64 heads, 32 sectors/track, 7788 cylinders, total 15950592 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
Disk identifier: 0x4bd294d1
Device Boot Start End Blocks Id System
/dev/sdb1 * 0 3311615 1655808 17 Hidden HPFS/NTFS
Command (m for help): d
Selected partition 1
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-15950591, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-15950591, default 15950591):
Using default value 15950591
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): c
Changed system type of partition 1 to c (W95 FAT32 (LBA))
Command (m for help): a
Partition number (1-4): 1
Command (m for help): p
Disk /dev/sdb: 8166 MB, 8166703104 bytes
64 heads, 32 sectors/track, 7788 cylinders, total 15950592 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
Disk identifier: 0x4bd294d1
Device Boot Start End Blocks Id System
/dev/sdb1 * 2048 15950591 7974272 c W95 FAT32 (LBA)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
本文永久更新連結地址:http://www.linuxidc.com/Linux/2017-02/140750.htm
相關文章