Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
grub2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
schrdlu
n00b
n00b


Joined: 01 Nov 2009
Posts: 61
Location: Adelaide Sth Australia

PostPosted: Thu Mar 01, 2012 7:51 am    Post subject: grub2 Reply with quote

Hi ,have (last night ) updated the system ,in which grub2-beta was compiled.
I did a grub2-install,last night before shutting down. forgot to remake the grub-config,so consequently all I got today was a grub prompt. after about 2 hrs I managed to get the command line accurate enough to get a system running.
Ran grub2-mkconfig,which updated the grub.cfg, supposedly successful, :cry: not true.
Any one got an idea as to what is needed to be done,as I suspect I'm going to have the same hassle with my x86,as this was updated at the same time.
The man files for grub2 are also missing,so this complicates things also. So unless there is no other way I gues I'll have to go back to legacy grub.
Geoff
Back to top
View user's profile Send private message
keenblade
Veteran
Veteran


Joined: 03 Oct 2004
Posts: 1087

PostPosted: Fri Mar 02, 2012 4:00 pm    Post subject: Reply with quote

Probably, if you provide some info like partition table, fstab and the error messages from grub2, people can help. there is not much complicated thing for grub2 since it has helpers to automate things nicely. Dont forget to install "sys-boot/os-prober" for automatic OS detection. Generally the procedure is:
Code:

to install in mbr (recommended):
# grub2-install /dev/sda
or to install on a partition:
$ grub2-install --force /dev/sda3
then create the config:
# grub2-mkconfig -o /boot/grub/grub.cfg

Also if you need initramfs, install "sys-kernel/dracut". It will create initramfs in your /boot:
Code:

# dracut /boot/initramfs-x86_64-3.2.5-gentoo.img 3.2.5-gentoo

_________________
Anyway it's all the same at the end...
Need help to get it working: "x-fi surround 5.1"
Back to top
View user's profile Send private message
Khumarahn
Apprentice
Apprentice


Joined: 17 Apr 2009
Posts: 199

PostPosted: Sat Mar 03, 2012 2:00 am    Post subject: Reply with quote

I upgraded to grub-2.00_beta0

Can't make it work :-( This is going to be a long and detailed post. Any help is appreciated.
Now I chroot from ubuntu live usb in UEFI mode, and do:
Code:

ubuntu@ubuntu:~$ sudo -i
root@ubuntu:~# mkdir /mnt/gentoo
root@ubuntu:~# mount /dev/sda2 /mnt/gentoo/
root@ubuntu:~# cp -L /etc/resolv.conf /mnt/gentoo/etc/
root@ubuntu:~# mount -t proc none /mnt/gentoo/proc
root@ubuntu:~# mount --rbind /dev /mnt/gentoo/dev
root@ubuntu:~# mount --rbind /sys /mnt/gentoo/sys
root@ubuntu:~# chroot /mnt/gentoo /bin/bash
ubuntu / # env-update
>>> Regenerating /etc/ld.so.cache...
ubuntu / # source /etc/profile
ubuntu / # export PS1="(chroot) $PS1"
(chroot) ubuntu / # emerge -pv grub

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   *] sys-boot/grub-2.00_beta0  USE="nls sdl truetype -custom-cflags -debug -device-mapper -efiemu -libzfs -mount -static" GRUB_PLATFORMS="efi-64 -coreboot -efi-32 -emu -ieee1275 -multiboot -pc -qemu -qemu-mips -yeeloong" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB


I try following guides
http://dev.gentoo.org/~scarabeus/grub-2-guide.xml
http://wiki.gentoo.org/wiki/GRUB2

Code:

(chroot) ubuntu / # mount /boot
(chroot) ubuntu boot # parted -l
Model: ATA Corsair Force 3 (scsi)
Disk /dev/sda: 60.0GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  467MB   466MB   fat32              boot
 2      467MB   60.0GB  59.6GB  ext4


Model: ATA ST3500418AS (scsi)
Disk /dev/sdb: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system     Flags
 1      1049kB  106MB   105MB   primary  ntfs            boot
 2      106MB   52.4GB  52.3GB  primary  ntfs
 3      52.4GB  62.1GB  9664MB  primary  linux-swap(v1)
 4      62.1GB  500GB   438GB   primary  ext4


Model: Kingston DT 101 II (scsi)
Disk /dev/sdc: 8015MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      31.7kB  8013MB  8013MB  primary  fat32        boot, lba


I am trying to install grub2 on /dev/sda, /dev/sda1 is a /boot partition in fat32, and /dev/sda2 is my system in ext4. On a /deb/sdb lives /home and windows.

This is what I got:
Code:

