Help with reclaiming disk space and partitions

Talk about anything related to the UBCD, PC troubleshooting etc.

Moderators: Icecube, StopSpazzing

Post Reply
Message
Author
twst
Posts: 3
Joined: Fri Nov 12, 2010 8:35 am

Help with reclaiming disk space and partitions

#1 Post by twst » Fri Nov 12, 2010 8:42 am

I installed Ubuntu on my laptop and would like it removed because I need the space back. I have Windows XP and Ubuntu currently.

How can I remove Ubuntu and get that old partition back for Windows to use with the latest version of UBCD (V5.0.3)?

Thanks!

ady
Posts: 832
Joined: Sat May 08, 2010 5:26 am

Re: Help with reclaiming disk space and partitions

#2 Post by ady » Fri Nov 12, 2010 11:37 am

If you can currently boot into Windows, you actually don't need anything else to do what you want.

But, if anything goes wrong, it is always advisable to have a backup of your data, a Windows CD (for recoverable console), and having UBCD is certainly a plus.

Now, to answer to your question. You haven't mentioned the current boot loader your system is using (that is, the software that let's you choose which OS is going to boot).

Probably your boot loader is not the one that comes with Windows, so if you delete your Ubuntu partition, it is possible you get a system that you can't boot.

So, to avoid this problem, from Windows you should open an ADMISTRATOR command line and type:

Fdisk /MBR

and then press <enter>.

Even when this is a simple command, with a well known result in systems where everything is working as it should, there is always a chance that something could result wrong. So that's why I recommend having a backup, and the Windows CD, and UBCD, BEFORE proceeding.

After running "fdisk /mbr", you should reboot and start Windows again. This time, there shouldn't be any boot menu, and from the boot process point of view, Ubuntu is not there any more (no "boot menu" to choose the OS).

(If the reboot into Windows fails, don't panic. All the info is still there in your hard disk, and the system is still recoverable).

The boot process now behaves as if Windows is the only OS. If the boot menu still shows up, then the "fdisk /mbr" didn't work. If this is the case, come back to report and get help before continuing.

Now, again in Windows, go to Administrative tools, start "Computer Management", and go to the "Storage" section.

Typically, you should see there your hard disk, with the Windows System Partition (c:), and other partitions, where you still have Ubuntu, and the Linux Swap.

Selecting (right-clicking) those "other" partitions, you have the option to delete them. That's how you delete Ubuntu and the Linux Swap partitions and you leave Windows alone. (You haven't any useful data in those partition, correct?)

Very important: do not guess!!! At any point, if you have doubts, check the Windows Help, or search for answers, or come back here and ask again.

Even before running fdisk, you can go to "Computer Management -> Storage" and check that everything there is displayed as you expect. Check that you see the partitions you expect, that you see the Windows System Boot partition, and that it is the "C:" partition. Be sure you select the correct partitions before actually deleting them. You don't want to delete the Windows partition, or any other partition containing data that you need.

If you first of all check "Computer Management -> Storage" and everything is as you expect, then you can close it without actually deleting anything, and just *then* start with the "fdisk /mbr" command line.

Once again (I want to be more than clear, sorry): do not guess; be sure about what you are doing, and if you have doubts, stop and search for help before proceeding.

If by any chance something results in an unexpected situation, do not panic and come back to report. Almost always the solution is more simple if you ask first, instead of "trying" to solve a problem without actually knowing what you are doing.

To sum up, from Windows:
1) fdisk /mbr
2) delete unuseful partitions

All these steps result in Windows being the only OS, Ubuntu and the Linux Swap deleted, but you haven't YET got your new free space back.

When you finish with the first part (2 steps), come back and we can continue with how to recover the space (so you can use it from Windows).

twst
Posts: 3
Joined: Fri Nov 12, 2010 8:35 am

Re: Help with reclaiming disk space and partitions

#3 Post by twst » Fri Nov 12, 2010 12:30 pm

Thanks for the help - I am logged in as administrator, but for some reason unable to run fdisk:

Code: Select all

C:\>fdisk /mbr
'fdisk' is not recognized as an internal or external command,
operable program or batch file.
Any suggestions?

StopSpazzing
Posts: 462
Joined: Tue Sep 09, 2008 4:37 pm
Location: California, USA
Contact:

Re: Help with reclaiming disk space and partitions

#4 Post by StopSpazzing » Fri Nov 12, 2010 10:25 pm

ady wrote:...
Probably your boot loader is not the one that comes with Windows, so if you delete your Ubuntu partition, it is possible you get a system that you can't boot.

So, to avoid this problem, from Windows you should open an ADMISTRATOR command line and type:

Fdisk /MBR

and then press <enter>.
...

Grub would be the default boot loader if using Ubuntu.
twst wrote:Thanks for the help - I am logged in as administrator, but for some reason unable to run fdisk:

Code: Select all

C:\>fdisk /mbr
'fdisk' is not recognized as an internal or external command,
operable program or batch file.
Any suggestions?

You will have to use a XP Install CD to repair the installation.
http://helpdeskgeek.com/how-to/fix-mbr-xp-vista/
~Just StopSpazzing~

Visit the UBCD Wiki: http://wiki.ultimatebootcd.com
Please check your UBCD ISO MD5 Hash Sum; May prevent issues later on by not having an exact copy.

Currently Working on Common Issues and Repair Tips on the Wiki.

ady
Posts: 832
Joined: Sat May 08, 2010 5:26 am

Re: Help with reclaiming disk space and partitions

#5 Post by ady » Sat Nov 13, 2010 12:04 am

The procedure described in the article that StopSpazzing points to is correct, but I would like to add a couple of comments.

First, the article mentions that the procedure is the correct one only if you are using one Windows OS.

Although twst case starts with one Windows and one Ubuntu, the target situation is to delete Ubuntu and leave only a Windows boot procedure. If Ubuntu is not going to be used anymore, and the data in the Ubuntu partition is not necessary, then the procedure is correct for this case.

The second comment is about Windows XP version and the Windows CD recovery console. The Windows CD (either the "installation" CD or the "recovery" CD) should have the same Windows version than the one currently installed in the system. This is not always require, but generally speaking this is the preferable option.

For example, if you have Windows XP with SP3 installed, then try to use a Windows XP with SP3 CD to run the recovery console.

@twst, come back to report, and to continue with the next step to actually recover the new free space for use from Windows.

StopSpazzing
Posts: 462
Joined: Tue Sep 09, 2008 4:37 pm
Location: California, USA
Contact:

Re: Help with reclaiming disk space and partitions

#6 Post by StopSpazzing » Sat Nov 13, 2010 8:44 am

twst wrote:I installed Ubuntu on my laptop and would like it removed because I need the space back. I have Windows XP and Ubuntu currently.
He clearly states that ady.
~Just StopSpazzing~

Visit the UBCD Wiki: http://wiki.ultimatebootcd.com
Please check your UBCD ISO MD5 Hash Sum; May prevent issues later on by not having an exact copy.

Currently Working on Common Issues and Repair Tips on the Wiki.

ady
Posts: 832
Joined: Sat May 08, 2010 5:26 am

Re: Help with reclaiming disk space and partitions

#7 Post by ady » Sat Nov 13, 2010 8:55 am

@StopSpazzing,

Yes, and because he clearly stated that, is why I explicitly said what I posted.

While reading the link you posted, it says that the procedure is valid for systems with only one OS. I just wanted to assure to twst that the described procedure is also valid for the case in this post, which starts with 2 OS's. My intention was to clarify, in case anyone (twst or anyone else) has doubts when reading the condition about 1 OS only.

StopSpazzing
Posts: 462
Joined: Tue Sep 09, 2008 4:37 pm
Location: California, USA
Contact:

Re: Help with reclaiming disk space and partitions

#8 Post by StopSpazzing » Sat Nov 13, 2010 7:47 pm

Good point. I apologize. :)
~Just StopSpazzing~

Visit the UBCD Wiki: http://wiki.ultimatebootcd.com
Please check your UBCD ISO MD5 Hash Sum; May prevent issues later on by not having an exact copy.

Currently Working on Common Issues and Repair Tips on the Wiki.

jaylach
Posts: 8
Joined: Sat Oct 16, 2010 3:15 pm

Re: Help with reclaiming disk space and partitions

#9 Post by jaylach » Sun Nov 14, 2010 6:53 am

Don't be fooled by the name, it also works fine in XP. Download and install VistaBootPro at http://www.softpedia.com/get/System/OS- ... tPRO.shtml .

Once installed and running tell it to restore legacy boot loader. Also tell it to force the write to all drives.

I have not used this software in quite a while so can not vouch totally for newer releases but I have used it in the past to remove an XP/Ubuntu dual boot without issue.

