1

Topic: resizing windows

My wife has a 40 GB HD with dual boot to XP & ubuntu. She wants to go back to a single XP  OS. Please advise what I must do for her. I do have gparted live CD.

2 (edited by cmdr 2009-07-08 15:09:04)

Re: resizing windows

Hello texas.chef94,

General precautions :

1. Backup all, that you don't want to loose in a worst case scenario.

2. Use LATEST stable version of "GParted" (0.4.5-3, at the moment).

3. If you don't have a built-in CDROM- or DVD drive (as with "netbook" portables), use an external one (provided your system boots from it) or use a bootable USB flash stick and install "GParted" on it.

4. Defragment and clean your XP partition (delete temporary and dispensable files), run "chkdsk /f /r" multiple times, so that you have a clean filesystem, too.

5. Set "virtual memory" to zero ( XP detects at first boot, that it's missing and reinstalls it).


Possible pitfalls :

1. GRUB : Ubuntu uses GRUB as bootmanager. GRUB installs its own bootmanager in Master Boot Record and perhaps other parts elsewhere (keyword : stages). If you just delete "Ubuntu", GRUB will NOT work anymore and XP is not bootable with its remnants. Therefore you need to reinstall a MS-DOS/Windows/Intel (all terms for the same) MBR code with a XP Installation CDROM (recovery console , command "fixmbr"). I would do this prior to delete or repartition anything ! You just kick GRUB out, partition table is not touched.

2. Boot Records : GRUB launched the existing XP installation by "chainloading" NTLDR directly, i.e. neither the bootflag nor the Partition Boot Record code (PBR; responsible for the filesystem, probably NTFS) played a role up to now (check the GRUB XP starting commands by regarding "/boot/Grub/menu.lst" on the "Ubuntu" partition or a separate small boot partition). With XP, stand-alone PBR must be bootable, too, and bootflag must be set to the same partition. Recovery console command "fixboot <Driveletter>: " writes an appropriate PBR to a partition.
Bootflag (always single!) may be easily set with "GParted". Note, that "GParted" does NEVER write a DOS bootable PBR, when you use it to format a partition. Why ? Linux bootmanagers install their own "mechanism", and there are no license conflicts with M$ ! If you are not quite sure, what driveletter your booting partition will have (and XP is the only "survivor"), you may write it to all present (Windows visible) partitions with no harm. With a successfully booting XP, it's always C: .

3. "Cylinder alignment" : if you intend to resize the existing XP partition (by merging it with the former Ubuntu partition, UNCHECK "Cylinder alignment" ("GParted" !), or there might be an unintended move of the whole partition, which caused trouble in the past and  -most of all- wastes time and drive space.

4. "Boot.ini" : probably you have to edit "Boot.ini" (a hidden file in the root directory of the bootable partition; you might use "GParted's" nano for that purpose or better Ubuntu's geany). Maybe partition numbering changed. A good idea is, to have menu items for all (up to four) possible primary partitions. At first boot, you test an item. If it fails, use the next and so on, until it works. Increase timeout to 30 sec for your ease. Delete wrong menu items afterwards from within XP.

More advice is possible, if you show the present partitioning of the involved harddisk.
Use fdisk -lu in a "GParted" Terminal window and give us the print-out.

Regards
cmdr

3

Re: resizing windows

In a few cases the ntfs resizing operation could fail in the initial check or simulation phase. In this case, you can try the same operation by several steps.
It was reported for shrinking operations, however it is better to know this, just in case...

*** It is highly recommended to backup any important files before doing resize/move operations. ***

4

Re: resizing windows

In a few cases the ntfs resizing operation could fail in the initial check or simulation phase. In this case, you can try the same operation by several steps...

For NTFS, it may be a good idea, to do simulations prior to apply the resizing operation with "GParted" (see below) , just to get a suitable resizing value. Please note, that a working Windows system needs 15 to 20 % free space at minimum on its bootable partition.  "Gparted" doesn't care about that, it's your task !

Example:
Simulate resizing NTFS to 100 GB on drive /dev/sda1
(double click on "Terminal" icon, type commandline and press [Enter])

ntfsresize -n -s 100G /dev/sda1

Repeat it with other values, if necessary, until there are no more errors.

Regards
cmdr