From 4767c7a14e3b5f242746755d33d69edf81c6194f Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Wed, 1 Nov 2017 21:53:22 -0500 Subject: [PATCH 1/3] initramfs: Fix inconsistent whitespace This fixes one instance of inconsistent whitespace. Signed-off-by: Richard Laager --- contrib/initramfs/scripts/zfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/initramfs/scripts/zfs b/contrib/initramfs/scripts/zfs index 4650c96465..e01a9dd2a9 100644 --- a/contrib/initramfs/scripts/zfs +++ b/contrib/initramfs/scripts/zfs @@ -150,7 +150,7 @@ get_pools() fi fi - # Filter out any exceptions... + # Filter out any exceptions... if [ -n "$ZFS_POOL_EXCEPTIONS" ] then local found="" From 11b9dcfb2d30a8d05a424bb2a9a6d26ef39aabbb Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Wed, 1 Nov 2017 21:54:28 -0500 Subject: [PATCH 2/3] initramfs: Fix a spelling error This fixes a typo in a comment. Signed-off-by: Richard Laager --- contrib/initramfs/scripts/zfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/initramfs/scripts/zfs b/contrib/initramfs/scripts/zfs index e01a9dd2a9..f63a67792b 100644 --- a/contrib/initramfs/scripts/zfs +++ b/contrib/initramfs/scripts/zfs @@ -925,7 +925,7 @@ mountroot() # NOTE: Mounted in the order specified in the # ZFS_INITRD_ADDITIONAL_DATASETS variable so take care! - # Go through the complete list (recursivly) of all filesystems below + # Go through the complete list (recursively) of all filesystems below # the real root dataset filesystems=$("${ZFS}" list -oname -tfilesystem -H -r "${ZFS_BOOTFS}") for fs in $filesystems $ZFS_INITRD_ADDITIONAL_DATASETS From 4fc411f7a3ecee8a70fc8d6c687fae9a1cf20b31 Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Wed, 1 Nov 2017 21:54:56 -0500 Subject: [PATCH 3/3] initramfs: Set elevator=noop on the rpool's disks ZFS already sets elevator=noop for wholedisk vdevs (for all pools), but typical root-on-ZFS installations use partitions. This sets elevator=noop on the disks in the root pool. Ubuntu 16.04 and 16.10 had this. It was lost in 17.04 due to Debian switching to this upstream initramfs script. Signed-off-by: Richard Laager --- contrib/initramfs/scripts/zfs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/contrib/initramfs/scripts/zfs b/contrib/initramfs/scripts/zfs index f63a67792b..500ae3fc87 100644 --- a/contrib/initramfs/scripts/zfs +++ b/contrib/initramfs/scripts/zfs @@ -883,6 +883,24 @@ mountroot() /bin/sh fi + # Set elevator=noop on the root pool's vdevs' disks. ZFS already + # does this for wholedisk vdevs (for all pools), so this is only + # important for partitions. + "${ZPOOL}" status -L "${ZFS_RPOOL}" 2> /dev/null | + awk '/^\t / && !/(mirror|raidz)/ { + dev=$1; + sub(/[0-9]+$/, "", dev); + print dev + }' | + while read i + do + if [ -e "/sys/block/$i/queue/scheduler" ] + then + echo noop > "/sys/block/$i/queue/scheduler" + fi + done + + # ---------------------------------------------------------------- # P R E P A R E R O O T F I L E S Y S T E M