Wednesday, January 12, 2011

Exapnding ext4 root filesystem

Almost doomed the box while doing it :)

resize2fs utility allows you to expand e2fs filesystem online but there is a catch -> you cannot expand the filesystem beyond its partition boundary. Your filesystem is most likely using entire partition anyway.

- Use fdisk and first "p"rint the existing partition table

Disk /dev/sda: 8032 MB, 8032092160 bytes
64 heads, 32 sectors/track, 7660 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Disk identifier: 0x00027054
Device Boot Start End Blocks Id System
/dev/sda1 * 1 7660 7843824 83 Linux

- Note the Start and End of the partition and partition number (sda"X")
- Delete the required partition
- Create same partition again. Use same partition number and start cylinder number
- fdisk should prompt you with maximum number cylinders you can expand to. You might need to delete partitions before doing this.
- "p"rint the partition table again and make sure that the partition number and start cylider matches
- Make sure that you toggle the bootable flag if the partition was already bootable. I missed this step and subsequent boot failed. Luckily the bootable installation media was around
- "w"rite the changes, exit and reboot. (You can abort at this step and you would be still fine if you wish not to continue)
- After reboot, resize the filesystem

root@atom:~# resize2fs /dev/sda1
resize2fs 1.41.9 (22-Aug-2009)
Filesystem at /dev/sda1 is mounted on /; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/sda1 to 1960956 (4k) blocks.
The filesystem on /dev/sda1 is now 1960956 blocks long.

- Enjoy!
NOTE: As long as your partition table is properly aligned on cylinder boundaries, you should be ok. These steps worked for me and you can follow them on your own :)

Tuesday, January 11, 2011

Installing VMware ESXi 3.5 on Intel Atom D945GCLF2 using USB Flash drive

11th day of the month seems to be a potential VMware day. After the initial failed attemtps to install VMware on Intel Atom board, I tried to install ESXi 3.5 today after more than an year :)

First, I was not aware that VMware ESXi installation can be customised. After I came to know that this can be done, I could not succeed, for the fact that I was using Windows to achieve this :) The hard disk crashed and took the Windows installation with it. Ubuntu came to rescue. A pen drive based installation was quickly done.

Customizing ESXi for Realtek 8168 NIC on D945GCLF2 seems straightforward (After I managed to get it done after 1+ year :D )

- Download ESXi 3.5 ISO image from VMware site
- Extract the image and locate VMware-VMvisor-big-3.5.0_Update_5-207095.i386.dd.bz2
- Extract VMware-VMvisor-big-3.5.0_Update_5-207095.i386.dd from above file
- Use dd to transfer this image on a flash drive
dd if=VMware-VMvisor-big-3.5.0_Update_5-207095.i386.dd of=/dev/sdX bs=100M count=1
- Re-insert the flash drive into slot and mount Hypervisor1 partition
- obtain custom oem.tgz ( and overwrite in the mounted partition
- Restart and boot with the new drive :)

The onboard SATA controller (ICH7) has been discovered but there is no disk connected. Once I get the failed disk repaired, can check if its detected in native mode.

Till then back to diskless Ubuntu :)