LINUX LITE 7.2 FINAL RELEASED - SEE RELEASE ANNOUNCEMENTS SECTION FOR DETAILS


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Dual-boot or multi-boot of Linux Lite (and others) with Windows 7
#21
Thanks gold_finger.  That gives me a lot to work on.....

I was reflecting on all of this overnight.  Remember I'm still new to all this.  Taking a step back, I wonder whether the fact that I'm using EasyBCD, and a laptop that still runs Win7, might make a difference to what I do as opposed to how austin.texas and you are doing this.

I am assuming that basically you are both running computers with Linux OSs.  So trying to analyse, or visualise, what happens, it would I guess go like this:

You will have a Grub bootloader from one of your distros in the "boot" sector (/dev/sda?) of your drive.  It will see its own OS.  And as you add a second and a third distro, that Grub will update (automatically or when you copy-and-paste an additional menu-entry and run sudo grub-update) to include and list the additional OSs.  And that grub will then boot whichever of the listed OSs you select.  So, if you like, the single Grub in the boot sector is in effect the "lead" bootloader and can, and does, boot any of the OSs it has in its boot menu.  Booting is a one-stage process.

Now, my situation is a bit different.

I have Win7 on my laptop.  I have the Windows bootloader in the MBR.  I have EasyBCD installed as a programme in Win7.

The idea behind EasyBCD is that you then install into separate partitions your additional or alternative OSs (Linux, or other Windows or Mac if you wish!), with each one's bootloader/grub also in the same partition as its OS.  The Windows7 bootloader remains untouched in the MBR.

Then...... you put entries into the Easy BCD menu that tell it what the other OSs are, and which partition each one is on.  EasyBCD evidently adds these, first, to Windows own bootloader in the MBR.  And by some alchemy, it also apparently tells the Windows bootloader that - if a Linux OS is selected - it has to hand on the booting task to the relevant Grub in whatever partition it is located.

So booting via EasyBCD is a two-stage process.  The Windows bootloader hands on to whichever - separate - grub belongs to the Linux OS you want to boot.

So far so good.  It works, when you have added one Linux OS (as I did with Mint, putting it and its grub into /dev/sda6).  The EasyBCD and Windows bootloader pass the task on to the Mint grub - which lists only Mint.  And Mint boots up.

The problem arose when I added a second Linux OS (Linux Lite).  I added it to EasyBCD's menu and entered the location of this second OS and its grub (they are in /dev/sda7).  EasyBCD added it to the Windows bootloader.  But EasyBCD, working via the Windows bootloader, can apparently only see, or cope with, one instance of Grub2.  So even though it's been told that LL and its grub are on /dev/sda7, when asked to boot to it, it brings up instead Mint's Grub which is on dev/sda6 (and does not - yet - have LL in it).

All that is background.  My worry is that if I delete Mint's grub packages, the EasyBCD and Windows bootloader won't be able to boot Mint any longer because Mint's grub is gone ....... and I am not wholly sure that they will "know", or be able to search for, the LL grub instead and boot up LL (and/or Mint, which we know is listed within the LL grub). 


Anyway, I think the next steps are (a) to copy and paste the existing failed or syntax-error cfg.new file up for others to see and to enable some study and troubleshooting to be done;  and (b) to have another go at the austin.texas copy-and-paste route of inserting LL into Mint's boot menu, and see if I can do so without getting the syntax-error.

On we go.  It's proving a bit of a long haul, so thanks very much to those who are watching over me on this!

