View previous topic :: View next topic |
Author |
Message |
phobos13013 Apprentice
Joined: 22 Sep 2004 Posts: 277 Location: PNW
|
Posted: Fri Jun 27, 2014 11:52 pm Post subject: Unable to boot Grub2 on formerly outdated system |
|
|
OK, here is my predicament. I had a box in storage for a little over two years, last working kernel was 2.6.39 and it was boxed while having trouble converting to 3.0. There it sat un --sync'ed for all that time and here recently I felt the urge to blow the dust off it and fire it back up. Well lo and behold, surprisingly the linux community moved on since it last saw a flow of electrons. Inititally it booted the still mismatched kernel until I started updating portage and all that to the point where it would no longer boot propertly. I switched to a livecd and needless to say, it took a loooooong time to update the system. I wont bore you with the details but using the buildpkg method from a livecd, I managed to get a working GCC and components to a point where @world and @system fully updated as well as a bunch of things like python-updater, perl-cleaner, revdep-rebuild and --depclean.
So here I am with a fully updated system but a few lingering problems remain:
1) emerge --info - see it here: http://bpaste.net/show/414847/ still lists the old kernel even tho --depclean has been run and no trace of that kernel exists on my system anymore, eselect list only shows one kernel, 3.12.21 and it is selected (make in /usr/src/linux builds the 3.12.21 kernel and there are no errors; no errors on make install either)
2) grub2 does not boot - I have the following grub.cfg: http://bpaste.net/show/414779/
For some reason my current kernel shows up twice in there and I have followed the grub2 migration guide along will all other guides associated with no errors during install or config generation but still get the same result on boot. When I boot to Grub2, i select either of the two 3.12.21 kernels and it says its loading the kernel but it eventually just hangs on that loading screen (with the Caps and Screen lights on my keyboard blinking like its a kernel panic).
Any insight into this? _________________ ...and it should be known by now |
|
Back to top |
|
|
vaxbrat l33t
Joined: 05 Oct 2005 Posts: 731 Location: DC Burbs
|
Posted: Sat Jun 28, 2014 3:18 am Post subject: try plain jane console to start |
|
|
Force console mode in your /etc/default/grub file:
Code: | # Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL=console
|
and then run grub2-mkconfig again. That might show the hidden panic messages behind the blinking keyboard lights. I suspect grub2 isn't finding your root filesystem. If you have kernel modesetting and framebuffer problems, you will not see your console unless you fall back. Besides the early use of a framebuffer like this by grub2 may cause you problems later if you use the proprietary ATI or Nvidia drivers for X. |
|
Back to top |
|
|
phobos13013 Apprentice
Joined: 22 Sep 2004 Posts: 277 Location: PNW
|
Posted: Sat Jun 28, 2014 4:59 am Post subject: |
|
|
Thanks vaxbrat, that was the piece I was looking for actually. Grub2 is a totally new beast to me since I have been away from linux desktop so long. I never had to worry about the console setting in the past. So with that change it appears yes, root is not being found with the typical VFS: root block not found on hd(0,0) complaint.
Question is now... why. First thing I noticed in the grub.cfg was that my root device at /dev/sda5 is being mounted ro... not sure why, im wondering if this is a kernel config thing. Not sure why if so. Anyway, I edited that out, but did not change anything. I know I have run into this issue before but I am scratching my head for how to resolve it now. _________________ ...and it should be known by now |
|
Back to top |
|
|
phobos13013 Apprentice
Joined: 22 Sep 2004 Posts: 277 Location: PNW
|
Posted: Sat Jun 28, 2014 5:33 am Post subject: |
|
|
Well somehow in all the upgrading and new kernel config generation I lost the mods for my SATA/PATA controllers, no clue how that happened. Anyway, built the kernel for the umpteenth time with those components installed and I get a full boot but it doesnt boot into linux.
I do not know how to get this output to the forum but it basically has the boot sequence, enters autorun and completes then mounts sda5 with ordered data mode, vfs mounts root fs readonly on device 8:5, write-protects the kernel read-only, then INIT: version 2.88 boots and askes for the runlevel. But after this when you enter any runlevel, it just says INIT: no more processes left in this runlevel.
Then nothing, what is this booting to? _________________ ...and it should be known by now |
|
Back to top |
|
|
vaxbrat l33t
Joined: 05 Oct 2005 Posts: 731 Location: DC Burbs
|
Posted: Sat Jun 28, 2014 4:56 pm Post subject: not sure what to tell you |
|
|
You had asked why you saw your kernel stanzas more than once in the grub.cfg file. If you haven't figured that out, the grub boot prompt now has a first line for the default boot, then an "advanced" item that opens up all of the other kernels that you might have as well as options for recovery (single user) mode. Here's my grub.cfg as an example:
The first section comes from /etc/grub.d/00_header
Code: | #
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
terminal_input console
terminal_output console
if sleep --interruptible 0 ; then
set timeout=10
fi
### END /etc/grub.d/00_header ###
|
Next the /etc/grub.d/10_linux is interpreted by grub2-mkconfig to find your kernels in /boot and set up the default and advanced sections.
Code: | ### BEGIN /etc/grub.d/10_linux ###
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-20ec7a8b-ffc6-4454-a436-24d0ac34c285' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 0a09bd65-8d07-49a8-81fc-f1ed5d44029f
else
search --no-floppy --fs-uuid --set=root 0a09bd65-8d07-49a8-81fc-f1ed5d44029f
fi
echo 'Loading Linux 3.12.21-gentoo-r1 ...'
linux /kernel-3.12.21-gentoo-r1 root=/dev/sda3 ro
} |
So much for the default entry. I've been doing some housecleaning so only have 3.12.21-gentoo-r1 in /boot. Thus my advanced only has the two stanzas for it. The first is basically the same thing as the stanza in the default entry. The second is the recovery one which goes into single user
Code: | submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-20ec7a8b-ffc6-4454-a436-24d0ac34c285' {
menuentry 'Gentoo GNU/Linux, with Linux 3.12.21-gentoo-r1' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.21-gentoo-r1-advanced-20ec7a8b-ffc6-4454-a436-24d0ac34c285' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 0a09bd65-8d07-49a8-81fc-f1ed5d44029f
else
search --no-floppy --fs-uuid --set=root 0a09bd65-8d07-49a8-81fc-f1ed5d44029f
fi
echo 'Loading Linux 3.12.21-gentoo-r1 ...'
linux /kernel-3.12.21-gentoo-r1 root=/dev/sda3 ro
}
menuentry 'Gentoo GNU/Linux, with Linux 3.12.21-gentoo-r1 (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.21-gentoo-r1-recovery-20ec7a8b-ffc6-4454-a436-24d0ac34c285' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 0a09bd65-8d07-49a8-81fc-f1ed5d44029f
else
search --no-floppy --fs-uuid --set=root 0a09bd65-8d07-49a8-81fc-f1ed5d44029f
fi
echo 'Loading Linux 3.12.21-gentoo-r1 ...'
linux /kernel-3.12.21-gentoo-r1 root=/dev/sda3 ro single
}
}
### END /etc/grub.d/10_linux ### |
The other snippets in /etc/grub.d get interpreted by grub2-mkconfig and then inserted. The 40_custom would be were you would park hand crafted stanzas.
Code: | ### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# 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.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
|
So that may be enough of a primer to get you started with your research into booting problems. You can see if the single user recovery mode in advanced gets you far enough to find out what happened to init Hopefully it isn't the dreaded systemd replacement for init that isn't biting you in the ass. There's a kernel option at the top of new kernels now for using either systemd, openrc or both support and the systemd USE flag to deal with (maybe disable). If you were foolish enough to stay with GNOME as they flew over the cliff, odds are that you have been coerced down the systemd path due to deps in Gnome, udev (versus eudev), and the various consolekit/policykit etc versions that have come down the pike lately. |
|
Back to top |
|
|
phobos13013 Apprentice
Joined: 22 Sep 2004 Posts: 277 Location: PNW
|
Posted: Sat Jun 28, 2014 5:22 pm Post subject: |
|
|
vaxbrat,
So a few things; looking at my grub.cfg, I was already aware of the recovery mode entry which doesnt deviate significantly from the normal boot entry but whatevs, so I was actually counting that as ONE entry, beyond that couplet, there is a second couplet for 3.12.21, and even a third although one is appended with a .old so I assume it was the one I did a distclean on at some point. Just sort of weird to me why that second couplet is there I cant really source it in /usr/src/linux.
But frankly that is a non-issue to me as long as I can get ONE working version of this kernel... So, my big fear is indeed that this systemd/openrc issue is my problem, I just need to understand how I can determine that as fact. AFAIK, I have the openrc track. I am not a gnome user, although I would prefer it to KDE, regardless, my system was previously set with fluxbox. I do know that the openrc/runit kernel option is set and not the systemd and I dont think during my update @system/@world process that systemd got pulled in at all.
So with all that... I still am clueless why init doesnt take me all the way to my previous linux install. After taking my root fs out of read-only (again grub2 continues to set it automatically which I have to go in and remove before booting), I get a full mount according to the boot procedure but init doesnt take it home. Is there a way to get the init output into a bpaste for others review? Any help info as is appreciated _________________ ...and it should be known by now |
|
Back to top |
|
|
vaxbrat l33t
Joined: 05 Oct 2005 Posts: 731 Location: DC Burbs
|
Posted: Sun Jun 29, 2014 2:13 am Post subject: There's only two ways I know of |
|
|
There's only two ways that I know of to capture this stage of the boot. Do it in a VM where you can screen capture the display on the hypervisor or go back to the old fashioned serial port console where you direct your console text to another box with a serial port. |
|
Back to top |
|
|
vaxbrat l33t
Joined: 05 Oct 2005 Posts: 731 Location: DC Burbs
|
Posted: Sun Jun 29, 2014 2:15 am Post subject: oh.... and maybe using IPMI |
|
|
If your mobo has IPMI, you could potentially get your console through that out a lan port. |
|
Back to top |
|
|
phobos13013 Apprentice
Joined: 22 Sep 2004 Posts: 277 Location: PNW
|
Posted: Mon Jun 30, 2014 12:53 am Post subject: |
|
|
So in lieu of getting boot script output onto this board, is there any guidance on how to deal with an install where the init script hangs on intialization asking for a runlevel entry? If it comes down to it I can type out the leading end that I can see which appears to contain the majority of the issues. But any hints are appreciated, noting that the issue probably isnt a systemd/openrc issue. Is there other kernel requirements these days to get a working boot? Am I missing something in sysinit (udev and udev-mount are both in there default)? When I tried to update my system the one thing I was having trouble updating was sysvinit. Once I got that updated (using the emrge -K from a quickpkg), I was no longer able to boot (even BEFORE updating to grub2). Any help is appreciated! _________________ ...and it should be known by now |
|
Back to top |
|
|
Aquous l33t
Joined: 08 Jan 2011 Posts: 700
|
Posted: Mon Jun 30, 2014 12:52 pm Post subject: |
|
|
phobos13013 wrote: | Is there other kernel requirements these days to get a working boot? | Just a stab in the dark, but perhaps you are missing CONFIG_DEVTMPFS{,_MOUNT}=y? What init system are you currently intending to use? |
|
Back to top |
|
|
sebB l33t
Joined: 02 Mar 2011 Posts: 806 Location: S.O. France
|
Posted: Mon Jun 30, 2014 9:09 pm Post subject: |
|
|
Quote: | 1) emerge --info - see it here: http://bpaste.net/show/414847/ still lists the old kernel even tho --depclean has been run and no trace of that kernel exists on my system anymore, eselect list only shows one kernel, 3.12.21 and it is selected (make in /usr/src/linux builds the 3.12.21 kernel and there are no errors; no errors on make install either) |
Are you sure you are booting on kernel 3.12.21?
Did you mount /boot before copying vmlinux?
it looks like the renaming of kernel 2.6.37 in 3.12.21 in your /boot.
Can you post your fstab, ls -l /boot and ls -l /lib/modules |
|
Back to top |
|
|
phobos13013 Apprentice
Joined: 22 Sep 2004 Posts: 277 Location: PNW
|
Posted: Tue Jul 01, 2014 3:33 am Post subject: |
|
|
Yeh, so I'm NOT certain that i'm booting right (thats why I put that piece of the puzzle first), maybe I borked boot all that time ago before I migrated to 3.0...
I am mounting boot and just using make install/grub2-install to do all the copying dirty work...
fstab
Quote: | # /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed; notail increases performance of ReiserFS (at the expense of storage
# efficiency). It's safe to drop the noatime options if you want and to
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#
# <fs> <mountpoint> <type> <opts> <dump/pass>
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/sda1 /boot ext2 noatime 1 2
/dev/sda5 / ext3 noatime 0 1
/dev/sda2 none swap sw 0 0
#/dev/sda6 / ext3 noatime 0 1
/dev/sda7 /mnt/win ntfs-3g noatime,ro 0 1
/dev/cdrom /mnt/cdrom auto noauto,ro 0 0
proc /proc proc defaults 0 0
#/dev/fd0 /mnt/floppy auto noauto 0 0
# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
# use almost no memory if not populated with files)
shm /dev/shm tmpfs nodev,nosuid,noexec 0 0 |
ls -l boot
Quote: | total 26103
-rw-r--r-- 1 root root 2951841 Jun 27 23:29 System.map-3.12.21-gentoo-r1
-rw-r--r-- 1 root root 2945079 Jun 27 22:19 System.map-3.12.21-gentoo-r1.old
lrwxrwxrwx 1 root root 1 Apr 27 2011 boot -> .
-rw-r--r-- 1 root root 91419 Jun 27 23:29 config-3.12.21-gentoo-r1
-rw-r--r-- 1 root root 91411 Jun 27 22:19 config-3.12.21-gentoo-r1.old
drwxr-xr-x 6 root root 1024 Jun 27 23:53 grub
-rw-r--r-- 1 root root 4163088 Aug 2 2011 kernel-2.6.39-gentoo-r3
-rw-r--r-- 1 root root 5222944 Jun 22 11:13 kernel-3.12.21-gentoo-r1
drwx------ 2 root root 12288 May 2 2011 lost+found
-rw-r--r-- 1 root root 158 Jun 27 21:57 resolv.conf
-rw-r--r-- 1 root root 5571984 Jun 27 23:29 vmlinuz-3.12.21-gentoo-r1
-rw-r--r-- 1 root root 5558128 Jun 27 22:19 vmlinuz-3.12.21-gentoo-r1.old |
ls -l /lib/modules/
Quote: | total 12
drwxr-xr-x 4 root root 4096 Aug 2 2011 2.6.39-gentoo-r3
drwxr-xr-x 5 root root 4096 Jun 21 11:02 3.1.0-gentoo
drwxr-xr-x 3 root root 4096 Jun 27 23:29 3.12.21-gentoo-r1 |
What does it all mean?! _________________ ...and it should be known by now |
|
Back to top |
|
|
sebB l33t
Joined: 02 Mar 2011 Posts: 806 Location: S.O. France
|
Posted: Tue Jul 01, 2014 8:23 am Post subject: |
|
|
Can you post the output of Code: | grub2-mkconfig -o /boot/grub/grub.cfg |
|
|
Back to top |
|
|
phobos13013 Apprentice
Joined: 22 Sep 2004 Posts: 277 Location: PNW
|
Posted: Wed Jul 02, 2014 1:17 am Post subject: |
|
|
Not sure if you mean the file listed in first post 2) (http://bpaste.net/show/414779/)
or output text essentially states no errors and copies to /boot; finds vmlinuz-3.12.21, kernel-3.12.21, vmlinuz-3.12.21.old and the last bootable (although I'm questioning if it was booting) kernel-2.6.39. NOTE this is not the kernel that shows up in emerge --info.... _________________ ...and it should be known by now |
|
Back to top |
|
|
sebB l33t
Joined: 02 Mar 2011 Posts: 806 Location: S.O. France
|
Posted: Wed Jul 02, 2014 7:38 pm Post subject: |
|
|
You run emerge --info in a chroot?
I don't explain why 2.6.37 is show in emerge --info
Did you try starting 2.6.39 (advanced options in grub)?
How did you compil your kernel (manualy, genkernel,...?)
Read Aquous answer and post your .config in a pastebin |
|
Back to top |
|
|
phobos13013 Apprentice
Joined: 22 Sep 2004 Posts: 277 Location: PNW
|
Posted: Thu Jul 03, 2014 3:13 am Post subject: |
|
|
Hey, guess I missed Aquous' comment there! My bad!
So to those earlier questions: yes, devtmpfs and mount are in the kernel which I have compiled completely manually, see .config here:
http://bpaste.net/show/430073
I am running emerge --info in chroot from an OOOOLLD live CD (Gentoo 11); hope thats not causing a problem, dont see why it would...
In advanced grub, I have tried running every option in there from recovery to 2.6.39, you name it, they all hang at init...
Now here is the other big issue, I am not 100% certain which init environment I have. I currently have openrc and followed grub config to have an lvm2 boot, but I do not totally know how to verify. The old system was sysvinit, and I have updated it, but that is when boot broke, so I do not think that is what works anymore. Worrying about init was never really a concern back in the days last time I was using Gentoo, so its not something I am really privy too. Any advice on how to get an openrc system working for an lvm2 boot is mucho appreciated. _________________ ...and it should be known by now |
|
Back to top |
|
|
phobos13013 Apprentice
Joined: 22 Sep 2004 Posts: 277 Location: PNW
|
Posted: Thu Jul 03, 2014 7:46 am Post subject: |
|
|
OK, SORRY, I got this worked out; apparently by gcc is still f'ed. I managed to get to a workable state from quickpkg builds but apparently its not the final solution. Portage is updated and the latest versions of @system and @world are emerged, but I think I need to go back to the drawing board on installing.
Bottom line is sysvinit and a few other key pkgs werent built in the new environment (might have missed an env-update or dispatch-conf) so when i tried to RE-emerge them, turns out this is why things were broken. I was fiddling with profile early on in the update process so some of my initial quickpkgs might have emerged under the wrong system. Oy, its confusing.
Anyway, I redid emerge -K gcc and managed to get through sysvinit, now I can boot. Still am having trouble getting a proper build of main pkgs, but I can get there, at least I am booting in a new kernel (emerge --info confirms it!)
bpaste.net/show/430641
tanks to all! _________________ ...and it should be known by now |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Thu Jul 03, 2014 3:44 pm Post subject: |
|
|
Can you mark this [solved] by editing the original post, and modifying the subject line? Thanks.
Have to say I'd have just reinstalled; that's what a separate /home partition is for. Still, well done for getting it running again.
wrt quickpkg, qpkg is quicker (heh); also consider using FEATURES=buildpkg. Won't help upgrade after 2 years, but will help rollback during normal maintenance.
See the tip at top of that page (where the linked post is) for some stuff every Gentoo user should know. (Forgive me, but you sound a bit unconfident.)
HTH,
steveL. |
|
Back to top |
|
|
|