Jump to content

Can't boot Linux after Re-installing WinXP[solved]


TwoFace
 Share

Recommended Posts

OK, hello! Please, help me with my problem.

I had Mandriva Linux 2008.0 PowerPack and Windows XP SP2 on my hard drive, and all worked well. But suddenly, this *bad* Windows crashed, and I reinstalled it. But now I cann't boot to my Linux! I've read here that I can rescue my system using installation disk, but this don't work!

Here my steps:

1. I boot from installation DVD

2. I choose rescue from menu

3. I choose mount your partitions under /mnt:

Please wait, trying to find your root device...
running: vol_id /dev/loop0
/dev/loop0: unknown volume type
running: vol_id /dev/sda
/dev/sda: unknown volume type
running: vol_id /dev/sda1
running: vol_id /dev/sda3
running: vol_id /dev/sda4
running: vol_id /dev/sda5
=> found a Mandriva Linux root partition on /dev/sda3
=> type ext3, version 'Mandriva Linux release 2008.0 (official) for i586'
Mounting other partitions from fstab on /mnt...
Your system is ready on /mnt

4. I choose Re-install boot-loader:

Installing boot loader...
running: sh /boot/grub/install.sh with root /mnt

GNU GRUB version 0.97 (640K lower/ 3072K upper memory)

[Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a devise/filename.]
grub > root (hd0, 3)
Filesystem type unknown, partiton type 0x82
grub > setup --stage2=/boot/grub/stage2 (hd0)
Error 17: Cannot mount selected partition
grub > quit

Also, I've tried this without step 3 - same effect.

 

Here what shows Partition Magic 8.0 about my hard drive:

*********************************************************************
* Partition			 * Type		  * Size MB   * Used MB   * Unused MB * Status * Pri/Log *
*********************************************************************
* Disk 1				*				  *			  *			   *				 *		  *		   *
*********************************************************************
* Local Disk (C:)	  | NTFS		 | 20 010.6   | 14 847.7  | 5 162.9	  | Active | Primary *
* (*)					 | Extended	| 100 508.2 | 100 508.2 | 0.0			| None  | Primary *
* Local Disk (D:)	  | NTFS		 | 100 508.2 |  97 525.2  | 2 983.0	  | None  | Logical  *
* Local Disk (*: )	  | Linux Ext3   | 31 078.9  | 31 078.9   | 0.0			| None  | Primary *
* SWAPSPACE2 (*: ) | Linux Swap | 1 027.6	| 0.0		   | 1 027.6	  | None  | Primary *
*********************************************************************

I have SATA hard drive 160 Gb, 1 Gb RAM

 

Please, help me, cause I really need my Linux back!

Thank you!

 

P.S.: Sorry for bad English!

Link to comment
Share on other sites

Thank you for answers!

 

Just choose "Reinstall boot loader." It should be fine.

When I choose this, I have the same as I discribed in my post#1, step 4

And do not install grub to the root partition, but to the MBR instead ( /dev/sda).

Mmm, really, I don't know how to do this.

I tried this: I choosed Go to console, and then type:

grub-install /dev/sda

And this was the answer:

mkdir: cannot create directory '/boot': file exists

Any ideas?

Link to comment
Share on other sites

Do not mount your partitions.

 

1) boot rescue

2) Choose "reinstall boot loader." Do not choose to mount your partitions first. Do not choose this. Do not mount your partitions. Allow the rescue disk to do what it needs to do. When you are choosing to mount the partitions first, you are choosing to manually do things which interferes with the automatic process. Let the rescue system do it. Do not mount your partitions unless you understand how to manually fix the boot record.

3) Allow it the default install to the MBR. Do not change the installation to the linux boot partition. It should install to the drive's MBR, which contains the current windows boot loader.

Link to comment
Share on other sites

Mmm, how I said, I've tried this.

I boot from DVD, choose Rescue, reinstall boot loader and have this:

Installing boot loader...
running: sh /boot/grub/install.sh with root /mnt

GNU GRUB version 0.97 (640K lower/ 3072K upper memory)

[Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a devise/filename.]
grub > root (hd0, 3)
Filesystem type unknown, partiton type 0x82
grub > setup --stage2=/boot/grub/stage2 (hd0)
Error 17: Cannot mount selected partition
grub > quit

 

