LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Grub Problem - Cannot Load Linux (https://www.linuxquestions.org/questions/linux-newbie-8/grub-problem-cannot-load-linux-767340/)

Jay88 11-06-2009 11:14 AM

Grub Problem - Cannot Load Linux
 
Hi

I have a dual boot system with XP and Fedora and I made some changes to my XP partition and now rather than receiving the usual grub menu list I am taken to a grub prompt -> grub>

I have searched high and low for a solution to this and was able to come across some commands which have enabled me to log into Windows using the 'chainloader+1' command but I can no longer locate my Linux partition.

I tried using the fedora cd to repair my system but it could not find Linux on my system. I tried using the 'find /boot/grub/stage1' command but it could not find anything. I also used a mepis Live cd and ran the command
Fdisk -l with the output below

Device Boot Start End Blocks Id System
/dev/sda1 * 1 2294 18426519 7 HPFS/NTFS
/dev/sda2 2295 8031 46082448 7 HPFS/NTFS
/dev/sda3 8032 20779 102398309+ f W95 Ext'd (LBA)
/dev/sda5 8032 20779 102398278 7 HPFS/NTFS

My 3 windows partitions are fine on sda1,2 and 5 but there is no output for my Linux partition - Does this mean that my Linux install has gone forever or is there any way I can still rescue it?

ammorais 11-06-2009 11:33 AM

Quote:

Does this mean that my Linux install has gone forever
By your fdisk output it looks that way.

Quote:

...XP and Fedora and I made some changes to my XP partition
Did you use windows to make those changes? If so, there is your problem.

Jay88 11-06-2009 11:41 AM

Quote:

Originally Posted by ammorais (Post 3747279)

Quote:
Does this mean that my Linux install has gone forever
By your fdisk output it looks that way.

Did you use windows to make those changes? If so, there is your problem.

Yes I did, but the change was only made to my primary partition.

So if I have now lost all of my Linux files, how do I get rid of grub - no point in prolonging the inevitable....

ammorais 11-06-2009 11:48 AM

Code:

Yes I did, but the change was only made to my primary partition.
Windows as the bad habit of thinking is alone in the OS world. So the windows disk partitioner should only be used in 100% Windows machines.

If you had sensitive data on the linux partition it may still be possible to recover it, although you probably need some physical expert help.

To unninstall grub, here's a manual:
http://www.cyberciti.biz/faq/linux-h...ninstall-grub/

Jay88 11-06-2009 12:02 PM

Quote:

Originally Posted by ammorais (Post 3747288)

If you had sensitive data on the linux partition it may still be possible to recover it, although you probably need some physical expert help.

To unninstall grub, here's a manual:
http://www.cyberciti.biz/faq/linux-h...ninstall-grub/

I wouldn't say it was sensitive data but it will definitely be a major pain to lose all of my configuration files and all of the tools I had installed - It took me a long time to get things working exactly the way I liked. Thanks for the link.

Larry Webb 11-06-2009 01:23 PM

Quote:

Originally Posted by Jay88 (Post 3747300)
I wouldn't say it was sensitive data but it will definitely be a major pain to lose all of my configuration files and all of the tools I had installed - It took me a long time to get things working exactly the way I liked. Thanks for the link.


I know this may not help but it is easier the next time around. If you get it back up check out the different ways to create backups.



Larry

jamwaffles 11-06-2009 02:36 PM

Hi

surely (can anyone please back me up on this) if you had the patience and the storage to do so, you could take an image of the entire disk. You'd need a live disc and another hard disk the same size or bigger than youre original. Doing this takes each byte and copies it to a new location.

it uses the "dd" command. another poster may be able to help you here

James

thorkelljarl 11-06-2009 02:37 PM

Partition table...

You can try to restore your partitions with TestDisk. You might be advised to make a clone copy of your HDD with the command "dd" or with Clonezilla. This lets you try a restoration and fail without loosing data and gives you a chance to try again.

Do not write anything to the HDD.

http://www.cgsecurity.org/wiki/TestDisk

http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step

yancek 11-06-2009 02:38 PM

You might try SystemRescueCD which has TestDisk to recover data.

http://www.sysresccd.org/Main_Page

Jay88 11-06-2009 02:45 PM

Quote:

Originally Posted by thorkelljarl (Post 3747466)
Partition table...

You can try to restore your partitions with TestDisk. You might be advised to make a clone copy of your HDD with the command "dd" or with Clonezilla. This lets you try a restoration and fail without loosing data and gives you a chance to try again.

Do not write anything to the HDD.

http://www.cgsecurity.org/wiki/TestDisk

http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step

Thanks I will have a look at TestDisk and SystemRescueCd.

Jay88 11-06-2009 03:44 PM

OK I think I might be almost back in business but I am still having the grub problem - The TestDisk utility recovered my Linux partitions and I have written them to disk but grub is still not loading.

My output from Fdisk -l in the mepix live cd is now -

Code:

Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x497f497e

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1        2294    18426523+  7  HPFS/NTFS
/dev/sda2            2295        8031    46082452+  7  HPFS/NTFS
/dev/sda3            8032      38912  248051632+  f  W95 Ext'd (LBA)
/dev/sda5            8032      20779  102398278+  7  HPFS/NTFS
/dev/sda6          20780      20804      200781  83  Linux
/dev/sda7          20805      38912  145452478+  8e  Linux LVM

Disk /dev/sdf: 2056 MB, 2056257536 bytes
16 heads, 32 sectors/track, 7844 cylinders
Units = cylinders of 512 * 512 = 262144 bytes
Disk identifier: 0xc73d6767

  Device Boot      Start        End      Blocks  Id  System
/dev/sdf1  *          1        7845    2008304    e  W95 FAT16 (LBA)

Disk /dev/dm-0: 26.2 GB, 26239565824 bytes
255 heads, 63 sectors/track, 3190 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 62.9 GB, 62914560000 bytes
255 heads, 63 sectors/track, 7648 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-1 doesn't contain a valid partition table

Disk /dev/dm-2: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x30307800

Disk /dev/dm-2 doesn't contain a valid partition table

I can access the grub folder from a terminal in mepix but I am not sure what I should do next..

jamwaffles 11-07-2009 04:08 AM

You probably need to reinstall grub.

You can do this by (if i remember correctly)

sudo grub-install /dev/sda (or sdX where X is your drive letter)

If this is wrong, can someone please let me know. Im almost sure there are more commands but i cant remember them

James

Jay88 11-07-2009 07:56 AM

Quote:

Originally Posted by jamwaffles (Post 3748007)
You probably need to reinstall grub.

You can do this by (if i remember correctly)

sudo grub-install /dev/sda (or sdX where X is your drive letter)

I have already tried reinstalling using my Fedora cd but it did not work - not sure why..

I ran - chroot /mnt/sysimage to become root and then
grub-install /dev/sda6

thorkelljarl 11-07-2009 09:12 AM

Congratulations on the recovery...

This is a GRUB rescue utility that you can use.

http://www.supergrubdisk.org/

You can also use almost any linux live-cd, except fedora, to repair GRUB, including many rescue CDs.

http://www.sysresccd.org/System-tools

http://partedmagic.com/

jamwaffles 11-08-2009 04:44 AM

Quote:

Originally Posted by thorkelljarl (Post 3748221)
Congratulations on the recovery...

This is a GRUB rescue utility that you can use.

http://www.supergrubdisk.org/

You can also use almost any linux live-cd, except fedora, to repair GRUB, including many rescue CDs.

http://www.sysresccd.org/System-tools

http://partedmagic.com/

I use the ubuntu CD when i break my system.

James


All times are GMT -5. The time now is 06:54 PM.