Reply
#22
(01-17-2016, 01:21 AM)gold_finger link Wrote: [quote author=br1anstorm link=topic=2598.msg20201#msg20201 date=1452955688]
........ the alternative route of inserting LL into Mint's Grub, seems not to have worked, which is a pity.  But what puzzles me is why it worked for austin.texas (who suggested it) and isn't working for me.  The "syntax error" must surely be part of the reason?

Just in case it helps with the detective work, once I had rebooted into Mint I went into the file manager and had a look into its /boot/grub.  In there I noticed two grub (menu?) files, grub.cfg and grub.cfg.new.  The latter was modified today. ......and it includes the Linux Lite entry - in fact more than one.  And line 386 in that cfg.new file is actually the very last line, not a part of the body of the LL entry.  I have no idea what this means....!  I can copy and paste the whole of that grub.cfg.new file if that would help to figure out the error.
"syntax error" probably the cause.  Could be (and probably is) something stupid like a missing parenthesis, a space in the wrong place, etc.  Suggest you copy/paste the full contents of that grub.cfg.new file to site like pastebin, then post link to it back here and also to the Mint forum for austin.texas to take a look at too.  Before posting the output, open gedit and changes preferences so it shows the line numbers.  That will make finding the mistake a lot easier for us.  Gedit -> Edit -> Preferences -> View -> Display line numbers.
[/quote]

Okay, here we go with the detective work.  I have copied and pasted the grub.cfg.new file that was created after I tried to insert LL into Mint's boot menu using austin.texas' method.  The full text of that file is in pastebin here.

This was what prompted the "syntax error" message in the terminal when I did sudo update-grub.  What I find a bit weird is that the syntax error was said to be at line 386..... and as  far as I can see the cfg.new file only goes up to line 385!

But maybe there's more to this than meets the eye?
Reply
#23
Yes, we're both using computers with only Linux OS's on them, but solutions proposed should work for you anyway.  From here on out, let's forget about deleting grub packages in Mint.  Leave Mint's grub alone because it is already working with EasyBCD.

Don't know exactly how EasyBCD operates, but it's pretty clear that it will only be able to boot from one grub2 that it finds even if it will see and list other OS's also using grub2.  In your case Mint was first one it found, therefore that is the one that works.  It sees LL and lists it, but when selected it still brings up Mint's grub.

When EasyBCD passes booting responsibility to Mint's grub, then grub takes over and EasyBCD is out of the loop.  Therefore, if you have a working menuentry in Mint's grub that boots LL, your problem is solved.  In other words, don't pick the LL listing from the EasyBCD menu -- that's never going to work because of EasyBCD limitation of only being able to use one grub2.  Always pick the Mint entry.  That will then bring you to Mint's grub menu where you can then choose the working entry to boot LL.

When doing a standard command to update grub in Mint, the 30_os-prober file is run to find and add boot entries for other OS's.  That will pull in info from LL and make a menu entry for it.  As you found out, if you don't alter anything, the listing it creates for LL will not work due to the alteration of one or two lines of grub code in LL that cause it to act differently than expected.

Solution is to either:

1.  Delete the grub packages in LL so there is no altered code found (by 30_os-prober) to mess-up the booting for it in Mint's grub.  Without the altered packages, the menuentries made by 30_os-prober will now work correctly, (but without the pretty LL spash screen -- who cares?).

OR

2.  Manually add a new menuentry for it using the 40_custom file.  If you use the 40_custom method, you'll end up seeing the normal one or two entries for LL (found by the 30_custom script, and those will still not work) and you'll have another entry listed last that says "Description:  Linux Lite ...."  The last one is the manually created one and it will work provided you copied the menuentry into 40_custom file properly.


Thinking about it again, I'd say easiest thing to do is just nuke the LL grub packages and update grub in Mint.  That way you won't have one or two non-working and one working entry for LL.  You'll only have working entries in the menu if you do that.
Try Linux Beginner Search Engine for answers to Linux questions.
Reply
#24
Looked at pastebin code.  Syntax code error may not be accurate as to where error is.  Forget about that for now.

Noticed that you copied more into 40_custom than were instructed to.  Just copy the first menuentry, not the submenu stuff after it.  Using your actual info from that pastebin code, your 40_custom file should look like this:

Code:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry 'Description: Linux Lite 2.6 GNU/Linux' --class description_ --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-1eb010ad-2eb9-4524-bb42-ba1dc7c09278' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos7'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7  1eb010ad-2eb9-4524-bb42-ba1dc7c09278
        else
          search --no-floppy --fs-uuid --set=root 1eb010ad-2eb9-4524-bb42-ba1dc7c09278
        fi
        linux   /boot/vmlinuz-3.13.0-62-generic root=UUID=1eb010ad-2eb9-4524-bb42-ba1dc7c09278 ro  quiet splash $vt_handoff
        initrd  /boot/initrd.img-3.13.0-62-generic
}