(chroot) ubuntu boot # cd /boot/
(chroot) ubuntu boot # ls
kernel-3.2.5-gentoo  splash.png
(chroot) ubuntu boot # mkdir grub2
(chroot) ubuntu boot # mkdir -p EFI/BOOT
(chroot) ubuntu boot # grub2-efi-64-mkconfig -o /boot/grub2/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/kernel-3.2.5-gentoo
done
(chroot) ubuntu boot # grub2-efi-64-install --root-directory=/boot --bootloader-id=GRUB2 --recheck --debug
source_dir doesn'\''t exist. Please specify --target or --directory

Here I don't exactly understand what the problem is. I tried running it with --directory=/usr/lib/grub/x86_64-efi , but then strangely enough on boot my 'GRUB2' loader would start windows from /dev/sdb2. What is --target? Reading man doesn't answer this...

This is what I do:
Code:

(chroot) ubuntu boot # cp /usr/lib/grub/x86_64-efi/* /boot/grub2/
(chroot) ubuntu boot # grub2-efi-64-mkimage -p /grub2 -o /boot/grub2/grub.efi -O x86_64-efi part_msdos part_gpt fat normal ext2
(chroot) ubuntu boot # cp /boot/grub2/grub.efi /boot/EFI/BOOT/BOOTX64.EFI
(chroot) ubuntu boot # efibootmgr --create --gpt --disk /dev/sda --part 1 --write-signature --label "GRUB2" --loader "\\grub2\\grub.efi"
BootCurrent: 0007
Timeout: 1 seconds
BootOrder: 0000,0005,0007,0004
Boot0004  CD/DVD Drive
Boot0005* UEFI:  Patriot Memory PMAP
Boot0007* UEFI: KingstonDT 101 II 1.00
Boot0000* GRUB2
(chroot) ubuntu boot # grub2-efi-64-editenv - create


Now I am restarting...
Back to top
View user's profile Send private message
Khumarahn
Apprentice
Apprentice


Joined: 17 Apr 2009
Posts: 199

PostPosted: Sat Mar 03, 2012 2:08 am    Post subject: Reply with quote

After restart I see a grub welcome window, 2 options - 3.2.5-gentoo and 3.2.5-gentoo in recovery mode, but nothing would load with
Code:

error: can't find command `['.
error: file `/x86_64-efi/all_video.mod'  not found.
error: file `/x86_64-efi/gzio.mod'  not found.
error: can't find command `['.
error: can't find command `search'.
error: can't find command `echo'.
error: can't find command `linux'.

Press any key to continue...


and then grub returns to boot choice of 3.2.5-gentoo and 3.2.5-gentoo in recovery mode

I tried creating folder /boot/x86_64-efi with all the modules, but it didn't change anything.
Back to top
View user's profile Send private message
keet
Guru
Guru


Joined: 09 Sep 2008
Posts: 571

PostPosted: Sat Mar 03, 2012 2:45 am    Post subject: Reply with quote

I just had a confusing time installing GRUB 2. I actually just backed up my hard disk, remade my partitions as GPT instead of MBR, and installed GRUB 2 as an UEFI image. I tried following the instructions at http://dev.gentoo.org/~scarabeus/grub-2-guide.xml, but finding https://forums.gentoo.org/viewtopic-t-895270-highlight-normal+mod.html made it much easier. I basically booted from an Ubuntu LiveCD in UEFI mode, pressed C at the initial GRUB menu, and booted Gentoo using the GRUB command line. Once I was in, I made /etc/fstab include this line:

Code:
/dev/sda1      /boot/efi   vfat      defaults   0 2


Next, I ran these commands:
Code:
cd /boot
mkdir efi
mount /dev/sda1
cd /boot/efi
grub2-install


If this looks sloppy, it's because I'm copying them directly from my history. I figured I would do that verbatim to avoid mistyping something and causing more confusion.

For some reason, grub2-install complained and failed because it couldn't find /lib64/grub/i386-pc/modinfo.sh, among other files, so I copied /lib64/grub/x86_64-efi/{modinfo.sh,*.mod,*module,*.lst,*.img} to /lib64/grub/i386-pc. This is probably a bit messy, and I am not sure why I needed to do it -- maybe grub wants me to set GRUB_PLATFORMS="efi-64 efi-32" in make.conf, but this shouldn't be necessary.

After I did this, grub2-install worked fine.

Next I ran:

Code:
grub2-mkconfig -o /boot/grub2/grub.cfg


However, after the reboot, GRUB didn't find the menu. It was actually seeking it in /boot/grub/grub.cfg, so I moved the configuration file there and deleted /boot/grub2, since it contained nothing else. With the menu in /boot/grub/grub.cfg, it worked correctly.

