LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-18-2013, 07:53 AM   #16
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Slackware
Posts: 4,551

Rep: Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710

You can edit grub.cfg manually, save the changes and reboot without running update-grub to test to see that your entry works. If it does, copy the new entry to the /etc/grub.d/40_custom file and run sudo update-grub.
 
Old 07-18-2013, 10:12 AM   #17
centguy
Member
 
Registered: Feb 2008
Posts: 394
Blog Entries: 1

Original Poster
Rep: Reputation: 35
On Dell, everything works fine.

Now, on my new Lenovo machine:

Quote:
LM14-Y480 grub.d # df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda7 48060296 25073372 20545556 55% /
udev 4029896 12 4029884 1% /dev
tmpfs 1615640 1040 1614600 1% /run
none 5120 0 5120 0% /run/lock
none 4039096 564 4038532 1% /run/shm
none 102400 12 102388 1% /run/user
/dev/sda11 602820424 266676172 305522712 47% /backup-disk
LM14-Y480 grub.d # sudo grub-install --force /dev/sda7
source_dir doesn't exist. Please specify --target or --directory
i.e.,

I have this

source_dir doesn't exist. Please specify --target or --directory


I strongly suspect chainload (from CentOS)
trick did not work for the newly installed Linux Mint
on Lenovo. That's why I have to look for a direct boot solution from CentOS.
That happened a few months back when I first bought Lenovo Y480
and now I have some time to revisit the problem.
 
Old 07-18-2013, 12:19 PM   #18
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 301

Rep: Reputation: 60
I googled your error found a bug. The solution was to reinstall the grub package.
Code:
sudo apt-get install –reinstall grub-pc
Some got the wrong grub package, grub-efi instead of grub-pc. Make sure you have the right package.
 
Old 07-18-2013, 06:22 PM   #19
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Slackware
Posts: 4,551

Rep: Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710
Quote:
I strongly suspect chainload (from CentOS)
trick did not work for the newly installed Linux Mint
What happened when you tried the 'core.img' entry I suggested earlier? I have that entry for a specific partition on my drive and whenever I install a system using Grub2, I put it on that partition. That way I don't need to change the entry in menu.lst with a new system.

Quote:
sudo grub-install --force /dev/sda7
The command above won't work. The proper command would be: sudo grub-install --force --root-directory=/mnt/sda7 /dev/sda7

You would need to create the sda7 sub-directory in /mnt or use another sub-directory and replace sda7 with whatever you use.
 
Old 07-18-2013, 09:58 PM   #20
centguy
Member
 
Registered: Feb 2008
Posts: 394
Blog Entries: 1

Original Poster
Rep: Reputation: 35
yancek:

Sorry I dismissed your post 8 suggestion since I don't understand why you have exactly two entries pointing to
(hd0,2) and one is Ubuntu-12.04 and the other Linux Mint.


Quote:

title Ubuntu-12.04
root (hd0,2)
kernel /boot/grub/core.img
#savedefault
##boot

title Linux Mint
root (hd0,2)
chainloader +1
Now, I realize you are trying to suggest to me to
use `kernel /boot/grub/core.img' to chainloader to Linux Mint ? Am I correct?

Quote:
sudo grub-install --force /dev/sda7
may work, since post # 11 showed it works, but may be it is working for the wrong reason.. you are the guru.

Lennie:

I like your solution, even though I have to tried it. May be my new Lenovo confused
the Mint installer and cause all sorts of havoc.

Will report back.

Last edited by centguy; 07-18-2013 at 09:59 PM.
 
Old 07-19-2013, 08:25 AM   #21
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Slackware
Posts: 4,551

Rep: Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710
Quote:
Sorry I dismissed your post 8 suggestion since I don't understand why you have exactly two entries pointing to
(hd0,2) and one is Ubuntu-12.04 and the other Linux Mint
I changed the root line to (hd0,2) and meant to change Ubuntu to Mint but forgot. As I said above, both of these entries work for me booting from a system with Grub Legacy in the mbr. If I install a system using Grub2, I put them on one of these partitions and don't need to worry about them booting. They've always worked for me. The only reason I could think the 'core.img' would not work is if the 'core.img' file is not present in the grub directory. That should only happen if during an installation grub was not installed at all.

I've successfully used the command below to install Grub2 on a partition, in the case below sda7.

Quote:
sudo grub-install --force --root-directory=/mnt/sda7 /dev/sda7
 
Old 07-19-2013, 09:11 AM   #22
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 301

Rep: Reputation: 60
It's more reliable to use the syntax for core.img than 'chainloader +1', if you use mbr partitioning and install grub2 on a logical partition. If you remove one logical partition, then all logical partitions with higher number get changed number.

If you use 'chainloder +1' you need to reinstall grub on that partition, because the number of the partition is hardcoded in the embedded part.

If you use core.img, and use uuid in grub and fstab, it shouldn't make any difference if partition number is changed. With core.img grub search for the file relative to the partition.
 
Old 07-19-2013, 10:49 AM   #23
centguy
Member
 
Registered: Feb 2008
Posts: 394
Blog Entries: 1

Original Poster
Rep: Reputation: 35
update:

Quote:
sudo apt-get install –reinstall grub-pc
grub-install --force /dev/sda7
indeed solves my problem!

related info:

Quote:
LM14-Y480 grub # cat /boot/grub/grub.cfg
#Timeout for menu
set timeout=5

# Set default boot entry as Entry 0
set default=0

# (0) Linux
menuentry "Linux" {
set root=(hd0,7)
linux /boot/vmlinuz-3.5.0-17-generic root=UUID=ab002fc5-8f4b-4a60-a677-e9f280ff9633 ro quiet splash
initrd /boot/initrd.img-3.5.0-17-generic
}
The above lines boots up my Linux Mint 14 nicely.


Outstanding issues:
Strange enough, I don't see core.img:

Quote:

LM14-Y480 grub # ls /boot/grub
fonts grub.efi setup_left_core_image_in_filesystem
gfxblacklist.txt grubenv unicode.pf2
grub.cfg i386-pc x86_64-efi
grub.cfg-01-working locale
And what is this --root-directory=/mnt/sda7

since I don't have this /mnt/sda7 anyway.

Thanks everyone !
 
Old 07-19-2013, 11:52 AM   #24
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 301

Rep: Reputation: 60
core.img could be in a subfolder. Run
Code:
find -name core.img
from your grub folder to find it.

'--root-directory' tells grub which partition is your root partition. It's not always needed. There is also '--boot-directory' for separate /boot partition.


'--root-directory=/mnt/sda7' was an example, if you had created the directory /mnt/sda7 and mounted your mint partition there.
 
Old 07-19-2013, 12:06 PM   #25
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Slackware
Posts: 4,551

Rep: Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710
It should be in /boot/grub/i386-pc directory.
 
  


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
Linux Mint 13 install doesn't detect partition table. Zurukea Linux - Newbie 22 08-14-2013 03:40 PM
grub2 can't see my win 7 partition and yast2 bootloader can't reinstall grub2 jjrojaspy Suse/Novell 5 07-07-2013 10:38 PM
install grub2 to root partition skippyV Debian 2 03-01-2013 05:07 PM
[SOLVED] Linux mint, some tweaking (hdparm, GRUB2 and so on) Ormu Linux - General 2 12-19-2011 01:16 PM
Install grub2 in partition is possible? miros84 Linux - Software 1 11-14-2010 01:59 PM


All times are GMT -5. The time now is 03:07 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration