Skip to content

Commit 4fc411f

Browse files
committed
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]>
1 parent 11b9dcf commit 4fc411f

File tree

1 file changed

+18
-0
lines changed
  • contrib/initramfs/scripts

1 file changed

+18
-0
lines changed

contrib/initramfs/scripts/zfs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,24 @@ mountroot()
883883
/bin/sh
884884
fi
885885

886+
# Set elevator=noop on the root pool's vdevs' disks. ZFS already
887+
# does this for wholedisk vdevs (for all pools), so this is only
888+
# important for partitions.
889+
"${ZPOOL}" status -L "${ZFS_RPOOL}" 2> /dev/null |
890+
awk '/^\t / && !/(mirror|raidz)/ {
891+
dev=$1;
892+
sub(/[0-9]+$/, "", dev);
893+
print dev
894+
}' |
895+
while read i
896+
do
897+
if [ -e "/sys/block/$i/queue/scheduler" ]
898+
then
899+
echo noop > "/sys/block/$i/queue/scheduler"
900+
fi
901+
done
902+
903+
886904
# ----------------------------------------------------------------
887905
# P R E P A R E R O O T F I L E S Y S T E M
888906

0 commit comments

Comments
 (0)