Linux Lite Forums

Software - Support => Installing Linux Lite => Topic started by: antenor on November 14, 2015, 01:16:25 PM

Title: [SOLVED] Trouble with GRUB re-installation
Post by: antenor on November 14, 2015, 01:16:25 PM
Hello all,

I have Windows on sda1 and 2, Lite /, swap and /home on sda3, 5 and 6 and left some unallocated space for experimentation! I installed
there recently a few distros to see what they got in real installation because in VB, apart from being slow, I have to use scroll bars.
In order to avoid troubles with GRUB conflicts I installed each fresh installed distro's GRUB on each one's / and over them all I tried to re-install
Lite's GRUB (please, feel free to laugh!!!). Everything was going according to plan in the terminal, up to the final command "sudo update-grub"
where instead of a glorious boot menu with all the OS listed, I found myself in front of a black screen!
I boot in the live mode trying to mount Lite's / and re-install GRUB, where I see in the terminal that everything is where it supposed to be although
unmounted and as soon as I give the commands "sudo grub-install...." and "sudo update-grub" in the end, it turns back "grub-install: error:
failed to get canonical path of '/cow'
What are the proper commands to fix this and what did I do wrong?

Thank you in advance!  :)



Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: gold_finger on November 16, 2015, 06:58:57 AM
In order to avoid troubles with GRUB conflicts I installed each fresh installed distro's GRUB on each one's / and over them all I tried to re-install
Lite's GRUB

If you installed (grub) boot loader for other distros to their respective root partitions, then all you needed to do is boot back into LL afterwards and run this command to add them to LL grub's boot menu:
Code: [Select]
sudo update-grub]Because of modifications made to LL's grub configuration, trying to boot LL from the grub of a different distro ends up being extremely difficult.  Therefore always a good idea to leave LL's grub in charge of booting the machine (which is what you were trying to do).  In your case, you didn't need to try installing LL's grub to each distro's root partition afterwards (if that's what you were doing) and that ended up just causing problems.

Now, to get LL booting again, boot from live LL disk and follow instructions below in a terminal.  Each line below needs to be entered separately and in the order shown.   [Note: anywhere you see "XY" or "X", change that to the correct drive letter ("X") and partition number ("Y") for your LL root partition.]

Code: [Select]
sudo mount /dev/sdXY /mnt
for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
grub-install /dev/sdX
update-grub
exit
for i in /sys /proc /dev/pts /dev; do sudo umount /mnt$i; done
sudo umount /mnt
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: antenor on November 16, 2015, 08:36:05 AM
Hello gold_finger,

I can't thank you enough for your immediate and complete reply! I only have to ask you
a) do I type everything you wrote me in my terminal (including "for i", "do", "done", "exit"
and b) don't I have to mount back all of the partitions one by one?

Thank you very much!!!  :)
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: gold_finger on November 16, 2015, 08:58:52 AM
a) do I type everything you wrote me in my terminal (including "for i", "do", "done", "exit"

Yes.  Do all lines (one at a time) exactly as shown.  (Just need to change /dev/sdXY to whatever your LL root partition is; and /dev/sdX to whatever correct drive letter is.  If not sure which is root partition, run sudo blkid -c /dev/null and look for it in the output.


b) don't I have to mount back all of the partitions one by one?

First command mounts the root partition to the "live" DVD/USB environment.  Last command unmounts it when you're done re-installing grub.  After that shutdown computer and remove live DVD.  Reboot and your installed LL on the hard drive should now boot properly.  If you've got other distros on the drive, they will show-up on the grub boot menu too.

No need to remount anything in live environment if that is what you were asking.  No need to mount any partitions other than the LL root partition to the live environment to repair grub booting.  Only exception to that would be if you had a separate "/boot" partition; but I'm assuming that's not the case because you didn't say you had one.  (If you didn't explicitly create one when you first installed LL, then you don't have one and the boot files are on the root partition.)
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: antenor on November 16, 2015, 09:17:04 AM
Thank you again for your assistance!
I am trying it right away and will send
you feedback!!!  :) :)
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: antenor on November 16, 2015, 10:45:55 AM
Thank you so very much dude,

I got my computer back and running extra super!!!!!
You are so excellent!!!  :) :) :) :) :) :) :) :) :) :)
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: gold_finger on November 16, 2015, 01:31:08 PM
Glad everything worked out.  Welcome to Linux Lite.
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: antenor on November 16, 2015, 03:32:12 PM
With guys like you to support and welcome me I think I will stay here forever!
One thing though is for sure : as soon as I return to Greece I am going to see
how can I send you a donation!!! :D :D :D
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: Jerry on November 16, 2015, 05:32:44 PM
With guys like you to support and welcome me I think I will stay here forever!
One thing though is for sure : as soon as I return to Greece I am going to see
how can I send you a donation!!! :D :D :D

