[Bug 1903524] Re: System state with 'space' in name prevent update-grub to create menu entries in grub.cfg

Jean-Baptiste Lallement 1903524 at bugs.launchpad.net
Mon Nov 9 16:23:36 UTC 2020


** Also affects: grubzfs-testsuite (Ubuntu)
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/1903524

Title:
  System state with 'space' in name prevent update-grub to create menu
  entries in grub.cfg

Status in grub2 package in Ubuntu:
  In Progress
Status in grubzfs-testsuite package in Ubuntu:
  New
Status in grub2 source package in Focal:
  Triaged
Status in grubzfs-testsuite source package in Focal:
  New
Status in grub2 source package in Groovy:
  Triaged
Status in grubzfs-testsuite source package in Groovy:
  New

Bug description:
  From https://github.com/ubuntu/zsys/issues/169

  Describe the bug
  I did create few days ago a System state with a 'space' in the name : "pool/ROOT/ubuntu_u7dn3s at Stable Plex"

  server:~$ zsysctl show 
  Name:           rpool/ROOT/ubuntu_u7dn3s
  ZSys:           true
  Last Used:      current
  History:        
    - Name:       rpool/ROOT/ubuntu_u7dn3s at autozsys_ceqh6a
      Created on: 2020-10-16 06:49:59
    - Name:       rpool/ROOT/ubuntu_u7dn3s at autozsys_ahzb7l
      Created on: 2020-10-15 06:40:13
    - Name:       rpool/ROOT/ubuntu_u7dn3s at autozsys_a00j2k
      Created on: 2020-10-08 06:46:34
     - Name:       rpool/ROOT/ubuntu_u7dn3s at autozsys_b7t6lj
       Created on: 2020-10-07 06:20:00
     - Name:       rpool/ROOT/ubuntu_u7dn3s at Stable Plex
       Created on: 2020-10-03 19:18:18
     - Name:       rpool/ROOT/ubuntu_u7dn3s at autozsys_a81mbp
       Created on: 2020-10-03 17:58:19
  (truncated)...
  I found myself in the impossibility to boot the server few days after as the Grub menu had only the UEFI entry in it. No more entries for current kernel or zsys history.

  server:~$ cat /boot/grub/grub.cfg 
  ...(truncated)
  ### 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/30_uefi-firmware ###
  menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
  	fwsetup
  }
  ### END /etc/grub.d/30_uefi-firmware ###

  ### 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 ###
  (truncated)... 
  After chrooting into the server, I tried to rebuild the menu with update-grub and got a weird error message on ignoring datasets:

  server:~$ update-grub
  Sourcing file `/etc/default/grub'
  Sourcing file `/etc/default/grub.d/init-select.cfg'
  Generating grub configuration file ...
  Found linux image: vmlinuz-5.4.0-48-generic in rpool/ROOT/ubuntu_25bi0j
  Found initrd image: initrd.img-5.4.0-48-generic in rpool/ROOT/ubuntu_25bi0j
  Found linux image: vmlinuz-5.4.0-42-generic in rpool/ROOT/ubuntu_25bi0j
  Found initrd image: initrd.img-5.4.0-42-generic in rpool/ROOT/ubuntu_25bi0j
  ...(truncated)...
  Found initrd image: initrd.img-5.4.0-42-generic in rpool/ROOT/ubuntu_u7dn3s at autozsys_a81mbp
  Warning: Failed to find a valid directory 'etc' for dataset 'rpool/ROOT/ubuntu_u7dn3s at Stable'. Ignoring
  Warning: Ignoring rpool/ROOT/ubuntu_u7dn3s at Stable
  filesystem 'Plex' cannot be mounted, unable to open the dataset
  Adding boot menu entry for UEFI Firmware Settings
  done
  As a result the grub.cfg file was letf with only the UEFI entry.

  To solve this issue, I had to delete the problematic state and reran
  update-grub. I then was back to normal.

  server:~$ zsysctl state remove 'Stable Plex' --system
  ZSys is adding automatic system snapshot to GRUB menu

  server:~$ update-grub
  ...(truncated)...

  server:~$ cat /boot/grub/grub.cfg 
  ...(truncated)
  	menuentry '* Ubuntu 20.04.1 LTS, with Linux 5.4.0-48-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os ${menuentry_id_option} 'gnulinux-rpool/ROOT/ubuntu_u7dn3s-5.4.0-48-generic' {
  		recordfail
  		load_video
  		insmod gzio
  		if [ "${grub_platform}" = xen ]; then insmod xzio; insmod lzopio; fi
  		insmod part_gpt
  		insmod zfs
  		if [ x$feature_platform_search_hint = xy ]; then
  		  search --no-floppy --fs-uuid --set=root  9976c549b4d44f87
  		else
  		  search --no-floppy --fs-uuid --set=root 9976c549b4d44f87
  		fi
  		echo Loading Linux 5.4.0-48-generic ...
  		linux	/BOOT/ubuntu_u7dn3s@/vmlinuz-5.4.0-48-generic root=ZFS=rpool/ROOT/ubuntu_u7dn3s ro recovery nomodeset dis_ucode_ldr  
  		echo 'Loading initial ramdisk ...'
  		initrd	/BOOT/ubuntu_u7dn3s@/initrd.img-5.4.0-48-generic
  	}
  }
  submenu 'History for Ubuntu 20.04.1 LTS' ${menuentry_id_option} 'gnulinux-history-rpool/ROOT/ubuntu_u7dn3s' {
  	submenu 'Revert to 10/16/2020 @ 06:49' ${menuentry_id_option} 'gnulinux-history-rpool/ROOT/ubuntu_u7dn3s at autozsys_ceqh6a' {
  (truncated)...
  To Reproduce

  Create a system state with a 'space' in the name
  Run update-grub and check the warning message at the end of the process
  Check /boot/grub/grub.cfg file for missing Grub menu entries
  Expected behavior
  A grub.cfg file with all necessary menu entries.
  zsysctl should forbid to create state with space in name or zsys update-grub helper should be able to handle states' names with spaces in it.

  For ubuntu users, please run and copy the following:

  ubuntu-bug zsys --save=/tmp/report
  Copy paste below /tmp/report content:
  File is too big. Will put it in comment.
  Installed versions:

  OS: (/etc/os-release)
  NAME="Ubuntu"
  VERSION="20.04.1 LTS (Focal Fossa)"
  ID=ubuntu
  ID_LIKE=debian
  PRETTY_NAME="Ubuntu 20.04.1 LTS"
  VERSION_ID="20.04"
  HOME_URL="https://www.ubuntu.com/"
  SUPPORT_URL="https://help.ubuntu.com/"
  BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
  PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
  VERSION_CODENAME=focal
  UBUNTU_CODENAME=focal
  Zsysd running version: (zsysctl version output)
  zsysctl	0.4.7
  zsysd	0.4.7
  Additional context
  It's a Ubuntu Server flavor, booting on ZFS with Zsys and installed with the following procedure: https://openzfs.github.io

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1903524/+subscriptions



More information about the foundations-bugs mailing list