LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 02-25-2007, 02:19 AM   #1
gng
LQ Newbie
 
Registered: Feb 2007
Posts: 3

Rep: Reputation: 0
Unistalling Ubuntu


Can anyone tell me a safe and easy way of uninstalling ubuntu from my pc.
I have two hard drives. On one is Ubuntu and on the other is Win XP. Please also tell me about removing grub so that i can boot from XP after i remove Ubuntu.

I am NOT familiar with linux commands so PLEASE help this NewBie.

THANKS A TON IN ADVANCE
 
Old 02-25-2007, 03:22 AM   #2
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
Can't you just reformat?
 
Old 02-25-2007, 04:52 AM   #3
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Quote:
Can't you just reformat?
To reformat (both) drives is not an answer; of course to remove Ubuntu (partitions) the way to go is to format the drive which has Ubuntu, but that would leave the user with an unusable bootloader (GRUB would not work after removing /boot), preventing the loading of XP.

The correct way:

1) restore XP bootloader. Either use Windows XP setup disc to boot into the XP startup menu, or if you have Recovery Console installed on your harddrive (in some cases it is), just press F8 right after you select to boot XP from Grub. Either way you should end up with having the Windows boot list on screen. Choose the option to enter the "recovery mode" or whatever it is; it's not "safe boot" but the other option, which enables you to jump into the XP Recovery Console. If you're unsure on how to get there, refer to XP documentation in the web of in manuals. If RC is installed on harddrive, you can enter it from the boot menu directly; if it's not, you'll need to get to the menu by booting from XP setup disc. Also if you have multiple harddrives/partitions, when asked during entering RC, choose the one which has your WinXP installed -- it is important to select the correct harddisk. Just in case, it's a good idea to have a bootdisk for XP or XP setup cd available before continuing.

2) Once in Recovery Console, type the command fixmbr to tell Windows to 'reset' the MBR (Main Boot Record; the first sector of your harddisk). In some cases you might have to run fixboot too (there's documentation at microsoft.com about this); it does make a difference in which order you run these if you need to run both, but I'd start with 'fixmbr' only. NOTE: if this fails, you need to have either XP setup disc or a regular boot disk to be able to boot your machine after this, and re-enter the Recovery Console. I'm not sure what causes it to fail sometimes (and force you to use 'fixboot' too, at least); I've succeeded in doing this with only running 'fixmbr' multiple times on a pc, and then suddenly failing with the same pc. Nevertheless it's a good idea to have a bootdisk before continuing. No data is lost if this won't work the first time, so don't worry; it's just that your bootloader is erased, and you are unable to boot without a boot diskette -- to get into XP recovery console you need an XP bootdisk, to get in Linux you need a Linux bootdisk (or a live-cd).

3) Once you've run fixmbr and RC tells you it has successfully rewrote MBR, type exit to get out and reboot your machine. If everything went well, your XP should boot the usual way, without GRUB showing up. After this simply format your 2nd harddrive; this can be done, for example, using XP's system tools (My Computer -> Manage) or PartitionMagick or something else. Simply choose to remove all partitions from the other harddisk (where Ubuntu is) and format the whole disk; create new partitions as you like, if you need to.

4) This is only if you failed to run 'fixmbr', the command didn't do what it was supposed to and you ended up with either unusable GRUB, no bootloader at all or generally a message after boot saying 'unable to load OS'. First: don't panic. Your data is safe, this problem is just the fact that you don't have a bootloader that could load your operating system(s). There are two ways to fix it: 1) having XP bootdisk of some kind, re-try running fixboot and fixmbr, reboot and see if it helps. Also refer to Microsoft's website documentation about fixing 'broken MBR' or whatever it's called. I'll explain another method later below. 2) To get things running for a moment, you could simply run a Linux live-cd or an installer and install GRUB again; this lets you boot your XP, along with Linux, and you can access your Windows until you've figured another way out.