Send it to gold_finger, he is awesome!
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: antenor on November 18, 2015, 10:22:49 AM
Could you make this a bit easier for me? (the donation thing)
I mean send me instructions or a guiding link maybe about it.
All I know is I have to get a credit card and sign in to paypal.
Sorry for asking all these but I am new to everything I guess!
Thank you!  :) :)
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: gold_finger on November 19, 2015, 11:49:28 AM
Linux Lite home page (https://www.linuxliteos.com/) has a "Donate" link on it.  Here is direct link:  https://www.linuxliteos.com/donate.html (https://www.linuxliteos.com/donate.html)
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: antenor on November 19, 2015, 01:26:15 PM
Thanks a lot for your reply my friend!

Yes, one can easily see the link you sent me, it's on our front page anyway! But I could find in there
nothing but guiding to sign in to paypal and donators' names but don't bother, it's because I have never
used paypal before I guess.
As soon as I get this ready (the credit card thing) and still have some problem I will let you know!

Thanks again for your care.  :) :)
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: Wirezfree on November 19, 2015, 04:11:57 PM
@gold_finger

Sorry for jumping on the thread, but it is on topic, I'm just about to do a "dual boot" with Windows7 for a friend.

Currently Win7 is the only OS installed, with bios in legacy mode, and it's in a single partition on the disk#1
I want to add LL, If I do the "something else" install, to have it on the 2nd partition on the 1st disk, when I get to the boot loader choice
I assume I say do it to that partition, rather than the MBR.??, and LL will then add it to the Grub during install..?


I will use "something else" so I can create the separate / on disk#1 and /home /swap on disk#2

Many Thanks
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: firenice03 on November 19, 2015, 04:59:16 PM
@Wirezfree...
Not 100% on the swap, but I think /swap is typically created on its own partition by default..
I just did a dual with Win7 and set a separate partition for /home.. Real easy  ;D , the /home folder resides where it normally would and did not require mounting...

Some specifics are here:
https://www.linuxliteos.com/forums/introductions/hello-and-system-req-for-lite/msg18916/#msg18916 (https://www.linuxliteos.com/forums/introductions/hello-and-system-req-for-lite/msg18916/#msg18916)
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: antenor on November 19, 2015, 05:12:40 PM
What I did on my machine is GRUB installation on the MBR and my Windows 7 had no
problem at all with that, no conflicts at all.
It is just that on the GRUB booting list Lite comes first - of course, since it is the Linux
bootloader - and Windows second.
There are some limitations on the MBR partitioningn system which I am sure you already
know.

Happy tinkering!  :) :)
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: Wirezfree on November 19, 2015, 08:53:21 PM
@firenice
Ever since I began, and after reading recommendations I have always done a: /  /home and /swap type set-up's
I have never actually just let it do it's own thing..


@antenor
Yes, I read a lot of things on multi boot, there seems to be pro's and con's to different methods, just looking for least problematic
- Put grub entry in each's OS / root partition, but then I think you need something like "EasyBCD"?
- Just add each OS to the mbr, and let Linux do it's thing, but may need to use repair-grub if OS's not detected.?

I'm also certain my friend is going to ask to also add on Linux Mint,
I got him interested in Linux, he tried Linux Lite, the he found Mint.
So I may be trying a "Triple Boot...
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: firenice03 on November 19, 2015, 09:16:29 PM
I'm also certain my friend is going to ask to also add on Linux Mint,
I got him interested in Linux, he tried Linux Lite, the he found Mint.
So I may be trying a "Triple Boot...
FWIW on mine I triple booted, I had Win7, then Mint then Lite.. I chose the Along Side for each Mint and Lite.. Grub updated automatically after each. It worked out, now not sure what troubles I will run into if I need to reinstall/install newer version of Mint or Lite...
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: Wirezfree on November 19, 2015, 11:38:14 PM
@firenice03
Well assuming you don't break it  :'( :'( ,
and there is nothing compelling in the next LTS version..?? You can worry about that in 2019 :) :)


Having never done an "Along Side" install, does it still give you the partition size & location options..??
I want / on 1st disk & /home & /swap on 2nd disk


cheers
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: gold_finger on November 20, 2015, 12:59:24 AM
@Wirezfree,


