hd-idle / hdparmを使用してnoatimeとドライブのアイドル時間を設定した後、起動時にzfsプールを使用することはできません。

hd-idle / hdparmを使用してnoatimeとドライブのアイドル時間を設定した後、起動時にzfsプールを使用することはできません。

まず、次のようにRHEL7-x64zfsドライブを休止状態にしました。これこれこれ。私はhd-idleそれが問題が始まったときに最初に試みたと信じています。

私はそれをidle_drives_enable処理するスクリプトを書いた@rebootcrontab -e (この方法を使用する現在の状態からhdparm最近の努力へ)

#!/bin/bash

# idle_drives_enable
# Sets idle times to drives, usually needed at boot

# Default idle time covers all drives, including zfs drives, unless otherwise specified
DEFAULT_IDLE_TIME=120;

# Root drive we want to increase a bit, so specify separately
ROOT_IDLE_TIME=360;

#------------------------------------------------------------------
# Using hd-idle
# @dependency sudo yum install hd-idle
#
## 120 seconds is 10 minutes, 360 is 30 minutes
## Set default idle time on all.
#/sbin/hd-idle -i $DEFAULT_IDLE_TIME;

## Set root drive idle time longer, incase doing work, dont want to continually be waking it up

## sdb is current root, but sometimes changes
##/sbin/hd-idle -a /dev/sdb

## Use uuid instead because it never changes.  Specifying the root partition is enough to trigger the whole drive.
#/sbin/hd-idle -a /dev/disk/by-uuid/bbc69fc6-12fa-499a-a0c6-e0f65e248ce2 -i $ROOT_IDLE_TIME;

#echo "/usr/local/bin/idle_drives_enable complete! Default idle time of $DEFAULT_IDLE_TIME seconds was set. Additionally, the root drive is set to idle after $ROOT_IDLE_TIME seconds.";


#------------------------------------------------------------------------
# hd-idle is not allowing wake, are these considered scsi??
# testing with hdparm instead

echo "executing /usr/local/bin/idle_drives_enable..."
echo "using hdparm"
echo "Here is the output of the current hdparm -C"
/sbin/hdparm -C /dev/sd?

echo "setting idle times now..."
/sbin/hdparm -q -S  $DEFAULT_IDLE_TIME -y /dev/sd?

echo "done settting idle times. to default idle time ($DEFAULT_IDLE_TIME seconds)."
echo "Here is the output of the current hdparm -C"
/sbin/hdparm -C /dev/sd?

echo "/usr/local/bin/idle_drives_enable complete!"

zfs小道具を設定し、atime=off
ブートドライブの小道具にも/&のみを/etc/fstab noatime含めるように設定しました。roothome xfsswap

これが唯一の変更です。

最初のテストを再開した後、zfsプールは使用できなくなり、続行されます。

後ろにテストの結果、hdparm同じ症状があることがわかりました(zfs起動時にはありません)。結局、起動時に正しくインポートされないことに気づきました。これにより、プールが正常に戻り、スリープモードがアイドル状態になり、プールにアクセスすると再び起きますzfs exportzfs importうまくいくこの時点で。 (少なくともそれを使用するときはhdparm)。使用しながらこのような考えはできませんでしたhd-idle

RaidZ2興味深いことに、6つのドライブアレイから特定のフォルダにアクセスすると、特定のドライブだけが目を覚ますことがわかりました。これはとても素敵なことです。

私は次の措置を講じて問題を解決しました。

  • zfsでatime属性をオンにしても問題は解決されず、終了しました。
  • 起動時にアイドル時間が設定されないように、クローン操作に注釈を付けました。

おそらくhd-idle最初に試してみると、うまくいかず、リセットする必要があるいくつかの残りの設定があるようです。

起動時に使用できなくなったzfsプールを見つけることができる場所についてのアイデアはありますか?

修正する 結局、ZFSの実装を台無しにしたようだ。このスクリプトはうまく機能します。他の人が自分のドライブを休止状態にしたい場合は、これが私がしたことです。

#!/bin/bash                                                                                                                                     

# idle_drives_enable
# Sets idle times to drives, usually needed at boot

# Default idle time covers all drives, including zfs drives, unless otherwise specified
DEFAULT_IDLE_TIME=120;

# Root drive we want to increase a bit, so specify separately 
ROOT_IDLE_TIME=360;


#ALLDRIVELIST=("a" "b" "c" "d" "e" "f" "g");
#for DRIVE in "${ALLDRIVELIST[@]}";
#do
#    #/sbin/hdparm -C /dev/sd$DRIVE 
#     
#done

#------------------------------------------------------------------
# Using hd-idle 
# @dependency sudo yum install hd-idle
#
## 120 seconds is 10 minutes, 360 is 30 minutes
## Set default idle time on all.  
#/sbin/hd-idle -i $DEFAULT_IDLE_TIME;

## Set root drive idle time longer, incase doing work, dont want to continually be waking it up

## sdb is current root, but sometimes changes
##/sbin/hd-idle -a /dev/sdb

## Use uuid instead because it never changes.  Specifying the root partition is enough to trigger the whole drive. 
#/sbin/hd-idle -a /dev/disk/by-uuid/bbc69fc6-12fa-499a-a0c6-e0f65e248ce2 -i $ROOT_IDLE_TIME;

#echo "/usr/local/bin/idle_drives_enable complete! Default idle time of $DEFAULT_IDLE_TIME seconds was set. Additionally, the root drive is set to idle after $ROOT_IDLE_TIME seconds.";


#------------------------------------------------------------------------
# hd-idle is not allowing wake, are these considered scsi??
# testing with hdparm instead

echo "executing /usr/local/bin/idle_drives_enable..."
echo "using hdparm"
echo "Here is the output of the current hdparm -C"
/sbin/hdparm -C /dev/sd?

echo "setting idle times now..."
/sbin/hdparm -q -S  $DEFAULT_IDLE_TIME -y /dev/sd?

echo "done settting idle times. to default idle time ($DEFAULT_IDLE_TIME seconds)."
echo "Here is the output of the current hdparm -C"
/sbin/hdparm -C /dev/sd?

echo "/usr/local/bin/idle_drives_enable complete!"

ベストアンサー1

おすすめ記事