twst
Posts: 3
Joined: Fri Nov 12, 2010 8:35 am

Re: Help with reclaiming disk space and partitions

#10 Post by twst » Sun Nov 14, 2010 10:09 am

Update: Apparently this was a Wubi install, so I was able to uninstall ubuntu using Windows Add/Remove programs. Sorry for the confusion, thanks!

ady
Posts: 832
Joined: Sat May 08, 2010 5:26 am

Re: Help with reclaiming disk space and partitions

#11 Post by ady » Sun Nov 14, 2010 10:39 am

@twst,

Glad you resolve your case. For sure we all lern even when the solution is right there in front of our eyes. :)

@jaylach

I want to comment about VistaBootPro, in case anyone else (besides twst that already resolve his problem) reads this topic.

I may be wrong, but I think VistaBootPro is not really for this case.

Let me explain why. VistaBootPro, and other similar tools, are actually GUI for bcdedit, the editor of the BCD http://en.wikipedia.org/wiki/Boot_Confi ... ation_Data

Now, the BCD is the method Vista and Seven use to boot, and, if you have more than 1 OS, you can use it as a boot menu to select which OS you want to boot. Without getting too deep, this would "replace" other bootloader methods.

If you have Windows XP and Vista/Seven dualboot/multiboot, you can use this method to select which Windows version you want to boot. In this sense, VistaBootPro is compatible with XP.

But, in the case of twst , there are at least 2 issues that could make his system not bootable if he uses VistaBootPro.

The first one is that he wants a (compatible) XP system. No Vista/Seven nor Ubuntu installed. He just needs a simple standard (XP-compatible) MBR, NTLDR and boot.ini. Including BCD information is not going to make his system XP-compatible (even if some part of the boot process of Vista/Seven could be partly compatible to XP).

The second issue is that he is using a laptop (according to his first post). He haven't described how the HDD is partitioned. He said he has XP and Ubuntu, but maybe he has also a "hidden/recovery" partition. So if this is the case, actually "forcing" to write to all the drives/partitions as you suggested, could make things worse for his specific case.

Moreover, both commands suggested by StopSpazzing, "fixmbr" and "fixboot", are also acting on the first primary partition of the first HDD (at least in the default use of those commands). If a recover/hidden partition is there (instead of the expected "C:"), those commands can also make things worse for this case.

So, the best "safe" method is always to check how the HDD is partitioned, before even starting with the XP recovery console.

