LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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-02-2009, 04:36 PM   #1
paschuller
LQ Newbie
 
Registered: Dec 2009
Posts: 6

Rep: Reputation: 0
Goal: remove GRUB; result: WinXP not bootable


Hello,

I have the following BIG problem.

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:

Code:
root@mymachine:/# dd if=/dev/zero of=/dev/sda1 bs=446 count=1
As I did not see earlier posts on Linuxquestions.org,
I did not back up /dev/sda1 (unfortunately).

Result: GRUB still comes up when booting,
giving option to Windows or Linux;
booting Windows fails with following message:

Code:
Booting 'Windows 95/98/NT/2000'

root  (hd0,0)
  Filesystem type unknown, partition type 0x7
makeactive
chainloader +1

Loading stage 2..

GRUB loading, please wait...
Error 18
Linux still boots okay, although /mnt/winc is not accessible;
I find the following information:

Code:
root@mymachine:/# fdisk -l

Disk /dev/sda: 81.9 GB, 81963253760 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3602    28933033+   7  HPFS/NTFS
/dev/sda2            3603        9964    51102765    f  W95 Ext'd (LBA)
/dev/sda5            3603        6993    27238176    b  W95 FAT32
/dev/sda6            6994        7056      506016   82  Linux swap
/dev/sda7   *        7057        9964    23358478+  83  Linux

root@mymachine:/# cat /etc/fstab
/dev/sda6        swap             swap        defaults               0   0
/dev/sda7        /                ext3        defaults               1   1
/dev/sda1        /mnt/winc        ntfs        user,ro,auto,umask=2   1   0
/dev/sda5        /mnt/wind        vfat        user,rw,auto,umask=0   1   0
/dev/cdrom       /mnt/cdrom       iso9660     unhide,noauto,exec,user,ro    0   0
/dev/fd0         /mnt/floppy      auto        noauto,umask=0         0   0
devpts           /dev/pts         devpts      gid=5,mode=620         0   0
proc             /proc            proc        defaults               0   0
What exactly did I do? How can I get WinXP to boot again?

Thanks a lot for your help!
 
Old 12-02-2009, 04:55 PM   #2
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,657
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
Hi, With the Mandriva free dvd, the rescue selection at the boot menu has a

restore windows bootloader option.

Perhaps, your Suse cd has, or maybe the slack cd has it.

My 2c, regards Glenn
 
Old 12-02-2009, 04:56 PM   #3
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
root@mymachine:/# dd if=/dev/zero of=/dev/sda1 bs=446 count=1
that was not a good idea.
google recover XP bootloader.
 
0 members found this post helpful.
Old 12-02-2009, 04:58 PM   #4
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
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.
 
Old 12-02-2009, 05:00 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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.
 
1 members found this post helpful.
Old 12-02-2009, 05:05 PM   #6
bret381
Member
 
Registered: Nov 2009
Location: Alabama
Distribution: Arch x86_64
Posts: 650

Rep: Reputation: 79
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).

Info from http://www.gnu.org/software/grub/manual/html_node

You may can find more info there.
 
Old 12-02-2009, 05:16 PM   #7
raju.mopidevi
Senior Member
 
Registered: Jan 2009
Location: vijayawada, India
Distribution: openSUSE 11.2, Ubuntu 9.0.4
Posts: 1,155
Blog Entries: 12

Rep: Reputation: 92
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 ).
 
Old 12-03-2009, 01:29 PM   #8
paschuller
LQ Newbie
 
Registered: Dec 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Hi everyone,

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
 
Old 12-03-2009, 02:08 PM   #9
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,510

Rep: Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491
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.
 
1 members found this post helpful.
Old 12-04-2009, 03:34 AM   #10
paschuller
LQ Newbie
 
Registered: Dec 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Hello,

When I boot the machine under Linux, I do see /mnt/winc , see below.
So I did not issue "mkdir /mnt/winc".

I also tried to mount the WinXP partition manually as described by yancek,
to no avail:
Code:
root@mymachine:/mnt# mkdir win
root@mymachine:/mnt# ls -l
total 36
drwxr-xr-x    2 root     root         4096 Mar 16  2002 cdrom/
drwxr-xr-x    2 root     root         4096 Mar 16  2002 floppy/
drwxr-xr-x    2 root     root         4096 Mar 16  2002 hd/
drwxr-xr-x    2 root     root         4096 Dec  4 10:19 win/
drwxr-xr-x    2 root     root         4096 Nov  7  2003 winc/
drwxrwxrwx   23 root     root        16384 Jan  1  1970 wind/
root@mymachine:/mnt# mount -t ntfs /dev/sda1 /mnt/win
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
       or too many mounted file systems
Please keep ideas and suggestions comming - thank you!
 
Old 12-07-2009, 01:22 AM   #11
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
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?
 
Old 12-07-2009, 11:46 AM   #12
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,510

Rep: Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491
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.
 
Old 12-07-2009, 03:26 PM   #13
paschuller
LQ Newbie
 
Registered: Dec 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Hello,

I created a SuperGrubDisk.

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?
 
Old 12-08-2009, 01:35 PM   #14
paschuller
LQ Newbie
 
Registered: Dec 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Hello,

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
Code:
dd if=/dev/sda1 of=/mnt/usbdrive/winmachine_sda1.lst bs=1024 count=1
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
Code:
root@mymachine:/# dd if=/mnt/usbdrive/winmachine_sda1.lst of=/dev/sda1 bs=446 count=1
When I reboot mymachine and choose the WinXP partition in GRUB, I still get
Code:
Booting 'Windows 95/98/NT/2000'

root  (hd0,0)
  Filesystem type unknown, partition type 0x7
makeactive
chainloader +1

Loading stage 2..

GRUB loading, please wait...
Error 18
When I load Linux, I find the following:
Code:
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?
 
Old 12-08-2009, 05:30 PM   #15
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,510

Rep: Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491
Quote:
Filesystem type unknown, partition type 0x7
The error above shows that Grub recognizes the windows partition (0x7).
Try replacing the "root (hd0,0) with rootnoverify (hd0,0)

Quote:
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
or too many mounted file systems
Do you have more than one entry in /etc/fstab for sda1?
 
  


Reply



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
Dual boot WinXP/Debian, grub error booting WinXP ChemBot Linux - General 5 02-22-2007 04:13 PM
reinstalling winXP on an existing dual boot system with winXP and FC4 grub not workin champion Fedora - Installation 3 02-13-2006 02:37 PM
Dual-booting MEPIS and WinXP, I want Grub to default to WinXP jjf Linux - Newbie 8 01-19-2006 03:27 AM
Problems w/Grub (WinXP, WinXP & SUSE) worldofaaron Linux - Newbie 12 01-24-2004 06:26 PM
i got RH8 & WinXP installed and properly working by GRUB. how can i reinstall WINXP? kublador Linux - Newbie 4 06-23-2003 12:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:11 PM.

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
Open Source Consulting | Domain Registration