LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-16-2017, 02:43 PM   #1
Breite_Gu
LQ Newbie
 
Registered: Jul 2017
Posts: 2

Rep: Reputation: Disabled
Cool newbee lost grub after winXP reinstall


Hi there everybody,

I had an old Laptop which when setting up last, I had Knoppix installed (after XP) and set GRUB to handle the boot order.

Now I was forced to reinstall XP which results in GRUB not showing up any more ...

I believe it is an issue have had had before many times over, but for me is a headache, because

last same laptop saved me to read my broken NAS drive.

Is there any way to get back onto the old Knoppix - reactivating GRUB - without a "reformat" & "start from scratch" ...?

Anybody willing to coach me ....?

bestreg; Gu
 
Old 07-16-2017, 02:57 PM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: FreeBSD/Slackware-14.2+/ Win10
Posts: 9,495

Rep: Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034
yes that will always happen when you install in that order, it needs to be WIN first then Linux then install grub . else Windows will take over the MBR and boot loader else one goes into fix it mode .. that you are in now.

Code:
Run the following command to reinstall grub from the live CD, 
replacing /dev/sdX with the device name of the hard disk above. 
Omit the number. For example, if you used /dev/sda1 above, use /dev/sda here.
Restart your computer and Ubuntu should boot properly
that should also apply to your linux version. just boot a usb stick or whatever you got to boot a live Linux and use it to install grub to hdd in system and update grub, reboot, cross fingers.

Last edited by BW-userx; 07-16-2017 at 05:22 PM.
 
Old 07-16-2017, 05:13 PM   #3
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, fedora, ubuntu, others
Posts: 3,801

Rep: Reputation: 647Reputation: 647Reputation: 647Reputation: 647Reputation: 647Reputation: 647
here is two different ways of reinstalling grub using a live cd.
https://sites.google.com/site/kotkam.../debian-jessie
https://www.av8n.com/computer/htm/grub-reinstall.htm
 
Old 07-16-2017, 08:10 PM   #4
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,511

Rep: Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006
I boot with the install DVD, choose "rescue", chroot into the / partition of the Linux system, and run "grub-install". Then, everything should be back to normal.
 
Old 07-17-2017, 11:24 AM   #5
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec, CANADA
Distribution: Arch
Posts: 1,234

Rep: Reputation: 451Reputation: 451Reputation: 451Reputation: 451Reputation: 451
Another fairly painless way is to use Boot-Repair, available as a standalone live ISO. I keep it handy for just this type of thing and it almost always does the trick.
 
Old 07-17-2017, 11:46 AM   #6
Breite_Gu
LQ Newbie
 
Registered: Jul 2017
Posts: 2

Original Poster
Rep: Reputation: Disabled
Cool

Dear All,

thanks for the various hints, one or the other will hopefully put me on the right track ....

Since elsewhere I read to start the entire process with an >> fdisk -l << command ....

(when going into Linux I am booting a knoppix live-CD)

.... this is what I get in reply:

knoppix@Microknoppix:~$ fdisk -l

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00071c37

Device Boot Start End Blocks Id System
/dev/sda1 * 63 62910539 31455238+ 7 HPFS/NTFS/exFAT
/dev/sda2 62910540 488375999 212732730 f W95 Ext'd (LBA)
/dev/sda5 62910603 398460194 167774796 7 HPFS/NTFS/exFAT
/dev/sda6 398460258 482351624 41945683+ 83 Linux
/dev/sda7 482351688 488375999 3012156 82 Linux swap / Solaris

knoppix@Microknoppix:~$

To be honest I do not know which of the partitions to use (I tried sda1, but would not work)

Also I followed this sequence:

sudo grub
find /boot/grub/stage1

which gave me (hd0,5) in reply
when issuing

root (hd0,5)
setup (hd0,5)
sudo gparted

which in return (somewhere on the last 3 commands) was giving me a:

"Mismatched or corrupt versions of stage1 / stage2" in return ??

Any idea where to go next??
 
Old 07-17-2017, 12:22 PM   #7
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec, CANADA
Distribution: Arch
Posts: 1,234

Rep: Reputation: 451Reputation: 451Reputation: 451Reputation: 451Reputation: 451
Hi Breite_Gu,

Your linux system is on sda6 - that's likely where grub is installed. Again, though, boot-repair will detect this and offer to reset your MBR.

Cheers.
 
Old 07-17-2017, 12:31 PM   #8
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: FreeBSD/Slackware-14.2+/ Win10
Posts: 9,495

Rep: Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034
just need to re install grub to sda mbr grub will find your installed OS's and put them accordingly in the order to its list .
 
Old 07-20-2017, 05:01 AM   #9
Nobutarou
Member
 
Registered: May 2017
Posts: 38

Rep: Reputation: Disabled
Try SG2D, http://www.supergrubdisk.org/super-grub2-disk/.

