Hesitancy to take advantage of old hardware to mount nodes

If I remember correctly it didn’t work with the WD Blue disks I bought. That’s why I had to find another solution.

1 Like

The cost of electricity in Spain is ~0.07627€/kWh but I have a contract that as long as it does not exceed 20% more than what they have stipulated I will not pay more, that is why I pay approximately €40-45 per month. I attach the screenshot of my consumption in the last few months.

1 Like

Blimey, I use almost as much in a day as you do in a month!
(Over the winter. Not as bad during the summer)

with one disk failure the whole node is gone. It’s better to run one node/one disk. Or you may go with RAID but with redundancy, RAID1, RAID5, RAID6, RAID10.

I do the same but with hdparm:

rm $logfile
devices=($(ls /dev/sd* | grep -E '/dev/sd[a-z]+$'))

# Check if the script is being run interactively or not
if [[ ! -t 1 ]]; then
    sleep 60  # Non-interactive, like cron
fi

# Log current date and time
echo -n "$(date '+%Y-%m-%d %R') " >> $logfile 2>&1

# Read current APM values
echo "Reading current APM values..." >> $logfile 2>&1
for device in "${devices[@]}"; do
    apm_value=$(/sbin/hdparm -B "$device" 2>&1)
    
    # Skip devices with 'not supported' or 'off' APM values
    if echo "$apm_value" | grep -q -e "not supported" -e "off"; then
        echo "$device: Skipping, APM not supported or off" >> $logfile 2>&1
        continue
    fi
    
    echo "$apm_value" >> $logfile 2>&1
done

# Turn APM off
echo "Turning APM off..." >> $logfile 2>&1
for device in "${devices[@]}"; do
    apm_value=$(/sbin/hdparm -B "$device" 2>&1)
    
    # Skip devices with 'not supported' or 'off' APM values
    if echo "$apm_value" | grep -q -e "not supported" -e "off"; then
        continue
    fi
    
    /sbin/hdparm -B 255 "$device" >> $logfile 2>&1
done

# Read APM values again
echo "Reading current APM values..." >> $logfile 2>&1
for device in "${devices[@]}"; do
    apm_value=$(/sbin/hdparm -B "$device" 2>&1)
    
    # Skip devices with 'not supported' or 'off' APM values
    if echo "$apm_value" | grep -q -e "not supported" -e "off"; then
        echo "$device: Skipping, APM not supported or off" >> $logfile 2>&1
        continue
    fi
    
    echo "$apm_value" >> $logfile 2>&1
done

# Change scheduler to bfq
echo "Changing I/O scheduler to bfq..." >> $logfile 2>&1
for device in "${devices[@]}"; do
    echo bfq | sudo tee /sys/block/$(basename "$device")/queue/scheduler >> $logfile 2>&1
done

# Read back the current scheduler
echo "Reading current I/O scheduler values..." >> $logfile 2>&1
for device in "${devices[@]}"; do
    current_scheduler=$(cat /sys/block/$(basename "$device")/queue/scheduler 2>&1)
    echo "$device: Current scheduler: $current_scheduler" >> $logfile 2>&1
done

This script turns off APM (power saving mode which parks the actuator aggressively), and also changes Linux I/O scheduler to bfq, which is HDD friendly. It does it to all /dev/sd* devices found.

1 Like