1

I have 4 partitions on my hard disk:

  • 15 GB Ubuntu OS (mounted to /) - sda 2
  • 15 GB Backup (not mounted) - sda 3
  • 505 MB Grub (/boot/efi) - sda 1
  • 89 GB GB Data (mount /data) - sda 4

For LTS updates, e.g. 16.04 to 18.04, I want to copy (with dd) my first partition (sda2) to the second (sda3). That way, I can do the release update on sda2 and if this fails, I have a backup on sda3.

I tried a lot of stuff to boot from sda3, but the menu entry doesn't show up (I used update-grub).

Used dd command: dd if=/dev/sda2 of=/dev/sda3

My file /etc/grub.d/40_custom

#!/bin/sh
exec tail -n +3 $0
# 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.

menuentry "Backup" {
set root=(hd0,3)
    linux /vmlinuz root=/dev/sda3 ro quiet splash
    initrd /initrd.img
}

Output of update-grub

Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50-curtin-settings.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-47-generic
Found initrd image: /boot/initrd.img-4.15.0-47-generic
Adding boot menu entry for EFI firmware configuration
done

My File /boot/grub/menu.lst

default         0
timeout         0
hiddenmenu

title           Ubuntu 18.04.2 LTS, kernel 4.15.0-47-generic
root            (hd0)
kernel          /boot/vmlinuz-4.15.0-47-generic root=/dev/hda1 ro console=hvc0
initrd          /boot/initrd.img-4.15.0-47-generic

title           Ubuntu 18.04.2 LTS, kernel 4.15.0-47-generic (recovery mode)
root            (hd0)
kernel          /boot/vmlinuz-4.15.0-47-generic root=/dev/hda1 ro  single
initrd          /boot/initrd.img-4.15.0-47-generic
12
  • @terdon i added now a custom menuentry.. see above... – False Apr 5 '19 at 8:54
  • Thank you, that's much clearer now! Did you run grub-install after update-grub? If not, no new menu entry will be created if I remember correctly. – terdon Apr 5 '19 at 9:01
  • In the example above i only run grub-install, the menuentry is shown in grub. But it boots the same system as the original boot entry (both sda2) – False Apr 5 '19 at 9:09
  • What? Why didn't you mention that then? What menu entry? Please tell us all of these details, it is really tiring to have to drag them out of you bit by bit like this. The more information you give us, the better our chances of understanding and helping you. – terdon Apr 5 '19 at 9:12
  • 1
    Please check in /etc/default/grub if there is a line GRUB_DISABLE_OS_PROBER=true and change this value to false. I guess with the new setting your backup partition should be found and create a new menu entry when you run update-grub again. – Freddy Apr 5 '19 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.