Thursday, April 8, 2010

Shrinking a VirtualBox image

I followed the tutorial "How to Shrink Your VirtualBox VM" and found it's very useful to reduce the image size. Since I'm using the Oracle Enterprise Linux as the guest, I need to get the zerofree rpm package first.

1) Verify the current disk partition of the OEL guest (e.g. /dev/hda3)

2) Assign a OEL Boot into Linux rescue mode (e.g. using OEL or OVM) and mount the file system as read only.
# mount -n -o remount,ro -t ext3 /dev/hda3 /
# zerofree /dev/hda3
3) Shutdown the OEL VM.
# shutdown -h now
# poweroff

4) Shrink the VM (from the host OS)
# vboxmanage modifyhd EnterpriseLinux.vdi compact

For the guest VMs, such as Ubunutu 9.10 where ext4 file system is used, I can not get zerofree to work; but a good workaround is to CloneVDI tool.

Thursday, April 1, 2010

Recover from a failed upgrade with ZFS

Working on my SPARC box, I came across some serious issues during the upgrade and must revert back to a previous boot environment (ZFS as the root file system). So I logged into ILOM service processor, sent a break to bring the system to the OK prompt, then specified the boot environment. Now I'm recovered from a failed upgrade. It's really cool!

-> set /HOST send_break_action=break
Set 'send_break_action' to 'break'

-> start /SP/console
Are you sure you want to start /SP/console (y/n)? y

Serial console started. To stop, type #.
Debugging requested; hardware watchdog suspended.
Type 'go' to resume

{0} ok boot disk -Z rpool/ROOT/snv_134