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.
Original situation: dual-boot computer (not my own)
Windows XP SP3, Linux (not sure which distro, Slackware I think)
Goal: remove Linux installation;
concluded from web searches that I should remove GRUB first
My level of knowledge concerning boot questions:
absolute beginner
... concerning Linux administration:
advanced beginner
What I did: I found http://www.cyberciti.biz/faq/linux-h...ninstall-grub/
and started with booting from a WinXP installation CD;
'Repair' did not work because hard disk driver was not found (?!);
so I thought I'd go for the Linux solution suggested
at above link and issued command:
easiest thing if you do not want linux....put in xp cd and do a clean install....there should be an option to choose partitions.....xp will put its bootloader into mbr by overwriting mbr.
It appears that you removed the boot code from sda1 (the first partition). I don't know if Windows puts something there or not. Regardless, since you can still boot to Linux, it means GRUB is in the MBR.
Can you mount and read the Windows partition? eg: (as root)
Code:
cd /mnt
mkdir win
mount /dev/sda1 win
cd win
ls
Please post your /boot/grub/menu.lst file (delete all the lines beginning with #)
If you want to keep Windows and delete Linux, then you should be able to boot from the Windows CD, rescue mode, and run "fixmbr". If you can't do that, and it's asking for a driver, it may mean you have a SATA drive and it needs a driver.
But, since you have the Windows CD, why not simply do a clean install? You'll probably need to erase the MBR first--eg by using:
Code:
dd if=/dev/zero of=/dev/sda bs=512 count=1
(note sda, not sda1)
Don't do this until you are sure that you are going to do the clean install.
The Grub error 18 is listed in the grub manual as the following:
Selected cylinder exceeds maximum supported by BIOS
This error is returned when a read is attempted at a linear block address beyond the end of the BIOS translated area. This generally happens if your disk is larger than the BIOS can handle (512MB for (E)IDE disks on older machines or larger than 8GB in general).
for simple solution follow this,
* Take your XP CD, boot using CD/DVD drive.
*Select the partitions of linux( it shows as unknown partition, because it can't read ext3 filesystem)
* Delete those partitions. Unused space will be created
* Create new partitions using unused space.
* Now Master Boot Record will be overwritten by XP.
* Finally you can continue formatting newly created drives. ( You can format your Newly created drives here using boot CD, or after logging to the windows also you can format them ).
Some answers to pixellany's questions and comments:
Code:
root@mymachine:# cd /mnt
root@mymachine:# mkdir win
root@mymachine:# mount /dev/sda1 win
mount: you must specify the filesystem type
root@mymachine:# cd win
root@mymachine:# ls
root@mymachine:#
So I guess this means I cannot mount the Windows partition.
The active content of /boot/grub/menu.lst is:
Code:
root@mymachine:/boot/grub# cat /boot/grub/menu.lst | grep -iv "#"
default 0
timeout 5
color cyan/blue white/blue
title Windows 95/98/NT/2000
root (hd0,0)
makeactive
chainloader +1
title Linux
root (hd0,6)
kernel /boot/vmlinuz root=/dev/sda7 ro vga=791
I also tried again to recover with the WinXP installation CD. At a certain point I offered WinXP a driver floppy disk for the hard disk. It reads it, then reboots, and shows a blue/white screen prompting for full installation or repair mode. When I type "R" to enter Repair mode, I end up again with the error message saying that no hard disk reader could be found on the computer.
I get the feeling that for the moment I don't have much choice other than trying to repair the mess through the Linux side.
What can I do next?
Thanks again for your help.
Last edited by paschuller; 12-08-2009 at 01:25 PM.
Reason: output of 'mount' command was mistyped
From your root prompt: root@mymachine:#
type the following:
mkdir /mnt/winc
then type: ls -l /mnt/
to see if "winc" is there
this error
Quote:
root@mymachine:# mount: you must specify the filesystem type
can be corrected with:
then type: mount -t ntfs /dev/sda1 /mnt/win
then type: ls /mnt/win/
to if your windows files are there. You should look for files like boot.ini. ntldr, ntdetect.
From your original post, I expect that pixellany is correct and you removed boot code from windows partition, sda1.
What you did with your original dd command there was to *wipe* the bootsector clean - this won't do, you need something there that'll boot *some* OS (oh and your bs parameter should have been 512 bytes, I can't even tell what the result of what you did would be). As someone suggested above, why don't you boot off of your Windoze CD and see if you can fix your bootsector from there?
Btw, why are you removing Linux?
You will not be able to boot xp until you repair the partition boot sector which was corrupted when you ran the command
Quote:
dd if=/dev/zero of=/dev/sda1 bs=446 count=1
This messed up your windows boot files on that partition, you should have had the command as "sda" not "sda1", then it would have removed Grub stage1 file from the master boot record. If your xp installation CD doesn't work in recovery mode, you might try getting an xp boot disk at bootdisk.com or downloading SuperGrubDisk, just google it. It can repair windows mbr.
When I choose the option "Win --> MBR" and do a reboot, the machine stalls with a blank screen. With the SuperGrubDisk, this is reversable, and I can get back to the situation where I have the GRUB menu giving me the choice of booting WinXP (not working) or Linux (working).
I did not find an option that would allow to write some sort of 'WinXP boot information' to the actual Windows partition instead of MBR. Maybe I overlooked an option or misunderstood something?
In search of a solution I had an idea - which did not work (to say it right away), but maybe the method can be improved.
With some help I did the following. On a pure WinXP SP3 machine, I booted from a live Linux CD (OpenSuse 11.1). The command 'fdisk -l' showed a bootable WinXP NTFS partition at /dev/sda1. With
I copied the first 1KB of information into a file on a USB key. Then I copied this file to mymachine and compared it (using the 'od' command) with the first 1KB of the partially "wiped" /dev/sda1 on mymachine. The part that was not "wiped" appeared identical with the corresponding part in winmachine_sda1.lst. This made me hopeful and I overwrote the "wiped" part by
root@mymachine:/# ls /mnt/winc
root@dwin-rincevent:/# mount /dev/sda1 /mnt/winc
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
or too many mounted file systems
the latter being different from the message prior (see earlier post) to the recent overwrite:
Code:
mount: you must specify the filesystem type
Why does this method not yield the expected result? How can it be improved?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.