Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os-prober with many zvols/snapshots makes upgrades painful #62

Closed
pdf opened this issue Nov 28, 2012 · 6 comments
Closed

os-prober with many zvols/snapshots makes upgrades painful #62

pdf opened this issue Nov 28, 2012 · 6 comments

Comments

@pdf
Copy link
Contributor

pdf commented Nov 28, 2012

I store VMs on zvols, and use zfs-auto-snapshot to provde point-in-time rollback. As a result, I current have ~1400 /dev/zd* device nodes. The result is horrendous behaviour from os-prober at kernel/grub update, since it tries to mount them all.

My current hack-around is just to patch /usr/bin/os-prober ignore devs with major 230, but I'm open to more sensible options if anyone has any. I do think os-prober is going to need patching though...

@dajhorn
Copy link
Member

dajhorn commented Nov 30, 2012

There might be a way to avoid patching os-prober because this logic is in the /etc/grub.d/30_os-prober file:

OSPROBED="`os-prober | tr ' ' '^' | paste -s -d ' '`"
if [ -z "${OSPROBED}" ] ; then
  # empty os-prober output, nothing doing
  adjust_timeout
  exit 0
fi

Installing a dummy test to /usr/lib/os-prober that emits an empty result for zvols could short the os-probe test series.

@pdf
Copy link
Contributor Author

pdf commented Dec 8, 2012

Installing a dummy test to /usr/lib/os-prober that emits an empty result for zvols could short the os-probe test series.

Good call, here's what I'm using now (/usr/lib/os-probes/10zvol-test):

#!/bin/sh
# Sub-test to exclude ZVOLs
set -e
partition="$1"

. /usr/share/os-prober/common.sh

if [ "$(stat -L -c %t "$partition")" = "e6" ] ; then
        debug "$1 is a ZVOL; skipping"
        exit 0
fi

# No ZVOLs found
exit 1

dajhorn referenced this issue Dec 9, 2012
When `update-grub` is invoked, `os-prober` tries to mount each zvol
node, which is slow on systems with more than a few hundred volumes.

Add a device test for `os-prober` that returns early on zvols.

Closes: dajhorn/pkg-zfs#62
@dajhorn
Copy link
Member

dajhorn commented Dec 9, 2012

I added this test and credited you.

@dajhorn dajhorn closed this as completed Dec 9, 2012
@pdf
Copy link
Contributor Author

pdf commented Dec 9, 2012

Thanks Darik

@ghost ghost assigned dajhorn Dec 9, 2012
@pdf
Copy link
Contributor Author

pdf commented Dec 20, 2012

On small change required - this needs to be chmod'd +x

@dajhorn
Copy link
Member

dajhorn commented Dec 21, 2012

Thanks. I squeaked it into rc13.

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

No branches or pull requests

2 participants