Here is the contents of install.sh:

grub --device-map=/boot/grub/device.map --batch <<EOF
root (hd0,3)
setup --stage2=/boot/grub/stage2 (hd0)
quit
EOF

Edited by TwoFace
Link to comment
Share on other sites

Try the manual install method for grub. This is how I normally do it, but you need to know which partition is which for swap, / and /home. If you have others, well, that's OK too, but just need to identify them.

 

Once you know which one is /, you should just need to do something like this:

 

mkdir /mnt/myinstall
mount /dev/sda3 /mnt/myinstall
chroot /mnt/myinstall
source /etc/profile
grub --no-floppy
root (hd0,2)
setup (hd0)
quit

 

replace /dev/sda3 with whatever yours is for / and also change hd0,2 accordingly. I'm assuming your / will be /dev/sda5 or /dev/hda5 depending on ide/scsi disks. If this is the case, the (hd0,3) is what you'll need as what is mentioned in your response above from attempting to run the automatic install.

 

If it's still not working, then we'd need to see the output after what you've tried from my example of doing it manually.

Link to comment
Share on other sites

If you are uncomfortable with messing around, you can also perform an install, choosing the "upgrade" option rather than full install. Mandriva should find the original installation, identify the partitions, (check that it does) and then zip thru the upgrade without installing anything. Finally, it will install the boot loader.

Link to comment
Share on other sites

If it's still not working, then we'd need to see the output after what you've tried from my example of doing it manually.

Ok, I've done what you say. And we have some progress: GRUB is installed, but unfortunately I still cann't load Linux.

It says that it cann't mount partition.

Here contents of \boot\grub\menu.lst

timeout 10
color black/cyan yellow/cyan
gfxmenu (hd0,3)/boot/gfxmenu
default 2

title linux old kernel
kernel (hd0,3)/boot/vmlinuz-desktop BOOT_IMAGE=linux_old_kernel root=/dev/sda4 resume=/dev/sda3 splash=silent mem=1024M vga=788
initrd (hd0,3)/boot/initrd-desktop.img

title windows suxxx
root (hd0,0)
makeactive
chainloader +1

title linux 2.6.22.12-1
kernel (hd0,3)/boot/vmlinuz-2.6.22.12-desktop-1mdv BOOT_IMAGE=linux_2.6.22.12-1 root=/dev/sda4 resume=/dev/sda3 splash=silent mem=1024M vga=788
initrd (hd0,3)/boot/initrd-2.6.22.12-desktop-1mdv.img

 

Using lsparts I've fond that

sda1 - ntfs (C:)

sda3 - ext3

sda4 - swap

sda5 - ntfs (D:)

 

So, the root partition is sda3. Maybe I need edit \boot\grub\menu.lst something like this:

.....
title linux 2.6.22.12-1
kernel (hd0,2)/boot/vmlinuz-2.6.22.12-desktop-1mdv BOOT_IMAGE=linux_2.6.22.12-1 root=/dev/sda3 resume=/dev/sda3 splash=silent mem=1024M vga=788
initrd (hd0,2)/boot/initrd-2.6.22.12-desktop-1mdv.img

?

But I'm not sure about resume=.... entry.

Link to comment
Share on other sites

Ok, I've changed that file. Now I can start loading my Linux. But, after setting the hostname system halts with this message:

Checking root file system

fsck.ext3: Bad magic number in super-block while trying to open /dev/sda4

/dev/sda4:

The superblock could not be read or does not describe a correct ext2 filesystem.....

 

Hmmm, now I really don't know what to do... Why it tries to open /dev/sda4, why it checks for ext2 filesystem? I have ext3 on /dev/sda3... Please, help! :sad: :wacko:

Edited by TwoFace
Link to comment
Share on other sites

Perchance, did Partition Magic want to "fix" the partitions in order to read them?

 

Hm, what do you mean? When I run PartitionMagic only silence I hear!

 

Added: Hm, when I select ext3 partition and choose Check for Errors, I have an error "Access violation at address 004B8016 in module 'PMagicnt.exe' Read of address 00000004C"

Edited by TwoFace
Link to comment
Share on other sites

My Partition Magic 8 damaged a Linux installation by "fixing" it. As a result, I stopped using it when in windows. I had to perform a new installation in order to fix the partition error created by partition magic.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...