Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Grub => Grub2 migration mistake
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
phd
n00b
n00b


Joined: 12 Oct 2005
Posts: 65
Location: Warszawa (Poland)

PostPosted: Fri Jul 11, 2014 1:38 pm    Post subject: [Solved] Grub => Grub2 migration mistake Reply with quote

Booting a few times my comp after upgrade, I noted that the upgraded grub in emerge -uDN @world was loading very long but after all it booted system correctly. I found that some directories and usbstick was mounted via /run/ despite I masked sys-app/systemd. Maybe this was correct? My problems with upgrade 1 year not upgraded OS I described in details in the post https://forums.gentoo.org/viewtopic-t-995064-highlight-.html. After upgrade, and a few boots for checking the system is OK, I wanted to (re)install grub2 manually to improve abnormally long loading grub process. Unfortunately, I had missed the migrating guide to GRUB2 on wiki, and I used the guide for the fresh Grub2 installation in Gentoo-amd64 instalation guide. Assuming that the directory /boot is mounted automatically from another site (/run), I mounted manually maybe the (same!) partition on another directory and installed grub.cfg by means
Quote:
# mount /dev/sda1 /anotherdirectory
# grub2-mkconfig -o /anotherdirectory/grub/grub.cfg
Generating grub.cfg ...
done

It is also most possible that before this operation I reinstalled also grub2 in MBR according to the mentioned guide for fresh system. Installing grub.cfg I was a bit disappointed that there was not any (!) information on kernels found by gub-mkconfig, maybe this is the mistake. But I led simply to the conclusion that this version of grub such is, done is done! Anyway no warnings :) I unmounted the /dev/sda1 and reboot. Now, grub loaded very quickly and correctly, but no kernel detecting, I see the grub promt, nothing more. The grub sees my disks, formatted partitions, files, I can check directly in grub what I have on each partition, e.g. (rewritten from screen)
Quote:
grub> ls (hd0,msdos1)/
boot bzImage lost+found bzImage-3.2.1 ...
grub> ls (hd0,msdos1)/boot/grub
grub.conf grub.cfg ...
grub> cat (hd0,msdos3)/etc/fstab

/dev/sda1/boot /boot ext2 noauto,notime 1 2
/dev/sda3 / reiserfs noauto 0 1
/dev/sda2 none swap sw 0 0
grub>

What commands should I give in grub commandline to boot OS manually from bzImage I have on /dev/sda1 to get inside my OS. I would like to check the system once more, and repair the grub and/or kernel installation? The bzImage kernel already upgraded my system and worked seem correctly before my unfortunate grub and grub.cfg (re)install.


Last edited by phd on Tue Jul 15, 2014 6:59 am; edited 20 times in total
Back to top
View user's profile Send private message
umka69
Tux's lil' helper
Tux's lil' helper


Joined: 31 Mar 2013
Posts: 124

PostPosted: Fri Jul 11, 2014 3:21 pm    Post subject: Reply with quote

I've got the same ones.
You need BIOS boot partition like in handbook.
http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=1&chap=4
_________________
Make a wish, this text is magic. :)
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1696

PostPosted: Fri Jul 11, 2014 5:29 pm    Post subject: Reply with quote

You don't necessarily need the bios boot partition if you are not using UEFI to boot. Chances are, if you are switching from grub 1 to grub2, you don't need to do any of the UEFI part; especialy when you'd effectively have to reformat your drives to even do that (assuming your MB supports UEFI; I have a couple older amd64 computers that don't support UEFI). The big thing, is that the bios boot partition is only for GPT formated drives, the older bios type, is the old format, which does not use the BIOS boot partition.
Back to top
View user's profile Send private message
phd
n00b
n00b


Joined: 12 Oct 2005
Posts: 65
Location: Warszawa (Poland)

PostPosted: Fri Jul 11, 2014 8:18 pm    Post subject: Reply with quote

Question is what commands should be written in grub commanline to load the kernel and start the system. This kernel was successfully used already after this upgrade but before my unfortunate manual (re)installation of grub.cfg (and grub2 in MBR?).
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1696

PostPosted: Sat Jul 12, 2014 6:57 pm    Post subject: Reply with quote

When you run grub2-mkconfig; it will generate the system commands to load your kernel. Yes, grub2 works perfectly fine in MBR.
Back to top
View user's profile Send private message
phd
n00b
n00b


Joined: 12 Oct 2005
Posts: 65
Location: Warszawa (Poland)

PostPosted: Tue Jul 15, 2014 6:57 am    Post subject: Reply with quote

Solved sucessfully, reasons:
1. Space on partition /dev/sda1 had finished. Thus, cp bzImage /boot, finished with no warning, while the size of bzImage in directories /usr/src/linux... and /boot differed each other. Thus, any trial to force grub from its command line to use this kernel terminated error. On old disks, including mine, the gentoo boot partitions are very small, there was no reason to create large boot partitions, kernel images were very small fitted carefully to hardware. Now, most of drivers are buildin by default to gentoo-sources kernels which needs a considerably larger space. The use of make install instead of direct cp needs rices the space need by installing vmlinuz, System.map and config vs bzImage. For not large boot partitions on old disks as mine, the migration to grub2 can terminate the similar errors. On the other hand, it does not make sense to proceed repartitions of old disks to migrate to Grub2. Anyway, be careful on the available free space on old boot partition. It can be extended by removing carefully many not needed old kernels, splash images etc.

2. It is also probable that in some moment I had forgotten to mount /dev/sda1 on /boot before manual reinstall of grub.cfg. In consequence the
grub2-mkconfig -o /boot/grub/grub.cfg
installed the second grub.cfg and grub directory on /dev/sda3 independent of /dev/sda1/boot/grub, in spite of in /etc/fstab was written clearly that /boot should be mounted on /dev/sda1. No checking, no masseage on kernels found or not, no warnings (!) happy reported grub.cfg done! inside DO NOT EDIT THIS FILE 8O

3. I had forgotten to rename /boot/bzImages onto kernels- or vmlinuz- as is semi-clearly written in the Gentoo Grub migration guide. In consequence, grub2-mkconfig by making grub.cfg did not find any kernel and wrote with happy (!) without warning, the installation done (successfully!?) Any trial to boot system from such a done grub.cfg terminated the grub stopping and warning on no kernel loaded. It is a bit late. Grub2 tool should give such a warning a bit earlier, e.g. at the moment of instilling the grub.cfg with no kernel and checking simultaneously whether the /boot has been or not mounted according to the data specified in /etc/fstab .
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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