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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-16-2017, 02:43 PM
|
#1
|
LQ Newbie
Registered: Jul 2017
Posts: 2
Rep: 
|
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
|
|
|
07-16-2017, 02:57 PM
|
#2
|
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342
|
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.
|
|
|
07-16-2017, 05:13 PM
|
#3
|
LQ Veteran
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,780
|
|
|
|
07-16-2017, 08:10 PM
|
#4
|
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
|
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.
|
|
|
07-17-2017, 11:24 AM
|
#5
|
Senior Member
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364
|
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.
|
|
|
07-17-2017, 11:46 AM
|
#6
|
LQ Newbie
Registered: Jul 2017
Posts: 2
Original Poster
Rep: 
|
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??
|
|
|
07-17-2017, 12:22 PM
|
#7
|
Senior Member
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364
|
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.
|
|
|
07-17-2017, 12:31 PM
|
#8
|
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342
|
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 .
|
|
|
07-20-2017, 05:01 AM
|
#9
|
Member
Registered: May 2017
Posts: 43
Rep: 
|
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.
|
|
|
07-20-2017, 06:13 AM
|
#10
|
LQ Newbie
Registered: Jan 2017
Distribution: MX
Posts: 14
Rep: 
|
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.
|
|
|
07-20-2017, 06:26 AM
|
#11
|
LQ Newbie
Registered: Jan 2017
Distribution: MX
Posts: 14
Rep: 
|
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.
|
|
|
07-20-2017, 06:54 AM
|
#12
|
LQ Newbie
Registered: Jan 2010
Posts: 5
Rep:
|
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.
|
|
|
07-20-2017, 07:35 AM
|
#13
|
LQ Guru
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 11,244
|
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.
|
|
|
07-20-2017, 09:48 AM
|
#14
|
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342
|
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.
|
|
|
07-23-2017, 02:34 AM
|
#15
|
LQ Guru
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, OS/2, others
Posts: 6,354
|
Quote:
Originally Posted by Breite_Gu
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).
|
|
|
All times are GMT -5. The time now is 06:38 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|