Monday, September 28, 2009

The constantly-opening Help window...

One of my users came into my office today, complaining that the Microsoft Office "Help" window kept coming up. Every time she closed it, it would open right up again.

So I go in there, and sure enough, when I close the Help window, it comes right back up! But then I look down at the keyboard... it's on a sliding keyboard tray that can go under the desk. And that's exactly where it is now -- partly under the desk, with the F1 key jammed under there and held down.

After laughing my head off, I pointed out the problem, lowered the keyboard tray a quarter-inch, and told the user to be more careful!

Tuesday, September 22, 2009

Resizing an NTFS partition with free tools

The guy that set up some of the Windows XP systems at work partitioned the drives to theoretically separate the OS (C:) from the data (D:). However, he didn't complete the process; i.e. he didn't move the default "Documents and Settings" folder, nor the "Program Files" folder to the "data" disk.

So, of course the "OS" partition eventually filled up with user data. A few months ago I moved the main user's Documents and Settings folder to the data drive, and used a junction point in the original location to point to it. That only staved off the disk filling up for a while -- this week I finally got around to deploying Office 2007, and the system didn't have enough space to install it.

I wanted to delete the "data" partition and consolidate everything into one partition. The old version of Partition Magic we had wouldn't boot the system for some reason, so I needed to find another tool to do it.

The answer: a Ubuntu 9.04 Desktop CD. The process is pretty simple. In summary, backup the data, delete all the NTFS partitions, recreate a single NTFS partition in the same cylinder space, then use ntfsresize to fix the NTFS partition.

  1. Boot the system from the Ubuntu CD. At the boot menu, select "Try Ubuntu".
  2. Open a terminal (Applications, Accessories, Terminal) and sudo to root with
    sudo -s
  3. Figure out which disk is the one you want. Likely candidates are /dev/hda (IDE) or /dev/sda (SATA). If you're not sure, use
    dmesg | less
    to find the disk device.
  4. Start fdisk on the device (e.g. fdisk /dev/sda), and print the existing partition table. Note the cylinder numbers for where the current NTFS partitions start and end (especially the start of the first NTFS partition, and the end of the last NTFS partition).
  5. Delete all of the existing NTFS partitions. Then create a single new partition, starting at the same cylinder as the first partition, but ending at the cylinder number for the last NTFS partition.
  6. Mark the NTFS partition as bootable! Exit fdisk.
  7. Resize the partition to its maximum size using ntfsresize. Read the ntfsresize man page to learn how. You may also refer to this page on shrinking an NTFS volume (starting at step 8). For example, if the device size is 32079 MB, you may try
    ntfsresize -n -s 32079M /dev/sda 
    If you don't get any errors, proceed by removing the -n option. If you get an error that the partition size cannot exceed the device size, reduce the size by 1MB (e.g. 32078M).
  8. Reboot the system with reboot. Windows will run chkdsk, reboot, and then everything should work as before.
  9. Restore the data from the lost partition (D:).