unable to boot XP after removing HDD containing Linux
Hi All,
I had two Hard Drives 1) 80 GB containing XP 2) 40 GB containing RHEL 5.2 My dual boot worked perfectly previously. For some reasons, I need to remove my 40 GB HDD. Now, I just have my 80 GB XP drive. But, I am unable to boot my XP. This has happened to me many times, but every time when I ran FIXMBR from the XP CD, it worked perfectly. I did ran FIXMBR this time too, but it was giving my GRUB Disk error, so I ran FIXBOOT too. I guess I messed up this time. Now, I am getting this error Code:
Disk Error Pls anyone can help me out. |
The /boot partition in the linux drive may have a copy of the original MBR in the /boot/grub/ directory.
Boot up with a live distro and look at the disk with "fdisk -l". "fdisk -lu" may give you more accurate results. The first partition probably starts on sector 63. You won't see that without the -u option. Check if the disk is marked active (bootable). If the XP partition is there, can you mount it? How are the drive jumpers set? Master/Slave/Lone Drive/Cable Select? Run as root "file -s /dev/sda1" (or whatever device the XP partition is). Also try "file -s /dev/sda". Code:
/dev/sda1: Linux rev 1.0 ext3 filesystem data (needs journal recovery) --- I almost forgot. Be sure that the drive cable didn't work itself loose. |
Quote:
Thanks for the response. I have checked all the connections (cables etc). All are well. I dont have have that Linux 80GB HDD now. Also, my win XP C: Drive is NTFS, I dont think that will mount using Live Distro (like knoppix etc) I dont have much important files on it, the only thing is I have so many applications installed into XP. Installing all of them again, will be a great pain :( Is there any other way than to re-install XP ?? |
You may need to run "modprobe ntfs" before being able to read an ntfs partition. If there is a fuse module, and the ntfs-3g package is installed, then you can not only mount an ntfs partiton, but also write to it.
mount -t ntfs /dev/sda1 /mnt -o ro,fmask=0111,dmask=0000 --- lsmod | grep fuse # if you don't see the fuse module run `modprobe fuse' mount -t ntfs-3g /dev/sda1 /mnt -o ro, fmask=0111,dmask=0000 Suppose that you find out that the partition table is damaged. If the filesystem itself isn't damaged, you may still be able to mount it. I'd recommend mounting it and checking it out before attempting to fix the partition table. example: Here I ssh'ed into my desktop; attached a loop device; and mounted the loop device. I didn't wack my partition table for this example. If it were, however, I would guess that the first partition starts at sector 63. Code:
fdisk -lu /dev/sdb If I had needed to recover the location of other partitions, I could use "df" to locate the top of the first one, and try to repeat the process. Keeping track of the start of each partition, it is possible to reconstruct what the partition table should be. Code:
df --block-size=512 /mnt/sdb1 If the MBR were zeroed out, you would probably see a "no operating system" message instead of disk error. That has me concerned that the problem my be more serious. At least knowing whether you can access the disk using a live distro or rescue disk would provide usefull information. |
Sorry, but I am not sure how to help you. Fixmbr fixes Master Boot Record, where GRUB usually reside so it should worked. But in fixmbr info page is mentioned, that is may damage filesystem on that particular disk making it unreadable. But I dont thing that is what happened. Fixboot fixes boot sector on specified partition. There in case of dualboot XP loader is stored, so it should have no effect.
But I will try to give you hints what happened and how to prevent it from happening again. GRUB is too large to squeeze itself to MBR. So it keeps some part of itself on linux drive. Usually in /boot/grub/stage2. Removing Linux drive mean removing this part hence making GRUB unusable. You seems to do it quite often. So instead of using GRUB as you primary boot loader, use XP bootloader. Go check http://sourceforge.net/projects/grub4dos Dont be confused by the name. Grub4dos is what you want, not wingrub (which is just windows graphical frontend). If you read documentation you will find (in part UPDATE 1) that starting GRUB from XP boot loader is as simple as copying grldr to c:, modifying boot.ini and creating menu.lst (or using menu.lst from your Linux). It will not solve your current problem since it requires working windows booting. Edit: Ummm, sorry I missed that you are Linux admin. I wrote it as for newbie :) |
Sorry, but I am not sure how to help you. Fixmbr fixes Master Boot Record, where GRUB usually reside so it should worked. But in fixmbr info page is mentioned, that is may damage filesystem on that particular disk making it unreadable. But I dont thing that is what happened. Fixboot fixes boot sector on specified partition. There in case of dualboot XP loader is stored, so it should have no effect.
But I will try to give you hints what happened and how to prevent it from happening again. GRUB is too large to squeeze itself to MBR. So it keeps some part of itself on linux drive. Usually in /boot/grub/stage2. Removing Linux drive mean removing this part hence making GRUB unusable. You seems to do it quite often. So instead of using GRUB as you primary boot loader, use XP bootloader. Go check http://sourceforge.net/projects/grub4dos Dont be confused by the name. Grub4dos is what you want, not wingrub (which is just windows graphical frontend). If you read documentation you will find (in part UPDATE 1) that starting GRUB from XP boot loader is as simple as copying grldr to c:, modifying boot.ini and creating menu.lst (or using menu.lst from your Linux). It will not solve your current problem since it requires working windows booting. |
vikas027:
Following are my comments/suggestions to your last post: ====== Q--"I had two Hard Drives 1) 80 GB containing XP 2) 40 GB containing RHEL 5.2 ....... "Thanks for the response. I have checked all the connections (cables etc). All are well. I dont have have that Linux 80GB HDD now.---" Comment: You mean the 40GB containing RHEL? If your 40GB HD containing RHEL is no longer there then you have to approach the problem OUTSIDE Grub and outside Linux since the files of these system are gone with it. Your approach should be solely based on XP rescue tactics with only the 80GB running. AFAIU from your words only the HDD containing Xp is connected now and its MBR is not well. ====== Q---"Also, my win XP C: Drive is NTFS, I dont think that will mount using Live Distro (like knoppix etc)"-- Comment: A Gnu/Linux live can mount an NTFS. This is a matter of fact not a speculation. ====== Q---"I dont have much important files on it, the only thing is I have so many applications installed into XP. Installing all of them again, will be a great pain Is there any other way than to re-install XP ??"--- Comment: Yes there is of course. Are you using a Retail Installer for your XP? If yes then try do this: <Note: installers given free by manufacturers do not have this feature> Boot the Xp installer, after it loads hdwe drivers a prompt for choices comes: click "r" for Repair then enter into the rescue Console. There type help, a list of master boot record commands shall be listed aside from the common "fixmbr", use them according to your taste. This console saved me from trouble many times before during my windows days. Another way is again to boot the installer, choose "r" for repair, then choose "Install" in this method Xp will do two things: a) fix your mbr; b) install fresh copies of system files but keeping the same registry with your applications untouched. Last means, reattach your 40GB containing previous RHEL, try boot from it <if it doesn't boot you can boot by means of the Linux live cd, having in mind> to recover the original mbr kept by RHEL under /boot/grub folder, using 'dd' command in the terminal flash the old --pre RHEL-- mbr into the first sector of the 80GB HDD, this way your old Xp should boot again as it was before Linux. This method presumes that you have the two HDD's 40GB and 80GB mounted again. I hope this helps. |
Hi,
How is the current single drive configured? MASTER, Slave, Single or Cable Select? Some manufactures require that you remove or store the jumper when a Single drive is installed? Do you have the drive at the end of the cable? What happens when you boot a LiveCD or install CD? Is the drive shown by a 'fdisk -l'? |
I have got my 40GB HDD Linux drive back for obvious reasons. Linux GRUB was not coming initially, thus I ran grub-install /dev/hdd. Now, I have Linux running without a problem.
40GB HDD is master the one with Linux. and 80GB HDD is slave. They are on the the same data cable attached from motherboard. Quote:
Code:
Disk /dev/hdc: 40.0 GB, 40060403712 bytes Quote:
file -s /dev/hdd1 output Code:
[root@station1 ~]# file -s /dev/hdd1 GRUB.CONF Code:
# grub.conf generated by anaconda XP boot.ini output Code:
[boot loader] Thanks, for the response people. I owe you all. Really, I am feeling lucky to have so many helping hands for me. I respect this forum. |
Hey people,
Just to add some more info. Now, when I am trying to boot with other option (i.e. win XP) in the GRUB, I am getting a GRUB prompt. |
All times are GMT -5. The time now is 02:53 PM. |