Setting up Root on disk one and Home and Swap on disk two is fine.  Yes, you'll need to manually make each of those partitions.  (Swap won't get automatically made with a "Something else" install.)  You can either make them from partitioning page of the installer (using "Something else" option), or you can make them ahead of time with GParted on live LL, then set mount points during "Something else" install.


If you make them ahead of time, when you get to partition selection page of "Something else" install highlight your pre-made Root partition and click the "Change" button.  That will bring up a window where you tell it to:
Do same thing for the Home partition except change mount point to "/home".


No need to do anything with pre-made Swap partition.  Installer will recognize and use it automatically.


"Device for boot loader installation" should be the MBR of the boot drive (drive 1), not the LL root partition.  So, likely "/dev/sda".  If you choose the LL root partition it won't boot unless you do something like install EasyBCD to Windows and add LL boot option to that.


If machine came with Win 7 pre-installed, I'd highly recommend that your friend make a set of reinstall/repair DVDs for Win 7 if they haven't already done so before installing LL.  (There is usually a way to do that built into the system from manufacturer.)  That will make things easier to fix if something gets messed up later.  Also, if you'll be needing to shrink any Windows partitions to make room for the LL install, best to defragment the drive(s) and do the shrinking from Windows disk manager ahead of time to minimize potential problems.




Quote from: Wirezfree
Having never done an "Along Side" install, does it still give you the partition size & location options..??
I've never done that type of install either, but answer to question is "No".  It will allow allotting overall size to use for LL, but it will then use that space to automatically make only a Root and Swap partition to sizes it determines are best.  You won't be able to make a separate Home partition and won't be able to specify which partitions go on which drive.
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: Wirezfree on November 20, 2015, 01:53:45 AM
@gold_finger
as always really good useful guidance/pointers... :)
The NUC was barebones, so he added a M2 NVME SSD and a regular 2.5"HD

I set the BIOS for Legacy & turned off secure boot.
I installed Win7, that was a challenge Win7 does not see NVME drives out of the box.
So had to install to 2nd drive, add 2 MS hotfixes, then "clone" to NVME, So Win7 installed and working.

I had all ready been thinking about pre-partitioning, given what I think/know he will want
disk#1
> Win7 already installed
> / Linux Mint Root(ext4)
> / Linux Lite Root(ext4)
> spare
disk#2
> D:\ already done for Win7
>/home Linux Mint(ext4)
>/home Linux Lite(ext4)
>/mnt/files(NTFS) for mounting in all OS's F:\ for windows and mount it as files for Linux

Given he's got 16GB ram, he runs 2/3 VM's to do various things in, and on reading/research I think swap is not needed,

but it could be added in spare space on disk#1,
either a shared swap between Mint/Lite, but then no hibernation allowed.
or create Extended partition with 2 swap partitions. but 2 X 16GB+ swap files is 32GB+ of potentially wasted disk space.
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: antenor on November 20, 2015, 03:37:48 AM
Hello Wirezfree,

please let me speak by what I gained from this recent experience I had which by gold_finger 's guidance had a happy ending!
Install Mint 's GRUB on its / partition and Lite 's one on the MBR. This way you are going to avoid GRUB conflicts.
And yes, it is always good to have swap memory partition, your friend might won't need it but it is better to have it than miss
it, since he doesn't have a problem with his drive 's space.
But no, you won't have to create two separate swap partitions, one will work for both Linux OS.  :) :) :)
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: Wirezfree on November 20, 2015, 04:34:12 AM
@antenor,
If I read gold_finger correctly boot loader should be disk#1 mbr, and not / of OS otherwise I would need to use EasyBCD.
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: gold_finger on November 20, 2015, 05:48:35 AM
@Wirezfree,


antenor is correct on both counts:  only one Swap needed and will be used by both Mint and LL; and install Mint's grub to its Root partition and LL's grub to MBR of whatever drive is set to boot the computer (I'm assuming that will be /dev/sda).


If friend doesn't use hibernation, then you could get away with no Swap, but might not be bad idea to have a small 1-2GB Swap just in case it's ever needed.  For hibernation make one Swap slightly larger than 16GB.


If installing Mint first, you can install grub to MBR so that you're able to boot into new install and check it before installing LL.  But be sure to then install LL's grub to MBR (overwriting Mint's) afterwards to make sure LL is in charge of booting.  If you install Mint after LL, then make sure you direct boot loader to its root partition.  Then log into LL and update grub to add Mint to boot menu:
Code: [Select]
sudo update-grub

LL's grub code was altered a bit to make dual boots with Windows easier, (I think), but causes errors and won't boot LL when trying to multi-boot with other Linux distros if their grub is in charge of booting.  So, when multi-booting with other distros always make sure LL's grub is the one installed to the MBR and controlling the boot process to avoid having to manually edit grub files to boot LL.




Just to clear up any remaining confusion, if no grub is put on the MBR that would mean Windows boot loader remains in charge of booting.  In that case, Windows would not "see" the Linux distro(s) installed and you wouldn't be able to boot into them.  That's when you would need a tool like EasyBCD installed on Windows.  Grub on the MBR will recognize Windows and boot it, but Windows boot loader won't do that with Linux.
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: antenor on November 20, 2015, 06:00:22 AM
Hello Wirezfree,

I am sorry for not telling you the whole story but I guessed you would catch the clue
by reading what gold_finger answered me.
Given there is Windows 7 installed on the machine, you install Lite beside it, putting
GRUB on MBR, so you will have a dual boot install with Lite first on the booting list as
I already wrote you before and Windows second.
Afterwards you install Mint putting its GRUB on its / and NOT on MBR. You open up your
terminal giving the command   sudo update-grub
and that 's it. You got the triple booting machine you wanted.   ;) :) :)
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: Wirezfree on November 20, 2015, 07:16:27 AM
Thanks both for the clarifications and further details, much appreciated.
Now I need to get on and do it... I will post back
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: technomancer on November 20, 2015, 02:19:14 PM
For Wirezfree

Hello Wirezfree,

I am sorry for not telling you the whole story but I guessed you would catch the clue
by reading what gold_finger answered me.
Given there is Windows 7 installed on the machine, you install Lite beside it, putting
GRUB on MBR, so you will have a dual boot install with Lite first on the booting list as
I already wrote you before and Windows second.
Afterwards you install Mint putting its GRUB on its / and NOT on MBR. You open up your
terminal giving the command   sudo update-grub
and that 's it. You got the triple booting machine you wanted.   ;) :) :)

I use this same method and it works ! After installing another OS, boot to LinuxLite and---> sudo update-grub
Just remember if you want to triple boot, quad boot, etc.-> to always install grub to the root ( / ) of the drive you installed to. (linux)
I am booting 7 OS's using this method and multiple Hdd's.
I have multiple hdd's with win7,xp, 8 and linux (several versions) and use LinuxLite grub as the main bootloader.
If you break the boot, there is a guide here to get it setup again.

* side note- you must have windows installed FIRST to any HDD in order to have no issues. It's A nightmare if you reverse the order.
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: antenor on November 20, 2015, 03:28:41 PM
Hello Wirezfree,
I am sorry for once again for not having given you all the details. I wrote you that after Mint 's
installation and having put its GRUB on its / you open up a terminal.
technomancer is absolutely right on what he pointed out, you have to restart your machine and
after booting in LITE - not any other OS - you open up a terminal and update its GRUB so it covers
the freshly installed Mint as well.
However, what technomancer and me are doing here is giving you just a practical way for the
triple booting system you want. It is actually gold_finger 's answers you have to study to really
benefit yourself by his knowledge, because HE IS THE MAN!!!  :) :)
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: Wirezfree on November 20, 2015, 03:47:29 PM
@technomancer
Thanks again for the further details, very much appreciated.
@antenor,
No problems, small and subtle choices can make all the difference :)
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: antenor on November 20, 2015, 03:59:07 PM
So go for it man,

you have all the tools, if a newbie like me did it you surely can too! :) :)
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: technomancer on November 20, 2015, 08:10:15 PM
Not a problem.  8)
If you need any help multibooting let me know. Legacy though ! LOL
-As for UEFI, antenor covered that. gold_finger is definitely the person to ask about UEFI, or just follow his guides.
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: Wirezfree on November 21, 2015, 02:25:41 PM

I have an an update... Not a positive one. :(

To avoid taking this tread completely of topic, I'm going to start a new thread.
"NUC Install Issues - nvme pcie drive..?? (https://www.linuxliteos.com/forums/hard-drives-and-ssd's/nuc-install-issues-nvme-pcie-drive/msg19013/?topicseen#msg19013)"




Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: antenor on November 21, 2015, 03:49:35 PM
Just keep calm,

and always read what gold_finger writes in his posts because he is the one who guided
at least me in solving the problem mentioned in this post with his deep knowledge in
Linux and certainly care for help.

Best regards
Title: Re: [SOLVED] Trouble with GRUB re-installation
Post by: Wirezfree on November 21, 2015, 04:33:53 PM
Yes, hopefully it can be solved... I have more info... but will post to new thread.