Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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
Distribution: Redhat v8.0 (soon to be Fedora? or maybe I will just go back to Slackware)
Posts: 857
Rep:
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.
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.
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.
Distribution: Redhat v8.0 (soon to be Fedora? or maybe I will just go back to Slackware)
Posts: 857
Rep:
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.