Just edit the file to look like above (or copy/paste above directly over what's in there now) and update grub again in Mint.  Should then have a working menuentry (listed last) in Mint grub menu.  Choose Mint from EasyBCD menu, then choose last LL entry from the Mint grub menu.
Try Linux Beginner Search Engine for answers to Linux questions.
Reply
#25
I'm with you on pretty much all of this...

(01-17-2016, 03:55 PM)gold_finger link Wrote: Yes, we're both using computers with only Linux OS's on them, but solutions proposed should work for you anyway.  From here on out, let's forget about deleting grub packages in Mint.  Leave Mint's grub alone because it is already working with EasyBCD.

Agreed.  EasyBCD finds and works with Mint's grub perfectly well.

Quote: Don't know exactly how EasyBCD operates, but it's pretty clear that it will only be able to boot from one grub2 that it finds even if it will see and list other OS's also using grub2.  In your case Mint was first one it found, therefore that is the one that works.  It sees LL and lists it, but when selected it still brings up Mint's grub.

Yes, that's the way I understand it too.


Quote:When EasyBCD passes booting responsibility to Mint's grub, then grub takes over and EasyBCD is out of the loop.  Therefore, if you have a working menuentry in Mint's grub that boots LL, your problem is solved.

Absolutely right!  Which is why I think we both see austin.texas' method as the best, simplest and most logical solution.  Somehow I need to get a working entry for LL into Mint's grub.

Quote:  In other words, don't pick the LL listing from the EasyBCD menu -- that's never going to work because of EasyBCD limitation of only being able to use one grub2.  Always pick the Mint entry.  That will then bring you to Mint's grub menu where you can then choose the working entry to boot LL.

Agreed again.  In fact I had already planned that if I successfully inserted LL into Mint's grub, then I'd simply amend the listing or label in EasyBCD to show Mint & Lite..... and the choice of which of those to boot would then arise once I got to Mint's grub screen.

Quote:  When doing a standard command to update grub in Mint, the 30_os-prober file is run to find and add boot entries for other OS's.  That will pull in info from LL and make a menu entry for it.  As you found out, if you don't alter anything, the listing it creates for LL will not work due to the alteration of one or two lines of grub code in LL that cause it to act differently than expected.

Solution is to either:

1.  Delete the grub packages in LL so there is no altered code found (by 30_os-prober) to mess-up the booting for it in Mint's grub.  Without the altered packages, the menuentries made by 30_os-prober will now work correctly, (but without the pretty LL splash screen -- who cares?).

OR

2.  Manually add a new menuentry for it using the 40_custom file.  If you use the 40_custom method, you'll end up seeing the normal one or two entries for LL (found by the 30_custom script, and those will still not work) and you'll have another entry listed last that says "Description:  Linux Lite ...."  The last one is the manually created one and it will work provided you copied the menuentry into 40_custom file properly.

I still have a preference for this second (manually-created) route, which is the austin.texas method, if at all possible, before I start nuking anything!  What I'm finding hard to grasp is why the two attempts I have made so far have failed, each one producing a different error or failure message.  Once we know why those two attempts to insert the LL entry into Mint's boot menu failed, then presumably we'll know what I have to do slightly differently in order to make it succeed?  Do the pastebin texts reveal any clues to an expert eye?
Reply
#26
NOTE:  We're both crossing paths with our posts here.  If you didn't notice, I made a second post after the one you just responded to (while I was typing this one) that answers question about pastebin file.  If you follow that, you should end up with a working 40_custom file and entry in Mint's grub.


One more thing to add to above two posts.

Just saw your other post on Mint forum where you asked whether or not to delete things like grub.cfg.new.

Answer:  I believe when it failed to properly create new grub config, it just kept old working one as grub.cfg (which is one that will get used) and renamed the bad one to grub.conf.new (which won't get used).  So should be safe to delete it.


If you end up not using the "austin.texas method" and instead just nuke LL's grub packages, then open 40_custom file with text editor as root again and reset it back to the way it was to start with because you won't need the entry from that anymore:

Code:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
Try Linux Beginner Search Engine for answers to Linux questions.
Reply
#27
Aaaargh!  Our latest two posts have crossed.  No matter.

But we have got a bit more clarity.  Either I may have originally copied from the LL grub entry more than I should have;  or perhaps having failed the first time and got warnings, when I did it the second time (using your suggestion of going in as "root") then what I copied was added to the existing text in the custom file instead of replacing it?

Which suggests I ought to try it again.  But that I should take care (i) to only copy the first "bit" of the LL entry from the grub file;  and (ii) that I should delete whatever is in that 40_custom file after the first few words up to "....exec tail line above", before I paste in the LL entry that I have copied.

If that's sensible, then that has to be my next move.....
Reply
#28
A bit like car repairs and maintenance (which I understand a bit better!) it helps when you know what's going on "under the bonnet" or "under the hood".

I think I now understand the reason why my 40_custom file  (and my cfg.new?) have more in them than necessary (and why the terminal says they have an error and don't work....).

It looks as if I did manually copy only the one entry from LL into the Mint grub custom file.  But then when I did sudo update-grub in Mint, the 30_os-prober did what it would normally do, and looked for and added the LL grub entries (again) and because they are tweaked, they don't play nicely and don't work....  And hence I got the error and the cfg.new file which is not in use.

So the trick is clearly to ensure that my 40_custom file has only one LL entry, which has syntax which Mint understands, which results in LL being listed in LL's grub screen, and which boots LL.

Which leads to the obvious question.  I could edit the 40_custom file down so that it has only the one LL entry.  But if I then do sudo update-grub, how can that be prevented from running 30_os-prober and adding more (but un-workable) entries?
Reply
#29
30_os-prober will not add entries to the 40_custom file.  I don't know how the extra stuff ended up in there -- think you must have accidentally copied it in at some point.

Like I said before, when you run update-grub after fixing the 40_custom file, you'll end up with entries made for LL by both 30_os-prober and the manual entry from the 40_custom file.  The last one that will show on the grub menu will be the manually added one that will work.  The entries generated by 30_os-prober will still not work, so just don't use them.

If you move/delete the 30_os-prober file, then it won't get used and won't generate the non-working menuentries for LL.  But, I didn't tell you to move or delete the 30_os-prober file because that is what will generate new menu entries for other Linux distros that you may install to the system at some later date.  (I was trying to anticipate what you might do in the future.)  Those entries will work when/if you decide to add more distros.  If PCLOS uses grub legacy, then you don't really need 30_os-prober to generate Mint menuentries for it because EasyBCD should be able to create a working entry.  But if you add other distros that do use grub2, you'll want that 30_os-prober file to find them and add their entries to the menu.

Since right now you're only going to have Win7, LL, Mint and PCLOS, you can safely move the 30_os-prober file to a location that it won't get used from -- so you won't end up with non-working LL entries.  EasyBCD will have working entries for Win7, Mint and PCLOS.  When you choose Mint, (updated with your manual entry from 40_custom), you'll be able to boot LL.

Open /etc/grub.d as root, create a new folder called "saved" in it, then move the 30_os-prober file into the "saved" folder.  That way, update-grub command won't see or use it.

If at a later date you decide to add another distro that uses grub2, boot into Mint afterwards, move the 30_os-prober file back to original location, then update-grub to add its entry to Mint menu.
Try Linux Beginner Search Engine for answers to Linux questions.
Reply
#30

We seem to have made progress, after a fashion.  I pressed on with trying to sort this before seeing the latest forum posts above......

I deleted the cfg.new file which we believed was not in use.

Then I went into the 40_custom file as root and edited it so that it only had the one entry for Linux Lite (as best I recall, I kept the first entry of the three or more that were there), and saved that.  To be honest, I still don't know how that 40_custom file had extra entries for LL.  It's quite possible that in fact I copied too big a chunk of the text from the LL grub menu entry in my earlier attempt, so I'll take the blame for that!

Then in the Mint terminal I did sudo update-grub. It appeared to work, did its stuff, and said "done" with no warning messages.

So I then rebooted.  In the (Mint) grub screen I now have - in total - 9 entries.  They are (I have numbered them - the screen list doesn't include those numbers):

  1. Linux Mint 17.3 Xfce 64-bit
  2. Advanced options for Linux Mint 17.3
  3. Memory test
  4. Memory test  (...... serial console)
  5. Windows 7 (loader) on /dev/sda1)
  6. Windows Recovery Environment (loader) (on /dev/sda4)
  7. Linux Lite 2.6 (14.04) (on /dev/sda7)
  8. Advanced options for Linux Lite 2.6 (14.04) (on ?dev/sda7)
  9. Description:  Linux Lite 2.6 GNU/Linux
I have just tried (most of them) out.  The first boots as normal into Mint, so that's fine.  I haven't tried the Advanced or the two memory tests (Nos 2, 3 and 4) as I have no idea what they are or what they do.

Option 5, Windows 7 takes me back to the Windows bootloader and into Win7.  Fine.  Again, I have not tried the Windows Recovery option (No 6) .

The Linux Lite ones are where it gets interesting.  Clicking on Linux Lite 2.6 (option 7) brings up a black screen saying something like, "error:  filename expected.  Press any key to continue".  Striking a key brings back the Grub screen with the nine options listed.

I didn't try the next one, Advanced options for Lite, but my guess is that it would do the same.

Then clicking the last entry, "Description:  Linux Lite 2.6 GNU/Linux" boots into ....yes ...... Linux Lite!  Result! 

No initial Lite grub splash screen with feather design behind it, it goes straight into the login page with avatar/name in the centre and Sleep/Restart/Shutdown buttons.

This tallies with gold_finger's scenario in the latest post above. I conclude from this that my manual edit of the 40_custom file caused that last entry to be added to the Grub menu;  and that the sudo update-grub triggered the 30_os-prober to see and automatically add the other two Linux Lite entries (at No7 and No8), both of which don't in fact work.  I take it that they don't work, and bring up that error message, because of the tweaking which was done to the LL Grub and of which we are all now more aware (gold_finger noted this in an earlier post above)

So, progress made in that I can now boot into either of the two Linux OSs.  It's a minor pain and a bit untidy that I have two superfluous and non-functional options (No7 and No8) listing LL in the Mint grub screen menu.  I wondered if in theory one could edit them out, by going into Mint's boot/grub/grub.cfg and amending or deleting those menu entries.  But then (as I speculated in my earlier post) when you do sudo grub-update, the 30_os-prober goes and finds them again and adds them in.  Catch 22!

I can now see that temporarily setting aside or saving 30_os-prober would avoid the creation of those two entries. By going ahead as-is, I have pre-empted that and ended up with a couple of non-working LL entries in my Mint grub boot menu.  It's a bit untidy;  but at least I know that it's the last one that works for booting into Lite. 

I agree that it makes sense to keep 30_os-prober available, for the reasons mentioned.  I don't really know what I might want to try further down the track:  I'm still a newbie discovering and learning how this whole Linux world works.

So we're probably as close as can be expected to marking this one "Solved".  Now that I can get into Linux Lite, I have still to do the symlinking of its Doc/Pics/Music etc folders into the Data partition.  But if I struggle to remember how, the guidance is still there earlier in these threads.

One more challenge (or experiment) awaits:  I want to try installing PCLinuxOS (which uses Grub Legacy) so that it too can be booted using EasyBCD.  But that's for another day, and perhaps another thread.  Meanwhile, renewed thanks to gold_finger and (indirectly - I'll be posting in the Mint forum too) to austin.texas.  I hope this has been as interesting to you, and other readers, as it has been educational for me.....
Reply


Forum Jump:


Users browsing this thread: 17 Guest(s)