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

initramfs doesn't activate LVM volume groups before looking for zpools #102

Closed
jgoerzen opened this issue Jan 23, 2014 · 0 comments
Closed
Labels

Comments

@jgoerzen
Copy link

The situation here is an rpool atop an LVM volume group. The zfs-initramfs scripts do not properly activate LVM volume groups before probing for zpools.

The activate_vg() and udev_settle() functions in /usr/share/initramfs-tools/scripts/local-top/cryptroot are instructive. Over at http://wiki.complete.org/ConvertingToZFS#If_rpool_is_on_LVM:_initramfs_bug_workaround I have posted a workaround script people can add to local-top that will get a ZFS root pool atop LVM working. It begins with #!/bin/bash, but github seems to be mucking with that line.

PREREQ="mdadm mdrun multipath"

prereqs()
{
        echo "$PREREQ"
}

case $1 in
# get pre-requisites
prereqs)
        prereqs
        exit 0
        ;;
esac

# source for log_*_msg() functions, see LP: #272301
. /scripts/functions

#
# Helper functions
#
message()
{
        if [ -x /bin/plymouth ] && plymouth --ping; then
                plymouth message --text="$@"
        else
                echo "$@" >&2
        fi
        return 0
}

udev_settle()
{
        # Wait for udev to be ready, see https://launchpad.net/bugs/85640
        if [ -x /sbin/udevadm ]; then
                /sbin/udevadm settle --timeout=30
        elif [ -x /sbin/udevsettle ]; then
                /sbin/udevsettle --timeout=30
        fi
        return 0
}


activate_vg()
{
        # Sanity checks
        if [ ! -x /sbin/lvm ]; then
                message "jgoerzenactivatevg: lvm is not available"
                return 1
        fi

        # Detect and activate available volume groups
        /sbin/lvm vgscan
        /sbin/lvm vgchange -a y --sysinit
        return $?
}

udev_settle
activate_vg

exit 0
benalbrecht added a commit to benalbrecht/zfs that referenced this issue Nov 20, 2015
benalbrecht added a commit to benalbrecht/zfs that referenced this issue Dec 16, 2015
kernelOfTruth pushed a commit to kernelOfTruth/zfs that referenced this issue Dec 22, 2015
Original-patch-by: @jgoerzen
Signed-off-by: Benjamin Albrecht <git@albrecht.io>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes zfsonlinux/pkg-zfs#102
Closes openzfs#4029
ryao pushed a commit to ryao/zfs that referenced this issue Jan 4, 2016
Original-patch-by: @jgoerzen
Signed-off-by: Benjamin Albrecht <git@albrecht.io>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes zfsonlinux/pkg-zfs#102
Closes openzfs#4029
goulvenriou pushed a commit to Alyseo/zfs that referenced this issue Jan 17, 2016
Original-patch-by: @jgoerzen
Signed-off-by: Benjamin Albrecht <git@albrecht.io>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes zfsonlinux/pkg-zfs#102
Closes openzfs#4029
goulvenriou pushed a commit to Alyseo/zfs that referenced this issue Feb 4, 2016
Original-patch-by: @jgoerzen
Signed-off-by: Benjamin Albrecht <git@albrecht.io>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes zfsonlinux/pkg-zfs#102
Closes openzfs#4029
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants