LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 12-04-2002, 07:46 PM   #1
Scruff
Member
 
Registered: Oct 2002
Location: Stoughton, MA
Distribution: Gentoo x86_64 & PPC
Posts: 949

Rep: Reputation: 30
linux removal


I just got a 2nd box that I would like to use for Linux only. Now I want to remove it from this one. I have 6 partitions. C:Windows 2000 Pro, F: Windows XP Pro, X: Data, and the 3 linux partitions. How can I remove Linux without effecting my windows? I am using Mandrake 9.0, with the LILO boot manager.
 
Old 12-04-2002, 07:58 PM   #2
Bert
Senior Member
 
Registered: Jul 2001
Location: 406292E 290755N
Distribution: GNU/Linux Slackware 8.1, Redhat 8.0, LFS 4.0
Posts: 1,004

Rep: Reputation: 46
This is a funny one, because Microsoft recommends that the best way to remove a partition containing Linux is to boot into ... Linux (good job there 's no EULA in Linux!).

The output of the command

fdisk -l /dev/hda

will tell you what your partitions look like. From here on in, have a good look at the fdisk man pages:

man fdisk

If you're confident you know what you're doing, it's

d

to delete a partition (it will ask which one), and then

w

to commit the new partition table. If you're not sure at any point, just press

q

or ctrl+c. Careful!

When you're done, boot into Windows using lilo and at a DOS prompt type

fdisk /mbr

P.S. Unfortunately, the DOS version of fdisk is crippled, so don't use it for partition deletion.

Bert
 
Old 12-04-2002, 08:23 PM   #3
Scruff
Member
 
Registered: Oct 2002
Location: Stoughton, MA
Distribution: Gentoo x86_64 & PPC
Posts: 949

Original Poster
Rep: Reputation: 30
Is there any way I can just do away with LILO and restore the windows MBR?
 
Old 12-04-2002, 08:54 PM   #4
KevinJ
Member
 
Registered: Feb 2001
Location: Colorado Springs, CO
Distribution: Redhat v8.0 (soon to be Fedora? or maybe I will just go back to Slackware)
Posts: 857

Rep: Reputation: 30
boot to a Windows9x disk and run "fdisk /mbr"

-KevinJ
 
Old 12-04-2002, 09:29 PM   #5
Thymox
Senior Member
 
Registered: Apr 2001
Location: Cornwall, England.
Distribution: Debian + Ubuntu
Posts: 4,345

Rep: Reputation: 57
Note: This does not always work. I found, many moons ago, that the above command seems only to replace the current mbr with the last one. This seems all well and good, until you come to a situation where you may have installed Linux twice. Doing the above would then replace the current mbr (which is Lilo) with the previous one (which is also Lilo)... you see the dilema (sp?)? Repeating the command does not change this, so it would seem that, certainly with older version, there is a potential problem. Luckily, there is also a solution... if you need a bootloader that is not Lilo/Grub, then you can try XOSL. It can install itself to either the mbr or to a seperate 'xosl partition'. It's not fabulous, but it looks nice and works well. HTH
 
Old 12-04-2002, 10:50 PM   #6
KevinJ
Member
 
Registered: Feb 2001
Location: Colorado Springs, CO
Distribution: Redhat v8.0 (soon to be Fedora? or maybe I will just go back to Slackware)
Posts: 857

Rep: Reputation: 30
I am sorry, but that isn't true. The "fdisk /mbr" program does NOT restore the old boot record. It makes BIOS call and creates a new boot record so that the system boots to DISK0. It can not "restore" something that wasn't saved.

The current boot loader in the MBR is overwritten with a generic one. As long as the partition table is still valid and FDISK can find an active, bootable Windows partition, it WILL work.

If your system is setup in such a way that DISK0 doesn't contain a bootable OS or perhaps you have too many partitions or partitions in unusual places, or your partition table gets corrupted, then you will not be able to boot.


-KevinJ
 
Old 12-04-2002, 10:55 PM   #7
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,155

Rep: Reputation: 56
just use lilo -M

it will safely restore the boot sector
 
Old 12-04-2002, 11:49 PM   #8
Scruff
Member
 
Registered: Oct 2002
Location: Stoughton, MA
Distribution: Gentoo x86_64 & PPC
Posts: 949

Original Poster
Rep: Reputation: 30
The fdisk /mbr is what worked for me. I tried all the other suggestions first to no avail. It did reassign all my drive letters, but no big deal. Change 'em back and you're all set.

Thanks guys!
 
Old 12-05-2002, 06:49 AM   #9
Thymox
Senior Member
 
Registered: Apr 2001
Location: Cornwall, England.
Distribution: Debian + Ubuntu
Posts: 4,345

Rep: Reputation: 57
Kevin, thanks for the clarification (sp?). I always assumed my explanation (never really researched it) due to my circumstances a long time ago...
MBR is Windows.
Installed Linux. MBR is now Linux.
Didn't really get on with Linux (my first expedition), so:
Installed QNX to try that. MBR is now QNX.
Didn't like QNX at the time, so fdisked as above and... mbr was back to Linux, ie I was presented with LI and the system halts. Due to this, I presumed that doing fdisk /mbr merely replaced current mbr with the previous one. This is when I discovered XOSL, which I still believe to be an invaluable tool in cases of emergency. Thanks for clearing up my mis-conception of the situation.

Cheers.
 
Old 12-05-2002, 11:12 AM   #10
KevinJ
Member
 
Registered: Feb 2001
Location: Colorado Springs, CO
Distribution: Redhat v8.0 (soon to be Fedora? or maybe I will just go back to Slackware)
Posts: 857

Rep: Reputation: 30
Just curious.... from where did you issue the fdisk /mbr command? A booted Win9x floppy? Some sort of QNX rescue disk?

I don't know anything about QNX.. but if you used FDISK from Win9x (does QNX have anything like that?) it may have had trouble finding an active partition it could identify as windows. Also... not sure what QNX does to the MBR when you install it. Could QNX use LILO as its boot loader?

-KevinJ
 
Old 12-05-2002, 11:22 AM   #11
Scruff
Member
 
Registered: Oct 2002
Location: Stoughton, MA
Distribution: Gentoo x86_64 & PPC
Posts: 949

Original Poster
Rep: Reputation: 30
Yeah, I just booted from a win98 disk Kevin. As for QNX, I never even heard of it :-)
 
Old 12-05-2002, 11:39 AM   #12
Thymox
Senior Member
 
Registered: Apr 2001
Location: Cornwall, England.
Distribution: Debian + Ubuntu
Posts: 4,345

Rep: Reputation: 57
I booted from a Win98se boot floppy. QNX can install its own bootloader into the mbr, and since at the time I was effectively overwriting my Linux partition anyway, it didn't really concern me whether I could use Lilo to boot it. As it turns out, I have tried QNX since and I can confirm that it can be booted from Lilo.

:edit:
Link to QNX website
:/edit:

Last edited by Thymox; 12-05-2002 at 12:28 PM.
 
  


Reply


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
win32 virus removal using Linux JPsDad Linux - Security 2 09-26-2005 04:24 PM
linux/osf.3974 Removal ? Mark007 Linux - Security 3 03-02-2005 03:56 AM
Linux Spyware Removal Tools? Micro420 Linux - Software 9 01-22-2004 06:29 AM
Removal of Linux tszhim Linux - Software 16 06-02-2003 11:49 PM
linux 7.0 removal dogg Linux - Software 1 08-16-2001 10:53 PM


All times are GMT -5. The time now is 01:09 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration