update-grub complains about non-existent drives (due to cardreader)

Bug #1834250 reported by Scott Seufert on 2019-06-25
42
This bug affects 9 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Low
Unassigned

Bug Description

sudo update-grub

Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
  /dev/sdc: open failed: No medium found
  /dev/sdd: open failed: No medium found
  /dev/sde: open failed: No medium found
  /dev/sdf: open failed: No medium found
  /dev/sdc: open failed: No medium found
  /dev/sdd: open failed: No medium found
  /dev/sde: open failed: No medium found
  /dev/sdf: open failed: No medium found
  /dev/sdc: open failed: No medium found
  /dev/sdd: open failed: No medium found
  /dev/sde: open failed: No medium found
  /dev/sdf: open failed: No medium found
  /dev/sdc: open failed: No medium found
  /dev/sdd: open failed: No medium found
  /dev/sde: open failed: No medium found
  /dev/sdf: open failed: No medium found
  /dev/sdc: open failed: No medium found
  /dev/sdd: open failed: No medium found
  /dev/sde: open failed: No medium found
  /dev/sdf: open failed: No medium found
  /dev/sdc: open failed: No medium found
  /dev/sdd: open failed: No medium found
  /dev/sde: open failed: No medium found
  /dev/sdf: open failed: No medium found
  /dev/sdc: open failed: No medium found
  /dev/sdd: open failed: No medium found
  /dev/sde: open failed: No medium found
  /dev/sdf: open failed: No medium found
  /dev/sdc: open failed: No medium found
  /dev/sdd: open failed: No medium found
  /dev/sde: open failed: No medium found
  /dev/sdf: open failed: No medium found
  /dev/sdc: open failed: No medium found
  /dev/sdd: open failed: No medium found
  /dev/sde: open failed: No medium found
  /dev/sdf: open failed: No medium found
  /dev/sdc: open failed: No medium found
  /dev/sdd: open failed: No medium found
  /dev/sde: open failed: No medium found
  /dev/sdf: open failed: No medium found
Found linux image: /boot/vmlinuz-5.0.0-17-generic
Found initrd image: /boot/initrd.img-5.0.0-17-generic
Found linux image: /boot/vmlinuz-5.0.0-16-generic
Found initrd image: /boot/initrd.img-5.0.0-16-generic
  /dev/sdc: open failed: No medium found
  /dev/sdd: open failed: No medium found
  /dev/sde: open failed: No medium found
  /dev/sdf: open failed: No medium found
  /dev/sdc: open failed: No medium found
  /dev/sdd: open failed: No medium found
  /dev/sde: open failed: No medium found
  /dev/sdf: open failed: No medium found
  /dev/sdc: open failed: No medium found
  /dev/sdd: open failed: No medium found
  /dev/sde: open failed: No medium found
  /dev/sdf: open failed: No medium found
Adding boot menu entry for EFI firmware configuration
done

--

lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 3.7T 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
├─sda2 8:2 0 732M 0 part /boot
└─sda3 8:3 0 3.7T 0 part
  └─sda3_crypt 253:0 0 3.7T 0 crypt
    ├─kubuntu--vg-swap_1 253:1 0 976M 0 lvm [SWAP]
    └─kubuntu--vg-root 253:2 0 3.7T 0 lvm /
sdb 8:16 0 3.7T 0 disk
└─sdb1 8:17 0 3.7T 0 part
sdg 8:96 0 7.3T 0 disk
└─sdg1 8:97 0 7.3T 0 part /media/scott/8TB Ext Drive
sr0 11:0 1 15.7G 0 rom

--

cat /etc/default/grub

GRUB_DEFAULT=0
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="intel_iommu=on"
GRUB_CMDLINE_LINUX=""

ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: grub2-common 2.02+dfsg1-12ubuntu3
ProcVersionSignature: Ubuntu 5.0.0-17.18-generic 5.0.8
Uname: Linux 5.0.0-17-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu3
Architecture: amd64
CurrentDesktop: KDE
Date: Tue Jun 25 15:05:29 2019
InstallationDate: Installed on 2019-06-14 (10 days ago)
InstallationMedia: Kubuntu 19.10 "Eoan Ermine" - Alpha amd64 (20190614)
SourcePackage: grub2
UpgradeStatus: No upgrade log present (probably fresh install)

Scott Seufert (scott-seufert) wrote :
Sebastien Bacher (seb128) wrote :

Thank you for your bug report. Is that a new/recent issue?

Scott Seufert (scott-seufert) wrote :

Hi Sebastien,

It's new for me with 19.10. I didn't have this issue with 19.04 either while it was in development nor after release. I usually use lvm, but this is the first time trying encryption.

I can reproduce it 100% of the time.

Thanks,
Scott

Scott Seufert (scott-seufert) wrote :

UPDATE: I've installed Kubuntu 19.10 on a separate drive in the same system and I've found that this bug still persists irregardless of options. It doesn't matter if I choose encryption or not, nor lvm or not. Out of curiosity, I booted a thumb drive with the latest live build on UEFI and escaping the splash screen and it complained about the missing drives while the live image was booting.

Scott Seufert (scott-seufert) wrote :

I figured out what was causing this issue. I recently installed a multi-card reader in a 5.25 bay that my system sees as separate drives and "no medium found" errors are from no media being in the readers. I've since unplugged all the wires for this device and the errors went away.

Changed in grub2 (Ubuntu):
importance: Undecided → Low
summary: - update-grub complains about non-existent drives
+ update-grub complains about non-existent drives (due to cardreader)
Alejandro Alexiades (alexiades) wrote :

Hi,

Same problem here. I want to skip the GRUP so I modify the grub file, but once I run the command sudo update-grub the terminal show me the same issue.

Thanks and if I can do anything tell me.

Alex

Ivan Dimitrov (idimitro) wrote :

I am seeing the same behaviour. The system was installed with the 19.10 beta on LVM and kept up to date.

$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme0n1 259:0 0 477G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot/efi
└─nvme0n1p2 259:2 0 476.4G 0 part
  └─vgkubuntu-root 253:0 0 475.5G 0 lvm /

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub2 (Ubuntu):
status: New → Confirmed
Zer00CooL (zer00cool) wrote :

For me, but, sorry, in french !

# L'errreur affichée sur Debian lors de la mise à jour du Grub avec update-grub :
/dev/sdb: open failed: No medium found

# La commande lsblk ne montre aucune partition sdb.

# La commande "sudo dmesg |grep sdb" affiche :
[3.48717] sd 6:0:0:0 [sdb] Attached SCSI removable disk

# Je suppose donc que c'est le multi-lecteur de carte SD que j'ai ajouté, et, connecté en interne à la machine.

# Si ce lecteur n'est pas utilisé pour des fonctions lvm, l'ajouter au global_filter dans "/etc/lvm/lvm.conf".
sudo nano /etc/lvm/lvm.conf
# Ajouter la ligne suivante permettra de retirer les lignes "/dev/sdb: open failed: No medium found" :
global_filter = ["r|/dev/sdb|"]

# Exemple complémentaire :
# Accepte chaque périphériques de blocs :
# filter = [ "a|.*/|" ]
# Rejeter le lecteur de CD :
# filter = [ "r|/dev/cdrom|" ]

Résolu pour moi, avec ça !
Les messages d'erreur ne sont plus affichés dans mon cas.

Leonid Barchan (l.barchan) wrote :

Thank you, Zer00Cool, it helps. Here it was without any new device, right after an installation with LVM.

Mateusz Bysiek (mbdev) wrote :

I'm running 19.10 x64 (up to date as of today), LVM setup. Originally installed 19.04 and upgraded. This affects me too. Or, affected rather, because after following advice from comment #9 above it seems fixed. Details follow.

```
$ sudo update-grub2
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
Found linux image: /boot/vmlinuz-5.3.0-29-generic
Found initrd image: /boot/initrd.img-5.3.0-29-generic
Found linux image: /boot/vmlinuz-5.3.0-26-generic
Found initrd image: /boot/initrd.img-5.3.0-26-generic
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
```

It goes on, but I'm skipping it.

```
$ lsblk
nvme0n1 259:0 0 931.5G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot/efi
├─nvme0n1p2 259:2 0 732M 0 part /boot
└─nvme0n1p3 259:3 0 930.3G 0 part
  └─nvme0n1p3_crypt 253:0 0 930.3G 0 crypt
    ├─ubuntu--vg-root 253:1 0 929.3G 0 lvm /
    └─ubuntu--vg-swap_1 253:2 0 976M 0 lvm [SWAP]
```

Above I'm skipping bunch of loop## from output of lsblk.

The Ubuntu "Disks" app identified the /dev/sda as "Generic- SD/MMC". It seems it's a built-in card reader of my ThinkPad. I decided to follow comment #9 above to filter out that device from LVM. And, advice from comment #9 fixed the issue! Thanks a lot Zer00Cool!

What I did exactly is:

1. grep for "global_filter" in lvm.conf - that file is really long...

```
$ grep -Fn "global_filter" /etc/lvm/lvm.conf
142: # Configuration option devices/global_filter.
146: # Use global_filter to hide devices from these LVM system components.
148: # global_filter are not opened by LVM.
150: # global_filter = [ "a|.*/|" ]
```

2. After the commented out "global_filter" setting (line 150 in my case), I added the following:

```
global_filter = [ "r|/dev/sda|" ]
```

Gordon (linux-web-expert) wrote :

Confirmed from comment #11 by mbdev

Adding a global_filter to line 151 just after the default section corrected the problem.

Before adding the filter to /etc/lvm/lvm.conf I was getting this:

```
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
Found linux image: /boot/vmlinuz-5.3.0-46-lowlatency
```

After adding the comment, it seems to be corrected:

```
$ sudo update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.3.0-46-lowlatency
Found initrd image: /boot/initrd.img-5.3.0-46-lowlatency
Found linux image: /boot/vmlinuz-5.3.0-45-lowlatency
Found initrd image: /boot/initrd.img-5.3.0-45-lowlatency
Found linux image: /boot/vmlinuz-5.3.0-42-lowlatency
Found initrd image: /boot/initrd.img-5.3.0-42-lowlatency
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
```

Wondering if there is any way to detect removable media not connected which was the source of my issue since my internal drives are NVMe and do not use SDx, those were USB keys as I recall.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers