Grub2 UUID does not exist error

An older Xen linode (Ubuntu 10.04) is scheduled to be migrated to KVM. It's currently using pv-grub, so I wanted to test switching it to Grub2 in advance of the migration. I shut down the node & cloned it. I set up Grub2 but cannot figure out a missing UUID error. Grubs dumps to initramfs shell with "/dev/disk/by-uuid/a0e28e08-900a-4d83-98ab-51a0c029e2ee does not exist" error. I checked & it seems that the UUID does match in the various places, so I'm not sure what is wrong.

initramfs seems to be looking for the right kernel with the correct UUID.

(initramfs) cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-2.6.32-45-generic-pae root=UUID=a0e28e08-900a-4d83-98ab-51a0c029e2ee ro single console=ttyS0,19200n8 net.ifnames=0

(initramfs) set
BOOT='local'
BOOT_IMAGE='/boot/vmlinuz-2.6.32-45-generic-pae'
DPKG_ARCH='i386'
HOME='/'
HWADDR=''
IFS='   
'
IPOPTS=''
MODPROBE_OPTIONS='-qb'
OPTIND='1'
PATH='/sbin:/usr/sbin:/bin:/usr/bin'
PPID='1'
PS1='(initramfs) '
PS2='> '
PS4='+ '
PWD='/'
ROOT='/dev/disk/by-uuid/a0e28e08-900a-4d83-98ab-51a0c029e2ee'
ROOTDELAY=''
ROOTFLAGS=''
ROOTFSTYPE=''
TERM='linux'
blacklist=''
break=''
debug=''
init='/sbin/init'
panic=''
quiet='y'
readonly='y'
resume=''
resume_offset=''
rootmnt='/root'

If I boot in a Linode-provided kernel I see that by-uuid does point to /dev/sda & that the kernel & initrd are in expected spot:

# ls -l /dev/disk/by-uuid/a0e28e08-900a-4d83-98ab-51a0c029e2ee      
lrwxrwxrwx 1 root root 9 Feb 14 07:38 /dev/disk/by-uuid/a0e28e08-900a-4d83-98ab

# ls -l /boot/vmlinuz-2.6.32-45-generic-pae
-rw-r--r-- 1 root root 4186336 Feb 19  2013 /boot/vmlinuz-2.6.32-45-generic-pae

# ls -l /boot/initrd.img-2.6.32-45-generic-pae
-rw-r--r-- 1 root root 3671101 Feb 13 19:59 /boot/initrd.img-2.6.32-45-generic-pae

Checked the UUIDs:

# blkid
/dev/sdb: UUID="6cd18b59-6e3a-4f18-937b-a5b699725040" TYPE="swap" 
/dev/sda: UUID="a0e28e08-900a-4d83-98ab-51a0c029e2ee" TYPE="ext3"

/etc/fstab was using sdX & I switched to use UUID:

# /etc/fstab: static file system information.
#
# <file system=""><mount point=""><type><options><dump><pass>dev             /dev            devtmpfs rw              0       0
proc            /proc           proc     defaults        0       0
#/dev/sda       /               ext3     noatime,errors=remount-ro 0       1
#/dev/sdb       none            swap     sw              0       0
UUID=a0e28e08-900a-4d83-98ab-51a0c029e2ee       /               ext3     noatime,errors=remount-ro 0       1
UUID=6cd18b59-6e3a-4f18-937b-a5b699725040       none            swap     sw</pass></dump></options></type></mount></file> 

update-grub did properly pick up the partition & UUID. I've ran update-grub & reinitialized initrd multiple times (using "update-initramfs -u" & confirmed that the proper initrd was being updated):

/boot/grub.grub.cfg:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-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
set default="0"
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 recordfail {
  set recordfail=1
  if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfi
}
if [ ${recordfail} = 1 ]; then
  set timeout=-1
else
  set timeout=20
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-45-generic-pae' --class ubuntu --class gnu{
        recordfail
        insmod ext2
        set root='(hd0)'
        search --no-floppy --fs-uuid --set a0e28e08-900a-4d83-98ab-51a0c029e2ee
        linux   /boot/vmlinuz-2.6.32-45-generic-pae root=UUID=a0e28e08-900a-4d8t
        initrd  /boot/initrd.img-2.6.32-45-generic-pae
}
menuentry 'Ubuntu, with Linux 2.6.32-45-generic-pae (recovery mode)' --class ub{
        recordfail
        insmod ext2
        set root='(hd0)'
        search --no-floppy --fs-uuid --set a0e28e08-900a-4d83-98ab-51a0c029e2ee
        echo    'Loading Linux 2.6.32-45-generic-pae ...'
        linux   /boot/vmlinuz-2.6.32-45-generic-pae root=UUID=a0e28e08-900a-4d80
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-2.6.32-45-generic-pae
}
menuentry 'Ubuntu, with Linux 2.6.32-41-generic-pae' --class ubuntu --class gnu{
        recordfail
        insmod ext2
        set root='(hd0)'
        search --no-floppy --fs-uuid --set a0e28e08-900a-4d83-98ab-51a0c029e2ee
        linux   /boot/vmlinuz-2.6.32-41-generic-pae root=UUID=a0e28e08-900a-4d8t
        initrd  /boot/initrd.img-2.6.32-41-generic-pae
}
menuentry 'Ubuntu, with Linux 2.6.32-41-generic-pae (recovery mode)' --class ub{
        recordfail
        insmod ext2
        set root='(hd0)'
        search --no-floppy --fs-uuid --set a0e28e08-900a-4d83-98ab-51a0c029e2ee
        echo    'Loading Linux 2.6.32-41-generic-pae ...'
        linux   /boot/vmlinuz-2.6.32-41-generic-pae root=UUID=a0e28e08-900a-4d80
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-2.6.32-41-generic-pae
}
menuentry 'Ubuntu, with Linux 2.6.32-38-generic-pae' --class ubuntu --class gnu{
        recordfail
        insmod ext2
        set root='(hd0)'
        search --no-floppy --fs-uuid --set a0e28e08-900a-4d83-98ab-51a0c029e2ee
        linux   /boot/vmlinuz-2.6.32-38-generic-pae root=UUID=a0e28e08-900a-4d8t
        initrd  /boot/initrd.img-2.6.32-38-generic-pae
}
menuentry 'Ubuntu, with Linux 2.6.32-38-generic-pae (recovery mode)' --class ub{
        recordfail
        insmod ext2
        set root='(hd0)'
        search --no-floppy --fs-uuid --set a0e28e08-900a-4d83-98ab-51a0c029e2ee
        echo    'Loading Linux 2.6.32-38-generic-pae ...'
        linux   /boot/vmlinuz-2.6.32-38-generic-pae root=UUID=a0e28e08-900a-4d80
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-2.6.32-38-generic-pae
}
menuentry 'Ubuntu, with Linux 2.6.32-30-generic-pae' --class ubuntu --class gnu{
        recordfail
        insmod ext2
        set root='(hd0)'
        search --no-floppy --fs-uuid --set a0e28e08-900a-4d83-98ab-51a0c029e2ee
        linux   /boot/vmlinuz-2.6.32-30-generic-pae root=UUID=a0e28e08-900a-4d8t
        initrd  /boot/initrd.img-2.6.32-30-generic-pae
}
menuentry 'Ubuntu, with Linux 2.6.32-30-generic-pae (recovery mode)' --class ub{
        recordfail
        insmod ext2
        set root='(hd0)'
        search --no-floppy --fs-uuid --set a0e28e08-900a-4d83-98ab-51a0c029e2ee
        echo    'Loading Linux 2.6.32-30-generic-pae ...'
        linux   /boot/vmlinuz-2.6.32-30-generic-pae root=UUID=a0e28e08-900a-4d80
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-2.6.32-30-generic-pae
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
        insmod ext2
        set root='(hd0)'
        search --no-floppy --fs-uuid --set a0e28e08-900a-4d83-98ab-51a0c029e2ee
        linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
        insmod ext2
        set root='(hd0)'
        search --no-floppy --fs-uuid --set a0e28e08-900a-4d83-98ab-51a0c029e2ee
        linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
if [ ${timeout} != -1 ]; then
  if keystatus; then
    if keystatus --shift; then
      set timeout=-1
    else
      set timeout=0
    fi
  else
    if sleep --interruptible 3 ; then
      set timeout=0
    fi
  fi
fi
### 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 ###

I'm not sure what to check next.

3 Replies

Is using UUIDs a requirement for any reason?

For ease of use going forward you can disable UUIDs for grub and rebuild the grub config. This is easier, in the event you want to resize a disk in the future, restore a backup to a new disk, etc. Then you only need to keep them in the appropriate /dev/ slots in the Linode's configuration profile.

Here is an example from a Debian box I have, and should be the same for any distro.

$ cat /etc/fstab
# <file system=""><mount point=""><type><options><dump><pass>/dev/sda     /               ext4    errors=remount-ro 0       1
/dev/sdb     none            swap    sw              0       0</pass></dump></options></type></mount></file> 

Then the relevant bits of my grub config

$ cat /etc/default/grub
# ... a bunch of default stuff

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

# ... more default stuff

And then run an update-grub.

$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-4.9.0-5-amd64 root=/dev/sda ro console=ttyS0,19200n8 net.ifnames=0

Edit: added my /proc/cmdline output

Jesus christ, 2.6.32?! Do yourself a favour, rebuild the box.

I switched from UUID to sdX in fstab & then updated grub & initramfs. I now get "/dev/sda does not exist" error. So it's apparently a more basic issue than just a UUID mismatch.

If I drop out of grub menu to a shell, I can see the filesystem. But I do not see /dev/sda or /dev/disk - shouldn't I see these from grub shell? I see a bunch of xvd devices though.

grub> cat (hd0)/etc/fstab
# /etc/fstab: static file system information.
#
# <file system=""><mount point=""><type><options><dump><pass>dev             /dev            devtmpfs rw              0       0
proc            /proc           proc     defaults        0       0
/dev/sda       /               ext3     noatime,errors=remount-ro 0       1
/dev/sdb       none            swap     sw              0       0
#UUID=a0e28e08-900a-4d83-98ab-51a0c029e2ee      /               ext3     noatime,errors=remount-ro 0       1
#UUID=6cd18b59-6e3a-4f18-937b-a5b699725040      none            swap     sw             0       0

grub> ls (hd0)/dev/sda
error: file `/dev/sda' not found

grub> ls (hd0)/dev/disk
error: file `/dev/disk' not found.

grub> ls (hd0)/dev     
ram16 xvdd5 xvde11 xvdf6 full stdin rmidi3 xvdg9 xvdf14 xvdd xvdg11 xvdh1 tty2 
xvde1 xvdc2 xvde12 xvdh15 tty1 xvdf8 mem ubda xvdd12 xvda12 dsp mixer1 ram audi
o3 mpu401data xvdc1 xvde7 agpgart sndstat midi02 audio2 ram13 rmidi2 xvdb7 xvdb
9 tty3 ptmx midi2 loop6 ram10 xvdd9 ram11 xvda ram0 tty5 smpte3 xvdg3 xvdc3 xvd
c11 xvdg dsp1 xvdc ubde xvda10 xvda8 xvdh8 xvdb3 fd xvde15 xvdf1 dsp2 xvdc5 por
t null loop3 ubdf xvdh3 xvdg13 xvdg4 ram8 smpte2 xvdh12 xvdb6 xvdg10 xvdf3 xvdg
5 zero xvdd4 xvdh7 xvda1 mixer2 loop0 xvdg1 xvdb14 xvdc6 ubdc xvdf console loop
4 xvdc14 xvdc15 midi03 xvdh2 xvdd10 xvde2 smpte1 ram9 mixer3 xvda5 loop1 xvdb11
xvdh11 audioctl xvdf10 xvda3 midi3 midi0 midi01 xvdc9 xvdd6 xvdb1 xvdf7 ram14 x
vdd3 xvde4 xvdc8 xvdg15 audio xvdd7 xvdc10 midi1 xvdf9 urandom sequencer xvdg7 
xvdb13 xvda4 xvda7 xvdg2 ram7 xvdb15 xvda11 xvde10 mpu401stat xvdb12 xvdb8 xvde
9 xvda15 kmem xvde tty0 tty6 xvdb2 xvdf11 xvdf5 xvdh6 mixer tty4 xvdc12 loop5 x
vde3 ram15 xvdc13 xvdb4 xvdg8 stdout xvde5 midi00 xvdd14 xvde8 dsp3 xvda9 xvdd1
3 xvdd1 xvde14 loop2 ram6 xvda13 tty core xvdb5 ram4 xvdb xvdh random smpte0 xv
dh14 tty8 ubdh xvda6 ram5 xvdh4 audio1 ubdb xvdf12 xvdf13 xvde13 xvda2 rmidi0 r
am1 ubdd xvdg12 xvdd11 xvdf15 tty7 ram3 stderr xvdf2 tty9 ubdg ram12 xvdh9 hvc0
xvda14 xvdh10 xvdc7 xvdg14 loop7 xvde6 xvdd15 xvdh5 rmidi1 xvdh13 xvdf4 xvdd8 x
vdg6 xvdb10 xvdd2 ram2 xvdc4 shm/ pts/

grub> set
?=0
color_highlight=black/white
color_normal=white/black
default=0
feature_200_final=y
feature_all_video_module=y
feature_chainloader_bpb=y
feature_default_font_path=y
feature_menuentry_id=y
feature_menuentry_options=y
feature_ntldr=y
feature_platform_search_hint=y
grub_cpu=i386
grub_platform=pc
lang=
locale_dir=
menu_color_highlight=black/light-gray
menu_color_normal=white/black
pager=1
prefix=(hd0)/boot/grub
recordfail=1
root=hd0
secondary_locale_dir=</pass></dump></options></type></mount></file> 

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct