Author Topic: How to make an older kernel your default boot kernel.  (Read 1749 times)

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4889
  • Karma: 1058
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 10 (64-bit)
How to make an older kernel your default boot kernel.
« on: December 05, 2016, 05:37:36 pm »
Hi all, I recently tried upgrade my system to the new 4.4.0-51 kernel.  Unfortunately, my system was having none of it.  After booting up normally, my system locked up solid after around 3 minutes.  I couldn't even REISUB out.  The only way was a draconian hard shutdown.  This is not so good >:(.  The only thing changed on my system was the kernel.  The solution was to use an older working kernel, until the next new kernel was released. 

In this tutorial, you'll be shown how to easily achieve this and make it your default kernel each time you boot up your machine.  For the record, here's my machine's specifications:
Code: [Select]
andy@andy-Latitude-PM7 ~ $ inxi -Fx
System:    Host: andy-Latitude-PM7 Kernel: 4.4.0-47-generic x86_64 (64 bit gcc: 5.4.0)
           Desktop: N/A Distro: Peppermint Seven
Machine:   System: Dell (portable) product: Latitude E6410 v: 0001
           Mobo: Dell model: 0667CC v: A03 Bios: Dell v: A16 date: 12/05/2013
CPU:       Dual core Intel Core i5 M 560 (-HT-MCP-) cache: 3072 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 10639
           clock speeds: max: 2667 MHz 1: 2133 MHz 2: 1866 MHz 3: 1466 MHz 4: 1466 MHz
Graphics:  Card: Intel Core Processor Integrated Graphics Controller bus-ID: 00:02.0
           Display Server: X.Org 1.18.4 drivers: intel (unloaded: fbdev,vesa)
           Resolution: 1280x800@60.00hz
           GLX Renderer: Mesa DRI Intel Ironlake Mobile
           GLX Version: 2.1 Mesa 11.2.0 Direct Rendering: Yes
Audio:     Card Intel 5 Series/3400 Series High Definition Audio
           driver: snd_hda_intel bus-ID: 00:1b.0
           Sound: Advanced Linux Sound Architecture v: k4.4.0-47-generic
Network:   Card-1: Intel 82577LM Gigabit Network Connection
           driver: e1000e v: 3.2.6-k port: 7040 bus-ID: 00:19.0
           IF: eno1 state: down mac: 5c:26:0a:5b:95:ef
           Card-2: Intel Centrino Advanced-N 6200 driver: iwlwifi bus-ID: 02:00.0
           IF: wlp2s0 state: up mac: 18:3d:a2:67:d6:f0
Drives:    HDD Total Size: 1120.2GB (30.0% used)
           ID-1: /dev/sda model: KINGSTON_SV300S3 size: 120.0GB temp: 35C
           ID-2: /dev/sdb model: WDC_WD10JPVX size: 1000.2GB temp: 37C
Partition: ID-1: / size: 20G used: 8.1G (44%) fs: ext4 dev: /dev/sda7
           ID-2: /home size: 16G used: 7.1G (49%) fs: ext4 dev: /dev/sda8
           ID-3: swap-1 size: 8.59GB used: 0.00GB (0%) fs: swap dev: /dev/sdb2
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 58.0C mobo: N/A
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 232 Uptime: 25 min Memory: 1296.3/7909.4MB
           Init: systemd runlevel: 5 Gcc sys: 5.4.0
           Client: Shell (bash 4.3.461) inxi: 2.2.35
andy@andy-Latitude-PM7 ~ $
Fortunately, I always keep the penultimate working kernel as a spare.  I recommend this to everyone as a good working practice  ;).  In this case it's:
Code: [Select]
andy@andy-Latitude-PM7 ~ $ uname -r
andy@andy-Latitude-PM7 ~ $
I've made this my default kernel again, until the next new kernel is released.  From there I can test if it plays nicely with my machine.  From here, I opened up the file:
Code: [Select]
sudo pluma /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)

# Uncomment to disable graphical terminal (grub-pc only)

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux

# Uncomment to disable generation of recovery mode menu entries

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

If you're not using: Pluma as your text editor, please adjust the command to reflect the text editor you're using  ;)

The line highlighted in, red is the important one.  I've changed mine to read:
I'll explain this change to my system.  The actual numbers may differ on your system.  The methodology remains the same.  This is where you'll need a pencil and paper

Reboot your system and hold down the Shift key.  If you're multibooting, you don't need to hold the Shift key.  When your GRUB menu appears, hit the Up and Down arrow keys to stop the countdown timer.  You'll see how the menu is presented in lines.  These lines are numbered, (invisibly) from 0, (zero) then 1 (one) and so on.  The line, 0 (zero) is to launch Peppermint 7, (or the version you're using) with the newest kernel.  This explains the line:
in the file: /etc/grub/default.  The line you look for in the GRUB boot menu is: Advanced options for Peppermint GNU/Linux.  In my system it's line: 1 (one).  Select this and a new page opens.  The same line counting method applies to the this page.  These lines are numbered, (invisibly) from 0, (zero) then 1 (one) and so on.  The line you looking for is the last working kernel.  It'll read something similar to this:
Peppermint GNU/Linux with Linux 4.4.0-47
At the time of writing this tutorial, my penultimate working kernel was: Linux 4.4.0-47.  It's important to note, in all probability this will be different in your system  ;).  The line number for this in my system is 3 (three).  This now explains the line:
Note the apostrophes encapsulating the '1>3'.  These are vital for the statement to work.  Either apostrophes, or quotation marks can be used.  They must not be mixed.  After you've booted into your older working kernel. make your edit to the /etc/grub/default.  Save and exit the file.  Open a terminal window with the following keystrokes: Ctrl+Alt+t.  Enter, (copy & paste) the following command into the terminal window, hit enter and follow the onscreen instructions:
Code: [Select]
sudo update-grub
Reboot your machine.  Open a terminal window with the following keystrokes: Ctrl+Alt+t.  To check your kernel number enter, (copy & paste) the following command into the terminal window:
Code: [Select]
uname -rThat's it, you now have your penultimate working kernel as your default one  ;).
« Last Edit: December 05, 2016, 06:02:53 pm by AndyInMokum »
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26437
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: How to make an older kernel your default boot kernel.
« Reply #1 on: December 06, 2016, 05:26:56 am »
VERY useful tutorial Andy .. TVM :)
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint