GRUB not working
Hi all,
I am having trouble with my hard disk. Previously, I had a working Linux Mint Debian Edition partition and a Windows XP partition, all working and bootable through GRUB. However, I decided to replace LMDE with Debian, so on my Windows parition I deleted the LMDE parition. I downloaded Debian Live on to a USB flash drive, booted it, however during Debian installation it fails to install GRUB (or any other bootloader it offers). Somewhat confused, I aborted installation and went to reboot into Windows. However, when loading GRUB the error "no such parition" appears, and a rescue prompt appears. I am not sure how this happened, however I want to try and repair GRUB so I can have both my old Windows XP partiion (it's still fine, I can mount it in Debian) and a fresh Debian 6 partition. Here is my fdisk output: Code:
user@debian:~$ sudo fdisk -l So would anyone be able to help me in fixing this error? And I am unable to use apt-get to install packages that may fix this due to lack of Internet connection (had this in LMDE, I needed to install MadWifi which I'll do once I get it set up properly) however if need be I can get and transfer .deb packages from my phone. Thanks! |
If I am understanding you correctly, you deleted the LMDE partitions from within Windows, and that would be your problem. Windows Disk Adminstrator now called disk management in XP is nothing but problems; I'm leery of even opening it on a multi-OS system. That program will screw up any partition table that has anything on the disk that is NOT NTFS or FAT. I suspect that's how you got these errors:
Quote:
If you haven't done anything else to it, you may be able to bring the old LMDE back so you can start from there. 1. You need to back up the partitions of what you have so you can return to that if needed. sudo dd if=/dev/sda of=/dev/SomeUSBstick/WhateverFileNameUwant.mbr bs=512 count=1 2. Then you need to go backwards in partitioning. So if you tried to install Debian, and it partitioned, then boot it, run fdisk to delete the partitions it created. 3. Or go back into Windows (I think you boot the install disk, select recover w/F5 or something like that and run FIXMBR). Use this as a last resort, it will wipe out GRUB. 4. You may not need to do anything in Windows, if you just delete (w/Linux fdisk) all the other partitions that Debian created, and there is nothing but the sda1 NTFS part. 5. Now from a Linux live disk you can run gpart (use the man command to find out how) and it will try to Guess PARTitions. This will take awhile, and I forget the option it gives, but take the LONG, SLOW route if it asks you. IT should find the old partitions. IF you know the correct sizes, placements, let it restore. 6. After this, you'll probably have to reboot the Linux boot disk. Use fdisk to check and see if the correct partition has the bootable flag set. If so, GRUB *MAY* be restored and working correctly. If it is, and you can boot either Windows or LMDE, then boot your Linux live disk/USB and use the fdisk in the LMDE version or another of the LM editions to delete the LMDE partitions. At this point, if you're going to use Debian, you need to research how the install program handles the partitioning. If you can select empty Linux partitions that are already on the disk, I would create them the way I wanted while I had the LM live disk booted. Then do the Debian install. But if the Debian program expects to do the partitioning, then get rid of everything except the NTFS partition before starting the install. There should be *NO* partition errors w/a Windows/Linux system. You just have to partition and install correctly. Here's what I do to avoid problems. A. Boot Linux live and partition for Windows only - no other partition. B. Install Windows C. After Windows is installed, finished all it's rebooting through the installation, installing all the drivers, etc., i.e., when it's actually usable, then I D. Boot Linux live again, partition the rest of the disk, and install Linux. E. After Linux is installed, and both systems are bootable, I save a copy of the MBR so I can restore if something goes wrong (and w/Windows, it's a matter of when -- not IF). This MIGHT get you back going, but w/partitioning, there are NO guarentees. gentile |
Sounds a bit tricky and I do not have Windows CD or removable media except USB with debian. Can I not remove grub and Debian partitions?
|
Quote:
You can start all over by repairing your windows xp os. Hiren's-BCD has miniwinsxp you can repair from the command console. Then you can reinstall whatever linux distro you want. |
Alright, I have decided that I want to return to my Windows installaion. I will install Debian later on.
I have removed all partitions on my disk apart from the one Windows XP is on (/dev/sda1) and have set the boot flag on this parition. Code:
Disk /dev/sda: 40.0 GB, 40007761920 bytes Code:
GRUB loading. On a side note, while the kernel loads with my Debian stick, a warning appears mentioning that my Windows parition is "dirty". I'm not sure what this means or if it relates to the issue, but it says I should run chkdsk on Windows. I can't post the full message as I'm unable to copy it. Would anyone be able to tell me how it is possible to remove GRUB, still keeping my Windows parition (I don't want to re-install it, as I can't back up and I don't have a Windows CD/image). Thanks again! |
You can run chdisk from gpated-live-cd.
You can possibly run fsck from debian live. I noticed your wins installation is not at beginning of drive did you move it or erase some other partitions? Winsxp can be reinstalled via i386 folder you just have to findout if it's still there. |
Quote:
insert your windows cd then press R for (recovery mode),then press C (console),then enter 1(your windows installation drive 1 for c),and at last type fixmbr |
When you get the GRUB rescue prompt, enter the command set and note the value of prefix. That's probably the partition that's missing, and it's the one in which GRUB is trying to look for its grub.cfg file, and all the other files it needs to dynamically load in order to boot properly.
I.e., if you've deleted that partition, you need to re-install GRUB. That can, I believe, be done from inside a Windows system, but - other then telling you to look on-line - I don't know much more than that. |
Try not to give up on this; it's really not that hard. It just takes some time and patience. The software will take care of you most of the time, you just need to understand how to use it so it will work right.
|
If you want to remove GRUB from the MBR, you can use dd command:
dd if=/dev/zero of=/dev/sda bs=512 count=1 This will remove GRUB, but remember, then your system won't even show the grub prompt. You will have to install the windows bootloader on the MBR. fixmbr command will install the windows bootloader on MBR. |
All times are GMT -5. The time now is 03:52 AM. |