BTW, the XP recovery console version should be (or at least, is desirable to be) the same version of the installed XP. I mentioned this before in a previous post (related to SP's installed), but is also related to XP Home version, or XP Pro version (the boot disks for Home and Pro are not exactly the same).

StopSpazzing
Posts: 462
Joined: Tue Sep 09, 2008 4:37 pm
Location: California, USA
Contact:

Re: Help with reclaiming disk space and partitions

#12 Post by StopSpazzing » Sun Nov 14, 2010 5:18 pm

ady wrote: BTW, the XP recovery console version should be (or at least, is desirable to be) the same version of the installed XP. I mentioned this before in a previous post (related to SP's installed), but is also related to XP Home version, or XP Pro version (the boot disks for Home and Pro are not exactly the same).
If only running recovery console, the version doesn't need to be the same. If you proceed with a Repair XP, then needs to be the same version and Home or Pro (ex. Home SP2 or Pro SP3) as the installed windows machine.
~Just StopSpazzing~

Visit the UBCD Wiki: http://wiki.ultimatebootcd.com
Please check your UBCD ISO MD5 Hash Sum; May prevent issues later on by not having an exact copy.

Currently Working on Common Issues and Repair Tips on the Wiki.

ady
Posts: 832
Joined: Sat May 08, 2010 5:26 am

Re: Help with reclaiming disk space and partitions

#13 Post by ady » Mon Nov 15, 2010 4:59 am

StopSpazzing,

I respectfully disagree.

First, if you have an SP installed, and you boot with a previous version CD, there is even a chance that the recovery console won't start, stating that there is a more-up-to-date Windows version installed than the one in the boot CD.

Assuming different Windows versions, if the recovery console starts, performing either fixmbr and/or fixboot commands can be worse than doing nothing. The basic reason for that is that the files involved in fixing the MBR and the boot record were changed when the SP's were published.

There might be a specific chance/case where the "fixing" could work to boot into Windows XP, but generally speaking, the "fixing" should be done with the same Windows XP version.

As I said before, the boot disks for XP Home and XP Pro are different in the original XP, and in the SP1, SP1a, and SP2.

The only situation where I can think the Windows XP version would not be a problem is after updating the system to XP Home with SP3, and using a CD with XP Pro with SP3. The reason I think it could be fine in this case is that SP3 CD was the same for the Home and the Pro versions of XP, and SP3 included all previous updates.

For info about some of the changes, while updating XP to some SP or between Home and Pro versions, related to MBR, the boot record and their related files, "The Starman" webpages have some technical details in the subject.

Another website with less technical info:

http://www.pcbuyerbeware.co.uk/Recoveri ... tility.htm
1. - Boot from the Windows XP Setup CD and enter the Recovery Console. When the setup program runs, you will have the option to Press R to start the Recovery Console. If you are using a Windows XP SP1 CD (Service Pack 1) and the system has been updated to Windows XP SP2 (Service Pack 2), you should use a "slipstreamed" CD that incorporates SP2 so that outdated SP1 files are not used on an SP2 system. The same applies if you are using a Windows XP SP2 CD and the system has been updated to Windows XP SP3 (Service Pack 3).
This page of this article deals with creating a slipstreamed installation CD/DVD:
http://www.pcbuyerbeware.co.uk/Recoveri ... _Vista.htm

The following quote is for installing the Recovery Console as a boot option (not for running it from a CD), but the info about changes to the involved files is still relevant.
I can't install the Recovery Console after updating to Windows XP SP2/SP3
Problem

I installed Windows XP Professional several months ago, but I didn't install the Recovery Console. When I tried to install it from the original installation disk, the following error message came up: "Setup cannot continue because the version of Windows on your computer is newer than the version on the CD." I recently installed the Service Pack 2 (SP2) update, so is there any way I can install the Recovery Console without having to reinstall Windows XP and all of my software from scratch?

Answer

Many of the files on the original Windows XP setup CD would have been rendered out of date as soon as you installed SP1 or SP2 or SP3. That's why Windows warned you about adding older files to a new SP2 installation.

The solution involves installing the Recovery Console from a Windows XP setup CD that has been updated to include the SP2 or SP3 files. Several methods of 'slipstreaming' the Windows XP CD and the SP2 or SP3 update are provided in Slipstreaming Windows XP/Vista: How to create a Windows XP/Windows Vista installation CD/DVD containing the service packs and missing drivers (provided on this section of this website).

Using such an updated setup Windows XP CD not only allows you install Windows XP and all patches through your updated SP2/SP3 installation in one step, but it also allows you add or modify files and features such as the Recovery Console, because the files on the slipstreamed CD are the same versions as the versions that are running in the system (minus the updates that were issued after the relevant service pack, which have to be added by visiting Microsoft Update).

StopSpazzing
Posts: 462
Joined: Tue Sep 09, 2008 4:37 pm
Location: California, USA
Contact:

Re: Help with reclaiming disk space and partitions

#14 Post by StopSpazzing » Thu Nov 18, 2010 10:39 pm

@ady

Those instructions in the link I provided work fine with any version of Windows XP (didn't try x64) for recovery console running from CD no matter what version of Windows XP you have. Tested and confirmed with VirtualBox.

Im guessing those requirements only apply to installation of Recovery Console, which would make sense as different versions require different files from the operating system so would have to match.
~Just StopSpazzing~

Visit the UBCD Wiki: http://wiki.ultimatebootcd.com
Please check your UBCD ISO MD5 Hash Sum; May prevent issues later on by not having an exact copy.

Currently Working on Common Issues and Repair Tips on the Wiki.

ady
Posts: 832
Joined: Sat May 08, 2010 5:26 am

Re: Help with reclaiming disk space and partitions

#15 Post by ady » Fri Nov 19, 2010 6:49 am

StopSpazzing, thank you for taking the time to test it and for reporting back.

I'm getting technical now, but for who might be interested...

For Windows™ XP, the MBR code is contained inside the files:
..\system32\dmadmin.exe (for the Logical Disk Manager);
..\system32\spcmdcon.sys (for the Command Console);
..\system32\diskpart.exe (for the DiskPart tool, replacement of Fdisk).

At least under Windows™ XP sp2, the files were updated, and the MBR code was still inside therm but at different offsets (and of course the "fix" tools were updated also, in accordance to the new offsets).

Part of the information is also copied to the registry.

So, if

A) the code that copies the MBR and the bootstrap code itself are the same for every version (home/pro/sp's); and
B) the codes are copied to the same locations (exact same sectors of the HDD and partition);

then the original location of the codes is not important and the result should be the same whichever version you have on the CD/floppy and whichever version you have already installed.

If any of those conditions aren't satisfied, then only the exact same XP version you have already installed in the HDD should be used in the CD/floppy to correct the MBR (fixmbr) and the partition boot code (fixboot).

I haven't checked if those conditions are satisfied, so I should trust StoppSpazzing's test that whichever XP version (home/pro/sp's) you have in the CD/floppy, the fixmbr and fixboot tools could fix any XP version (home/pro/sp's).

Now, the boot code was actually changed in XP SP2, but updating to any SP doesn't change the boot codes of previously-installed partitions (there is a MS tool named Bcupdate2.exe that is related to this, used to repair other boot issues).

Since I can't be always, permanently and constantly aware of every change that MS makes to Windows (who could?), specially on these type of technical details, I personally will always try to use the same Recovery Console version according to the Windows version that is installed in the specific partition I want to fix.

An example: you have Windows XP and Windows 2k (or it could be other (different) version of XP) installed in the same HDD, in 2 separate partitions. In case I'd had to repair the system, I would fix the HDD MBR code with the "correct" XP console; then I would use the W2k console to repair the W2k partition boot code, and the XP console to repair the XP partition boot code. In this particular example, after fixing the XP partition boot code, it could be necessary also to edit the XP's boot.ini to add the W2k partition as an additional boot option.

My humble conclusion (so I won't make it more technical than I already did); you can trust StopSpazzing's test and results, but if you can, try to use the "correct" recovery console (in case MS had changed something that could be potentially incompatible to your particular system).

StopSpazzing
Posts: 462
Joined: Tue Sep 09, 2008 4:37 pm
Location: California, USA
Contact:

Re: Help with reclaiming disk space and partitions

#16 Post by StopSpazzing » Fri Nov 19, 2010 11:40 pm

ady wrote: My humble conclusion (so I won't make it more technical than I already did); you can trust StopSpazzing's test and results, but if you can, try to use the "correct" recovery console (in case MS had changed something that could be potentially incompatible to your particular system).
Well technically I never ran the fixmbr command, only proceeded to the recovery console command prompt, so I completely agree with what you have said and as a precaution this is the best idea JUST IN CASE. As an added bonus, you will have a repair CD for your windows version too! :D

Tho you would think it would error while running the recovery console on different versions if they weren't compatible...as it does require you to login using the admin password. :?
~Just StopSpazzing~

Visit the UBCD Wiki: http://wiki.ultimatebootcd.com
Please check your UBCD ISO MD5 Hash Sum; May prevent issues later on by not having an exact copy.

Currently Working on Common Issues and Repair Tips on the Wiki.

ady
Posts: 832
Joined: Sat May 08, 2010 5:26 am

Re: Help with reclaiming disk space and partitions

#17 Post by ady » Sat Nov 20, 2010 5:47 am

Tho you would think it would error while running the recovery console on different versions if they weren't compatible...as it does require you to login using the admin password.
Actually, I don't think it would have to give an error just booting to the Recovery Console (RC for short in the context of this post).

You could find information about repairing XP with the old fdisk /mbr (even at MS's website), or booting with, say, PartedMagic and getting access to an NTFS partition.

About having to insert the administrator password, I don't see any potential problem with that. It is a security issue (about getting to read data that maybe you are not supposed to), and you are still not changing anything in the partition.

My point is, anything that can have access to the system partition, could boot and at least read it. Even when booting with no access to the partition, I could still boot the system.

So, in my opinion, you could boot with any XP CD, then the partition is recognized as NTFS, and you get to the RC. With its differences, is like booting into some other command-line OS that has access to NTFS.

Getting into the RC doesn't change anything in the system partition.

If, from the RC, you would try to change something on the NTFS system partition, then it would be "nice" if the RC could at least warn you of any incompatibilities. I personally don't know if MS programmed XP to be so "smart".

The installation program for XP, and the "system repair" program can ID if there is "some" XP already installed. I personally don't know if the fixmbr and fixboot functions can at least warn you about specific XP versions before actually writing the new codes.

Booting to the RC? IMHO, there is no problem. Actually changing system files or HDD MBR or partition boot code? As a precaution, I would try to use the same XP (same x32 or same x64; same Home or same Pro; same SP) version in the CD than the one already installed in the system.

Post Reply