Maybe you can boot your Linux. If you are unsure how you can re-install grub2, you can keep to use SG2D as boot manager.
 
Old 07-20-2017, 06:13 AM   #10
drunkenfist
LQ Newbie
 
Registered: Jan 2017
Distribution: MX
Posts: 14

Rep: Reputation: Disabled
You may also want to consider making an image of your freshly installed Windows partition, settings, drivers and all, so you won't have to go through the whole troublesome process again in case you ever feel the need to reinstall. Clonezilla does not touch GRUB and restoring takes only about 10 minutes, on my machine at least. Dedoimedo has nice tutorials.

http://www.dedoimedo.com/computers/f..._software.html

http://www.dedoimedo.com/computers/clonezilla.html

Last edited by drunkenfist; 07-20-2017 at 06:19 AM.
 
Old 07-20-2017, 06:26 AM   #11
drunkenfist
LQ Newbie
 
Registered: Jan 2017
Distribution: MX
Posts: 14

Rep: Reputation: Disabled
Sorry, I installed Windows first on my computer then Linux, so I do not know if that's the reason why GRUB doesn't get overwritten. Still, Clonezilla is convenient.

Last edited by drunkenfist; 07-20-2017 at 06:30 AM.
 
Old 07-20-2017, 06:54 AM   #12
woodysoft
LQ Newbie
 
Registered: Jan 2010
Posts: 5

Rep: Reputation: 0
I am not familiar with Knoppix, but as you are getting

Quote:
"Mismatched or corrupt versions of stage1 / stage2" in return ??
I would suggest that your live CD is a different version to your installed version. I would suggest the following:

  • Boot from the live CD
  • (specific to your list above): mount /dev/sda6 /mnt
  • chroot /mnt
  • mount /boot

Then you can run the commands you tried, and hopefully it will be the correct versions.
 
Old 07-20-2017, 07:35 AM   #13
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 8,833

Rep: Reputation: 1842Reputation: 1842Reputation: 1842Reputation: 1842Reputation: 1842Reputation: 1842Reputation: 1842Reputation: 1842Reputation: 1842Reputation: 1842Reputation: 1842
I haven't used Knoppix for some time so how old is the version you have installed. The commands you posted as using to re-install Grub would work if you have Legacy Grub but would totally fail if you have Grub2. Your post shows the result of the find command for a Grub stage1 file indicates it is found on (hd0,5) which would be correct as that would be sda6 in Grub Legacy and your Linux partition. If you haven't resolved this you have the setup command incorrect as it needs to point to the MBR which would be: setup (hd0) in your case.
 
Old 07-20-2017, 09:48 AM   #14
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: FreeBSD/Slackware-14.2+/ Win10
Posts: 9,495

Rep: Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034
how many days has past? you can always just reinstall Linux for whats worth and be done with it. if you'd separated your /home from root then no loss to your personal data (should) occur if you do that correctly.
 
Old 07-23-2017, 02:34 AM   #15
mrmazda
Senior Member
 
Registered: Aug 2016
Location: USA
Distribution: openSUSE, Debian, Knoppix, Mageia, Fedora, others
Posts: 2,080

Rep: Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650
Quote:
Originally Posted by Breite_Gu View Post
Also I followed this sequence:

sudo grub
find /boot/grub/stage1

which gave me (hd0,5) in reply
when issuing

root (hd0,5)
setup (hd0,5)
sudo gparted

which in return (somewhere on the last 3 commands) was giving me a:

"Mismatched or corrupt versions of stage1 / stage2" in return ??

Any idea where to go next??
find, root and setup are commands you run within the grub shell you started with the grub command. gparted is a command to run after quitting the grub shell. You should not get the mismatched versions error if you use the same Knoppix version to perform repair that you used to install Knoppix. Reinstalling WinXP should only have changed the MBR, not your (hd0,5) Knoppix partition. One cannot boot (hd0,5) from the generic MBR code WinXP installed. Setup needs to go either on (hd0), which overwrites what WinXP wrote there, or a valid Linux native primary partition, which in your case probably without repartitioning cannot be done because find only found a suitable target on a logical (hd0,5).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Grub not loading WinXP after XP reinstall kiwi_MTBer Linux - Software 9 05-06-2009 02:17 AM
My Sarge lost after reinstall winXP.....VFS:Can't find ext3.. deepclutch Debian 9 12-04-2005 12:01 AM
Need to reinstall WinXP, How do I keep my GRUB bootloader? jesusphreak Linux - Software 2 04-17-2005 10:38 PM
i got RH8 & WinXP installed and properly working by GRUB. how can i reinstall WINXP? kublador Linux - Newbie 4 06-23-2003 01:00 PM
how to reinstall grub after a winxp installation? zovres Linux - Newbie 1 04-28-2003 10:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:25 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration