summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorRichard Laager <[email protected]>2017-11-01 21:54:56 -0500
committerRichard Laager <[email protected]>2017-11-01 21:54:56 -0500
commit4fc411f7a3ecee8a70fc8d6c687fae9a1cf20b31 (patch)
treeb06e1da630d573bc06bc19d61db493ecd44d8ef3 /contrib
parent11b9dcfb2d30a8d05a424bb2a9a6d26ef39aabbb (diff)
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 <[email protected]>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/initramfs/scripts/zfs18
1 files changed, 18 insertions, 0 deletions
diff --git a/contrib/initramfs/scripts/zfs b/contrib/initramfs/scripts/zfs
index f63a67792..500ae3fc8 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