Another method to get MBR back to Windows: the MBR is the first sector of your harddisk (512 bytes). It's just data as anything else, so it can be copied from a harddisk and copied to a harddisk. The 512 bytes consists of 446 bytes (which is Windows bootloader, in this case) and the rest from 446 to 512 which is your partition information. You could, if you had a backup of your MBR, copy it back to the disk and have it fixed that way (actually I think this is what 'fixmbr' should do). Of course you now thing you don't have the backup but..one way is to try and copy it off your buddy's XP-only-machine, and copy it on your own harddisk. In this case you shouldn't copy the whole 512 bytes as your buddy's partition information might not match yours. Note that I've never tried this on my own machine, but it's easily tried, and if it doesn't work..well, you can continue with the Recovery Console: the MBR isn't any more or less fixed than it was before you copied data onto it, as long as you only deal with MBR. So, you could use a Linux live-cd to copy the 446 bytes from your buddy's harddisk's beginning using dd, then move the file to an usb disc, use the live-cd at your own pc and then with dd put the bytes to your own machine's MBR. Like this (here I assume the primary partition is the one with XP; use Linux live-cd to get access to dd without installing Linux; MBR_backup is the file which we need to move to your machine, with USB stick for example):
Code:
dd if=/dev/hda of=/MBR_backup bs=446 count=1
now move MBR_backup to an USB stick for example, or a cd (use rw to not consume full cd for a file less than half a kilobyte). Then boot a live Linux on your machine, and (again, if first harddisk hda is the one with your Windows aboard; if it's something else, change accordingly; also change the if= path to point to the full path of the file) copy the file back:
Code:
dd if=/MBR_backup of=/dev/hda bs=446 count=1
After this you might need to make sure XP's partition information is all right, so you could boot into the XP Recovery Console and run 'fixboot' which should deal with it. The partition information should also have a duplicate on the harddisk, just in case, so if either one of the two is inaccurate, XP should know to use the working one (but I'm not sure if it does). So, after this you try rebooting your machine and see if it works; if not, refer to Microsoft documentation (again).

Though I've written a lot in this post and it might sound complicated, I must say that I've put XP's bootloader back many times and have only failed once (and got it working after that); usually it's just as easy as getting into Recovery Console, running 'fixmbr' and rebooting. So don't worry.
 
Old 02-25-2007, 07:44 AM   #4
IndyGunFreak
Senior Member
 
Registered: Aug 2003
Location: Indpls
Distribution: Laptops: Debian Jessie XFCE, NAS: OpenMediaVault 3.0
Posts: 1,355

Rep: Reputation: 70
Everything he said, except when I run recovery console, I ALWAYS run FixMBR, then Fixboot(wether needed or not), and I've never had a problem.

IGF
 
Old 04-14-2009, 09:53 PM   #5
Daniel_hates_ubuntu
LQ Newbie
 
Registered: Apr 2009
Posts: 10

Rep: Reputation: 0
Cool A Better way to uninstall uBuntu

Quote:
Originally Posted by gng View Post
Can anyone tell me a safe and easy way of uninstalling ubuntu from my pc.
I have two hard drives. On one is Ubuntu and on the other is Win XP. Please also tell me about removing grub so that i can boot from XP after i remove Ubuntu.

I am NOT familiar with linux commands so PLEASE help this NewBie.

THANKS A TON IN ADVANCE
Actually, the best way to uninstall uBuntu is:

1:Print this tutorial. (if you can)

2:make sure you have your windows xp disc handy.
go to the start menu and click run then type "CMD"
now type "NET USER"
if it lists Administrator type "NET USER ADMINISTRATOR *
it will ask you for a password (type what ever you want)
it will not show you the password for security reasons but it is recording it
press enter and then type "EXIT"

3:Put the windows xp disc in your CD drive and boot the computer

4:when the screen says: Press any key to boot from CD...

5ress any key (that is obvious

6:if you need to load a RAID Driver press F3 (if you do not know what that is don't press F3)

7:wait for it to finish loading the drivers

8:when it is finished it will list 3 choices when this happens just press "R"

9: wait for the recovery console to load

10: It will ask you about which windows installation you want to logon to

11: press 1 (if you have only one WINDOWS installation, does not include uBuntu)

12:it will ask you for your administrator password type the same thing you type'd in at step 2 (in CMD)

13: now type FIXMBR

14: it may give you an error message about the current MBR file is weird (because it is looking at GRUB's files.

15:when it is finished type FIXBOOT

16: when it is done type: setpart

17: use the arrow keys to hi-light uBuntu's partition and press "D" to delete it

18O NOT DELETE ANYTHING YOU DO NOT KNOW ABOUT IT COULD DAMAGE YOUR SYSTEM!!!!!!

This information should be accurate as i just did the same exact thing on my computer and it worked.
 
Old 04-14-2009, 10:46 PM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Would you believe that--2+ years later--OP is no longer listening????

Given that there are lots of threads on this topic--including this one with good answers--we can now close this.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unistalling mandrake 10 stevoo Linux - Software 4 12-01-2004 09:43 AM
Unistalling Wine Genesis Linux - Software 7 06-19-2003 07:39 PM
Unistalling a program <Rockman> Linux - General 3 12-16-2002 03:07 PM
unistalling windows Nikos Linux - Newbie 1 12-08-2002 11:59 PM
unistalling GT I.N.C Linux - Newbie 9 07-10-2002 12:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration