[lfs-support] Cannot boot to LFS with seperate boot partition

Andrew Elian e_lion_1 at hotmail.com
Mon Jun 25 22:57:45 PDT 2012


Hello,

On Mon, Jun 25, 2012 at 11:30:08AM -0500, Eleanore Boyd wrote:
> On 6/25/2012 11:24 AM, Yasser Zamani wrote:
> >*snip*
> >*/root at slax:~# cat /mnt/sda7/grub/grub.cfg/*
> >
> >    /# Begin /boot/grub/grub.cfg/
> >    /set default=0/
> >    /set timeout=5/
> >    /*# WHEN I SELECT THIS ENTRY IT TELLS "error: no argument
> >    specified" BUT AFTER KEY PRESS ENTERS TO WINDOWS SUCCESSFULLY*/
> >    /menuentry "Windows 7 (loader) (on /dev/sda3)" {/
> >    /    insmod part_msdos/
> >    /    insmod ntfs/
> >    /    set root='(hd0,msdos3)'/
> >    /    search --no-floppy --fs-uuid --set 125c5cdd5c5cbd63/
> >    /    chainloader +1/
> >    /}//**/
> >
> *snip*


Errors like "error: no argument specified" usually point to something
missing.  Try:

search --no-floppy --fs-uuid --set=root 125c5cdd5c5cbd63
Notice that '--set' needs the arguement '=root' in this case.

I believe that the lines
      set root='(hd0,msdos3)' 
and
      search --no-floppy --fs-uuid --set=root 125c5cdd5c5cbd63

are redundant, but I am not sure.  Hopefully this can be verified by someone else.

> I see at least one problem: Windows has a problem being on anything
> other than the first partition. I remember seeing somewhere that
> Grub has a way to trick bootmgr to think it's on the first
> partition, but I can't remember the method. Also, I didn't think
> that "msdos#" was used to define a partition that's FAT32 or NTFS.
> 
> Elly

If needed to 'trick' Windows into believing it is on the first
partition, add this line right above 'chainloader +1' :

drivemap -s (hd0) ${root}

>> /dev/sda1               1           9       72261   de  Dell Utility
>> /dev/sda2              10        1315    10485760    7  HPFS/NTFS
>> /dev/sda3            1315       14674   107309851    7  HPFS/NTFS

Dell Utility is on the first partition.  Probably it came this way when
the computer was bought.

> # WHEN I SELECT THIS ONE IT TELLS "error: file not found" BUT AFTER KEY
> # PRESS ENTERS TO LFS SUCCESSFULLY                                     
> menuentry "GNU/Linux, Linux 3.4.1-lfs-SVN-20120617" {
>     insmod ext3
>     set root=(hd0,7)
>    linux   /vmlinuz-3.4.1-lfs-SVN-20120617 root=/dev/sda6 ro
> }

I must admit that I find grub2 still a bit of a mystery.  It seems that what
I thought earlier was in error.  I was able to reproduce
"file not found" on my system having the kernel from one
partion booting LFS on another and eventually got it working.

>> set root=(hd0,7)
> This line is correct as it tells grub to look for your boot partition.
I now disagree with myself on this one, upon further research:
http://fedoraproject.org/wiki/GRUB_2

> This next line needs a little tweaking:
>>         linux   /vmlinuz-3.4.1-lfs-SVN-20120617 root=/dev/sda7 ro
Actually, I think it needs a bit more tweaking.

Okay, try this:

menuentry "GNU/Linux, Linux 3.4.1-lfs-SVN-20120617" {
    insmod ext3
    set root=(hd0,6)
    linux (hd0,7)/vmlinuz-3.4.1-lfs-SVN-20120617 root=/dev/sda6 ro
}
Hope this works.

Okay, if I understand things better:
1) set root=(hd0,6) (grub.cfg), root=/dev/sda6 (kernel option) and /dev/sda6 / (/etc/fstab) 
   should all 'match'
2) if the kernel is not on the set root=(hdX,X) partition, it can be specified, eg. 
   linux (hdX,X)/whever-it-is/linux_kernel

Best of luck!
ae
-- 
My Blog: http://elian001.wordpress.com



More information about the lfs-support mailing list