I hope that this helps.
Back to top
View user's profile Send private message
Khumarahn
Apprentice
Apprentice


Joined: 17 Apr 2009
Posts: 199

PostPosted: Sat Mar 03, 2012 3:18 am    Post subject: Reply with quote

keet, thanks.

What version of grub are you using?

I run 1.99-r2 just fine... now had to downgrade back from 2.00_beta0, and it works fine again.
Back to top
View user's profile Send private message
keet
Guru
Guru


Joined: 09 Sep 2008
Posts: 571

PostPosted: Sat Mar 03, 2012 7:15 pm    Post subject: Reply with quote

I was using version 9999, which at the time of installation was 2.00 beta 2, I think. I am not sure which is the best to use. I could set my keyword to <sys-boot/grub-9999, or mark a certain version. I'll probably try reinstalling it tonight.
Back to top
View user's profile Send private message
Khumarahn
Apprentice
Apprentice


Joined: 17 Apr 2009
Posts: 199

PostPosted: Sun Mar 04, 2012 3:56 pm    Post subject: Reply with quote

I tried grub-9999 some time ago, but it wouldn't compile.

Would be interesting to know if you can make 2.00 beta 0 work
Back to top
View user's profile Send private message
Mike Lee
n00b
n00b


Joined: 06 Nov 2010
Posts: 6
Location: Russia

PostPosted: Fri Mar 09, 2012 9:28 am    Post subject: Reply with quote

Looks like something was changed in grub2 beta1 release, because grub2 beta0 worked fine for me, but the new release is unable to boot Gentoo (it just reboots after starting boot linux), but the Windows boots successfully. Seems like os-prober, or linux-prober is broken now :(

Could anybody has similar issue?
Back to top
View user's profile Send private message
gami
Apprentice
Apprentice


Joined: 02 Jun 2006
Posts: 297

PostPosted: Sat Mar 10, 2012 1:31 pm    Post subject: Reply with quote

See https://bugs.gentoo.org/show_bug.cgi?id=407393
Back to top
View user's profile Send private message
apurkrt
Tux's lil' helper
Tux's lil' helper


Joined: 26 Feb 2011
Posts: 116
Location: Czechia, Europe

PostPosted: Sat Mar 17, 2012 9:43 pm    Post subject: Reply with quote

Successfully set up UEFI booting today on amd64. It was/is sort of chicken and egg problem - to be able to succesfully use grub2-install, one has to have the system already booted in UEFI mode; this can be achieved with the help of EFI boot capable usb flashdrive. Summed up my experince here in a separate post

Last edited by apurkrt on Sun Mar 18, 2012 8:20 am; edited 6 times in total
Back to top
View user's profile Send private message
Khumarahn
Apprentice
Apprentice


Joined: 17 Apr 2009
Posts: 199

PostPosted: Sat Mar 17, 2012 10:08 pm    Post subject: Reply with quote

I did installation with beta2 with no problems a couple of days ago.

I guess beta0 just had some bug...
Back to top
View user's profile Send private message
jtshs256
n00b
n00b


Joined: 25 Mar 2011
Posts: 17

PostPosted: Sun Mar 18, 2012 4:00 am    Post subject: Reply with quote

It's strange that beta0 is the best among beta0~beta2 on my laptop with bios.
The linux command is broken in beta1 and I find shell-completion broken in beta2. :(
Back to top
View user's profile Send private message
schrdlu
n00b
n00b


Joined: 01 Nov 2009
Posts: 61
Location: Adelaide Sth Australia

PostPosted: Sun Jun 17, 2012 5:22 am    Post subject: Reply with quote

keenblade wrote:
Probably, if you provide some info like partition table, fstab and the error messages from grub2, people can help. there is not much complicated thing for grub2 since it has helpers to automate things nicely. Dont forget to install "sys-boot/os-prober" for automatic OS detection. Generally the procedure is:
Code:

to install in mbr (recommended):
# grub2-install /dev/sda
or to install on a partition:
$ grub2-install --force /dev/sda3
then create the config:
# grub2-mkconfig -o /boot/grub/grub.cfg

Also if you need initramfs, install "sys-kernel/dracut". It will create initramfs in your /boot:
Code:

# dracut /boot/initramfs-x86_64-3.2.5-gentoo.img 3.2.5-gentoo


One thing I have noticed,is that when doing an install from chroot environment,the grub2-mkconfig is not successful..... My work around for this is to install legacy grub from the chroot environment,then when booted into the working environment,ie: using the hdd for system files/booting. Then doing a reinstall of grub2 and making the grub2 menu is successful.
Also I'm not using any fancy partition setup's just the standard as created by fdisk,I find this way most stable.
Geoff
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum