]> granicus.if.org Git - zfs/commitdiff
initramfs: Set elevator=noop on the rpool's disks
authorRichard Laager <rlaager@wiktel.com>
Thu, 2 Nov 2017 02:54:56 +0000 (21:54 -0500)
committerRichard Laager <rlaager@wiktel.com>
Thu, 2 Nov 2017 02:54:56 +0000 (21:54 -0500)
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 <rlaager@wiktel.com>
contrib/initramfs/scripts/zfs

index f63a67792b4ae79ceeae2897b1b744c193c82eb3..500ae3fc8796a777a976e85ab3786323c7a9b010 100644 (file)
@@ -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