Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1394406
  • 博文数量: 343
  • 博客积分: 13098
  • 博客等级: 上将
  • 技术积分: 2862
  • 用 户 组: 普通用户
  • 注册时间: 2005-07-06 00:35
文章存档

2012年(131)

2011年(31)

2010年(53)

2009年(23)

2008年(62)

2007年(2)

2006年(36)

2005年(5)

分类: LINUX

2010-01-15 16:34:57

Updating the VMWare ESXi Disk Dump File

 

So in my previous blog I said I used iSCSI to mount the VMware-VMvisor-big-3.5.0_Update_2-103909.i386.dd disk dump included in the VMWare ESXi install...I recieved a few comments about this as it is a heavy handed way of getting the support you need, so I figured out a non-iscsi way of mounting the VMware-VMvisor-big-3.5.0_Update_2-103909.i386.dd file.

If you haven't read my other blog the VMware-VMvisor-big-3.5.0_Update_2-103909.i386.dd file is on the VMWare installer media inside the install.tgz file as VMware-VMvisor-big-3.5.0_Update_2-103909.i386.dd.bz2. This file is a bziped disk dump of a complete hard drive...it has 6 partitions defined inside of it. The first thing you need to do is determine the offset to the parttition you wish to mount..in our case that is most likely partition 5 as it contains the oem.tgz file:

  1. Untar-gz install.tgz (mkdir /tmp/esx-temp; tar -xzvf install.tgz -C /tmp/esx-temp)
  2. Unbzip2 the disk image (cd /tmp/esx-temp/usr/lib/vmware/installer;bunzip2 VMware-VMvisor-big-3.5.0_Update_2-103909.i386.dd.bz2)
  3. Determine the sector size (fdisk -ul VMware-VMvisor-big-3.5.0_Update_2-103909.i386.dd)

This should print out the following:

 

[root@cbrunner-f8 installer]# fdisk -ul VMware-VMvisor-big-3.5.0_Update_2-103909.i386.dd
You must set cylinders.
You can do this from the extra functions menu.
Disk VMware-VMvisor-big-3.5.0_Update_2-103909.i386.dd: 0 MB, 0 bytes
64 heads, 32 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00000000
Device Boot      Start         End      Blocks   Id  System
VMware-VMvisor-big-3.5.0_Update_2-103909.i386.dd1            8192     1535999      763904    5  Extended
VMware-VMvisor-big-3.5.0_Update_2-103909.i386.dd4   *          32        8191        4080    4  FAT16 <32M
VMware-VMvisor-big-3.5.0_Update_2-103909.i386.dd5            8224      106495       49136    6  FAT16
VMware-VMvisor-big-3.5.0_Update_2-103909.i386.dd6          106528      204799       49136    6  FAT16
VMware-VMvisor-big-3.5.0_Update_2-103909.i386.dd7          204832      430079      112624   fc  Unknown
VMware-VMvisor-big-3.5.0_Update_2-103909.i386.dd8          430112     1535999      552944    6  FAT16
Partition table entries are not in disk order

 

As you can see the sector size is 512 bytes...so now you can mount any of the partions by passing the "offset" option to mount with a value equal to the start block * 512. Here are the steps...

  1. Make a temp mout directory (mkdir /tmp/esx-5)
  2. Mount the partition 5 through the loopback device (mount -o loop,offset=$((512*8224)) VMware-VMvisor-big-3.5.0_Update_2-103909.i386.dd /tmp/esx-5/ )

The $((512*8224)) automatically does the multiplication for you...isn't that nice. (Note 8224 is the start block for partition 5). At this point if you do a "ls /tmp/esx-5" you get:

 

[root@cbrunner-f8 installer]# ls /tmp/esx-5/
binmod.tgz  boot.cfg  cim.tgz  environ.tgz  license.tgz  oem.tgz  vmkernel.gz

 

You can now update the oem.tgz file. When you are done you need to "umount /tmp/esx-5 ", bzip the disk image "bzip2 VMware-VMvisor-big-3.5.0_Update_2-103909.i386.dd", and then rebuild install.tgz (cd /tmp/esx-temp/; tar czvf ../install.tgz sbin/ usr/).

-Cameron

阅读(1665) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~