From 4fc411f7a3ecee8a70fc8d6c687fae9a1cf20b31 Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Wed, 1 Nov 2017 21:54:56 -0500 Subject: [PATCH] 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