Skip to content

Instantly share code, notes, and snippets.

@jasraj
Last active January 12, 2017 13:43
Show Gist options
  • Select an option

  • Save jasraj/646bdfc93aa6d8e2fca33fe1b5692e54 to your computer and use it in GitHub Desktop.

Select an option

Save jasraj/646bdfc93aa6d8e2fca33fe1b5692e54 to your computer and use it in GitHub Desktop.
Updates GRUB to boot with the previous good kernel version (4.4.0-57) for zfs-native 0.6.5.7
# zfs-native 0.6.5.7 - Kernel Downgrade to 4.4.0-57
# Does not build with 4.4.0-59
# Install previous good kernel
apt-get install linux-image-4.4.0-57-generic linux-image-extra-4.4.0-57-generic
# Replace primary boot kernel (vmlinuz and initrd.img) in grub.cfg
sed -E "s/\/(vmlinuz|initrd\.img)-4\.4\.0-59-generic/\/\1-4.4.0-57-generic/g" /boot/grub/grub.cfg > /tmp/grub-modified-4.4.0-57.cfg
# CHECK THE GENERATED FILE (look for code within "menuentry 'Ubuntu'") for updated kernel version
# Update grub.cfg
cp -v /boot/grub/grub.cfg /tmp/grub.$(date +%Y-%m-%d-%H-%M-%S)-.bak
cp -v /tmp/grub-modified-4.4.0-57.cfg /boot/grub/grub.cfg
# Reboot
shutdown -r now
@jasraj
Copy link
Author

jasraj commented Jan 12, 2017

I didn't realise you could use the entry ID for the GRUB_DEFAULT configuration (I only saw it using list index, e.g. 1>2 which didn't work for me). Thanks for sharing that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment