Xserve MegaRAID – How to stop automatic consistency check on boot

If on reboot the server does a consistency check of the RAID, this process can take a very long time. It may take upwards of 8 or more hours. There isn’t really any indication an Xserve is doing a consistency check on reboot. What happens is the Xserve boots to a gray screen or if you try to hold down the option key the screen will just sit there like it is searching for bootable partitions. Every once in a while you will see the drive activity lights blink but other than that there is no real indication the consistency check is running.

If you want to abort the consistency check and prevent it from automatically running on the next reboot of the server you can boot from a Tiger/Leopard installation CD/DVD and then launch the terminal app from that. Then you need to manually start and then stop a consistency check. After you stop the consistency check, this resets whatever flag the Xserve reads which tells it to automatically run the consistency check on reboot. So now when you reboot the Xserve it should not try to run the consistency check and instead proceed with booting the server normally. Here are the commands to manually start and stop the consistency check:

megaraid -chkcon ld -start
megaraid -chkcon ld -stop

In the commands above, replace “ld” with the logical drive number of the RAID you want to check. You can get the logical drive number by running the command: megaraid -showconfig

PHP – Code to Display Request and Post Variables

Sometimes while debugging a PHP application it is handy to display request and post variables. Here is the code that will do that:

foreach($_POST as $var=>$val)
{
 echo "$var=$val";
}

Replace POST with SESSION and it’ll work for the session variables. You can do the same with GET, but probably don’t need it.

VMware – Increase Virtual Disk Size

Sometimes you create a VMware image and later realize that you should have made the drive size larger. Fortunately in VMWare Workstation you can change the size of a disk with a simple command line program. But the command only makes your drive bigger not the actual partition the operating system resides on. It is possible to get around this problem without purchasing a product like Partition Magic. There is a free program from the OpenSource and Linux world called “QTParted”. So the first thing you need to do is resize the drive by issuing the VMware command line to resize the disk (in this case to 10Gb):

vmware-vdiskmanager -x 10GB myDisk.vmdk

Then you set the VMware session to boot off a Knoppix ISO CD image. Then run QTParted. Select the Windows Drive partition with the right mouse button and chose reseize, set the new size, and then commit the change. Your disk’s OS partition has now been increased with all data intact.

10.5 Leopard – How to Enable the Root User

Open the Directory Utility application which is located in the Applications | Utilities folder. You may have to unlock the Directory Utility application to make changes. Once it’s unlocked, go to Edit | Enable Root User, and then type in a password for your root user. You can now use the root user, and the ‘Other Users’ option now shows up on the login window.