working on it ...

Filters

Explore Public Snippets

Sort by

Found 11 snippets matching: hdparm

    public by maholtz  1767  0  6  0

    Festplatten Geschwindigkeit unter Linux lesen

    sudo hdparm -T /dev/sda
    
    # Ergebnis bei meiner SSD Platte im normalen Betrieb
    
    /dev/sda:
     Timing cached reads:   1594 MB in  2.00 seconds = 796.73 MB/sec
    

    external by Pavel Roskin  68  0  1  0

    Make a list of ranges for hdparm --trim-sector-ranges-stdin

    Make a list of ranges for hdparm --trim-sector-ranges-stdin: hdtrimlist
    #! /bin/sh
    
    # Make a list of ranges for hdparm --trim-sector-ranges-stdin
    # Use this only if blkdiscard is not available or not suitable.
    #
    # Example:
    # 'sfdisk -uS -l /dev/sdb' shows /dev/sdb3 starts at sector 5000 and has
    # 1000 sectors. To trim all sectors on /dev/sdb3, run
    # hdtrimlist 1000 5000 | \
    # hdparm --trim-sector-ranges-stdin --please-destroy-my-drive /dev/sdb
    #
    # Please be extremely careful with this utility!
    
    # Maximal number of sectors in a range, adjust if needed
    : ${MAXSECT=65535}
    
    test $# = 2 || { echo "Usage: hdtrimlist sectors offset" >&2; exit 1; }
    
    sectors=$1
    pos=$2
    while test $sectors -gt 0; do
    	if test $sectors -gt $MAXSECT; then
    		size=$MAXSECT
    	else
    		size=$sectors
    	fi
    	echo $pos:$size
    	sectors=$(($sectors-$size))
    	pos=$(($pos+$size))
    done
    
    
    

    external by Jean Baptiste Favre  11  0  1  0

    hdparm -I Macbook Pro

    hdparm -I Macbook Pro: gistfile1.txt
    # hdparm -I /dev/sda
    
    /dev/sda:
    
    ATA device, with non-removable media
    	Model Number:       APPLE SSD SM0512F                       
    	Serial Number:      S1K5NYAG225885      
    	Firmware Revision:  UXM2JA1Q
    	Transport:          Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
    Standards:
    	Used: unknown (minor revision code 0x0039) 
    	Supported: 8 7 6 5 
    	Likely used: 8
    Configuration:
    	Logical		max	current
    	cylinders	16383	16383
    	heads		16	16
    	sectors/track	63	63
    	--
    	CHS current addressable sectors:   16514064
    	LBA    user addressable sectors:  268435455
    	LBA48  user addressable sectors:  977105060
    	Logical  Sector size:                   512 bytes
    	Physical Sector size:                  4096 bytes
    	Logical Sector-0 offset:                  0 bytes
    	device size with M = 1024*1024:      477102 MBytes
    	device size with M = 1000*1000:      500277 MBytes (500 GB)
    	cache/buffer size  = unknown
    	Nominal Media Rotation Rate: Solid State Device
    Capabilities:
    	LBA, IORDY(can be disabled)
    	Queue depth: 32
    	Standby timer values: spec'd by Standard, no device specific minimum
    	R/W multiple sector transfer: Max = 16	Current = 16
    	Recommended acoustic management value: 128, current value: 0
    	DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 
    	     Cycle time: min=120ns recommended=120ns
    	PIO: pio0 pio1 pio2 pio3 pio4 
    	     Cycle time: no flow control=120ns  IORDY flow control=120ns
    Commands/features:
    	Enabled	Supported:
    	   *	SMART feature set
    	    	Security Mode feature set
    	   *	Power Management feature set
    	   *	Write cache
    	   *	Look-ahead
    	   *	Host Protected Area feature set
    	   *	WRITE_BUFFER command
    	   *	READ_BUFFER command
    	   *	NOP cmd
    	   *	DOWNLOAD_MICROCODE
    	   *	SET_MAX security extension
    	    	Automatic Acoustic Management feature set
    	   *	48-bit Address feature set
    	   *	Device Configuration Overlay feature set
    	   *	Mandatory FLUSH_CACHE
    	   *	FLUSH_CACHE_EXT
    	   *	SMART error logging
    	   *	SMART self-test
    	   *	General Purpose Logging feature set
    	   *	WRITE_{DMA|MULTIPLE}_FUA_EXT
    	   *	64-bit World wide name
    	   *	{READ,WRITE}_DMA_EXT_GPL commands
    	   *	Segmented DOWNLOAD_MICROCODE
    	   *	Gen1 signaling speed (1.5Gb/s)
    	   *	Gen2 signaling speed (3.0Gb/s)
    	   *	Gen3 signaling speed (6.0Gb/s)
    	   *	Native Command Queueing (NCQ)
    	   *	Phy event counters
    	    	DMA Setup Auto-Activate optimization
    	   *	Software settings preservation
    	   *	SET MAX SETPASSWORD/UNLOCK DMA commands
    	   *	WRITE BUFFER DMA command
    	   *	READ BUFFER DMA command
    	   *	Data Set Management TRIM supported (limit 8 blocks)
    Security: 
    	Master password revision code = 65534
    		supported
    	not	enabled
    	not	locked
    		frozen
    	not	expired: security count
    		supported: enhanced erase
    	6min for SECURITY ERASE UNIT. 32min for ENHANCED SECURITY ERASE UNIT. 
    Logical Unit WWN Device Identifier: 5002538655584d30
    	NAA		: 5
    	IEEE OUI	: 002538
    	Unique ID	: 655584d30
    Integrity word not set (found 0x597b, expected 0x100a5)
    
    

    external by thirotan  349  0  3  0

    server command log hdparm

    server command log hdparm: server command log hdparm
    $ df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/sda1             16T  1.4T   15T   9%  /
    tmpfs                  16G     0   16G   0% /dev/shm
    
    $ hdparm -Tt /dev/sda1
    
    /dev/sda1:
     Timing cached reads:   15778 MB in  2.00 seconds = 7899.66 MB/sec
     Timing buffered disk reads:  3232 MB in  3.00 seconds = 1076.88 MB/sec
    
    

    external by ansemjo  259  0  3  0

    script periodically polls drivestates with hdparm to show when drives go to sleep

    script periodically polls drivestates with hdparm to show when drives go to sleep: drivesleep
    #!/bin/bash
    
    # script to see when a drive goes to sleep / wakes up
    
    is_num() { [ "$1" != "" ] && [[ $1 =~ ^[0-9]+$ ]] || { echo "'$1' is not a valid number."; exit 10; }; }
    is_disk() { hdparm -i "$1" &>/dev/null || { echo "'$1' is not a valid drive for hdparm."; exit 11; }; }
    
    timestamp() {
        if [ "$starttime_epoch" == "" ]; then
            starttime_epoch="$(date +%s)"
        else
            sec_since_start="$((($(date +%s)-$starttime_epoch)))"
            clock_since_start="$(date -ud "@$sec_since_start" "+%Hh %Mm %Ss")"
            echo -n "+ $clock_since_start"
        fi
    } 
    
    get_drive_state() {
        case $(hdparm -C "$1" 2>&1 | grep "drive state" | sed 's/ drive state is:[[:space:]]*//') in
            "active/idle" ) echo -n "|$pad" ;;
            "standby" )     echo -n ".$pad" ;;
            * ) echo -n "?$pad" ;;
        esac
    }
    
    #########
    
    # help
        if [ "$1" == "" ]; then
            echo -e "$0 <cycle> <disks>\n <cycle> is the time in seconds between updates\n <disks> is a space-seperated list of disks to poll"
            exit 99
        fi
    
    # get args
        is_num "$1" && cycle="$1"
        shift; disks="$@";
        if [ "$disks" != "" ]; then
            command -v hdparm &>/dev/null || { echo "no access to 'hdparm'. try running as superuser?"; exit 13; }
            for dsk in $disks; do is_disk $dsk; done
        else echo "no disks given!"; exit 12; fi
    
    # echo debug
        echo "## cycle = $cycle seconds"
        echo "## disks = $disks"
        echo
    
    # header
        margin="$(printf "%40s")"
        pad="  "
        echo "  | = active  . = standby  ? = error"
        
        disknum=0;
        for dsk in $disks; do
            echo -n "$margin"
            ((disknum++)); tmppos=1
            while [ $tmppos -lt $disknum ]; do
                echo -n "|$pad"; ((tmppos++)); done
            echo "/--- $dsk"
        done
        echo -n "$margin"; tmppos=1
        while [ $tmppos -le $disknum ]; do
            echo -n "V$pad"; ((tmppos++)); done
        echo -ne "\n"
    
    # get state
        timestamp
        while true; do
            
            echo -n "$(date "+%F %T")  ($(timestamp))    "
    
            for disk in $disks; do get_drive_state $disk; done
            
            echo
            sleep $cycle
        done
    
    
    

    external by Aleksander Nitecki  238  0  3  0

    The best of man hdparm

    The best of man hdparm: its-dangerous-to-use-hdparm-alone.txt
    # man hdparm | grep -i dangerous, eyeballed to extract whole phrases:
    
    EXTREMELY DANGEROUS
    VERY  DANGEROUS, DON'T EVEN THINK ABOUT USING IT.
    VERY DANGEROUS
    EXTREMELY DANGEROUS
    EXCEPTIONALLY DANGEROUS. DO NOT USE THIS OPTION!!
    DANGEROUS, DATA LOSS IS EXTREMELY LIKELY
    VERY DANGEROUS.
    VERY DANGEROUS.
    EXCEPTIONALLY DANGEROUS. DO NOT USE THIS OPTION!!
    EXCEPTIONALLY DANGEROUS. DO NOT USE THIS OPTION!!
    (DANGEROUS).  Do NOT use this option.
    VERY DANGEROUS.
    These switches are DANGEROUS to experiment with, and might not work with some kernels.  USE AT YOUR OWN RISK.
    (DANGEROUS).
    (DANGEROUS).
    (DANGEROUS).
    
    

    external by Burak Sezer  4  0  1  0

    hdparm crash

    hdparm crash: gistfile1.txt
    [Sat May 23 05:26:28 2015] INFO: task hdparm:19888 blocked for more than 120 seconds.
    [Sat May 23 05:26:28 2015] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    [Sat May 23 05:26:28 2015] hdparm          D 0000000000000002     0 19888  19887 0x00000000
    [Sat May 23 05:26:28 2015]  ffff880040529cb8 0000000000000086 0000000000000000 000000000000000e
    [Sat May 23 05:26:28 2015]  ffff880040529fd8 ffff880040529fd8 ffff880040529fd8 00000000000137c0
    [Sat May 23 05:26:28 2015]  ffff880400de2e00 ffff8800c13fae00 ffff880040529ce8 7fffffffffffffff
    [Sat May 23 05:26:28 2015] Call Trace:
    [Sat May 23 05:26:28 2015]  [<ffffffff81658f2f>] schedule+0x3f/0x60
    [Sat May 23 05:26:28 2015]  [<ffffffff81659575>] schedule_timeout+0x2a5/0x320
    [Sat May 23 05:26:28 2015]  [<ffffffff81090c05>] ? sched_clock_local+0x25/0x90
    [Sat May 23 05:26:28 2015]  [<ffffffff81030888>] ? native_smp_send_reschedule+0x48/0x60
    [Sat May 23 05:26:28 2015]  [<ffffffff81052882>] ? ttwu_queue+0x92/0xd0
    [Sat May 23 05:26:28 2015]  [<ffffffff81658d6f>] wait_for_common+0xdf/0x180
    [Sat May 23 05:26:28 2015]  [<ffffffff811a6aa0>] ? __sync_filesystem+0x90/0x90
    [Sat May 23 05:26:28 2015]  [<ffffffff8105f680>] ? try_to_wake_up+0x200/0x200
    [Sat May 23 05:26:28 2015]  [<ffffffff811a6aa0>] ? __sync_filesystem+0x90/0x90
    [Sat May 23 05:26:28 2015]  [<ffffffff81658eed>] wait_for_completion+0x1d/0x20
    [Sat May 23 05:26:28 2015]  [<ffffffff8119f78d>] writeback_inodes_sb_nr+0x7d/0xa0
    [Sat May 23 05:26:28 2015]  [<ffffffff8119f9fe>] writeback_inodes_sb+0x2e/0x40
    [Sat May 23 05:26:28 2015]  [<ffffffff811a6a5e>] __sync_filesystem+0x4e/0x90
    [Sat May 23 05:26:28 2015]  [<ffffffff811a6abf>] sync_one_sb+0x1f/0x30
    [Sat May 23 05:26:28 2015]  [<ffffffff8117b4f5>] iterate_supers+0xa5/0x100
    [Sat May 23 05:26:28 2015]  [<ffffffff811a6b70>] sys_sync+0x30/0x70
    [Sat May 23 05:26:28 2015]  [<ffffffff81663442>] system_call_fastpath+0x16/0x1b
    [Sat May 23 05:28:28 2015] INFO: task hdparm:19888 blocked for more than 120 seconds.
    [Sat May 23 05:28:28 2015] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    [Sat May 23 05:28:28 2015] hdparm          D 0000000000000002     0 19888  19887 0x00000000
    [Sat May 23 05:28:28 2015]  ffff880040529cb8 0000000000000086 0000000000000000 000000000000000e
    [Sat May 23 05:28:28 2015]  ffff880040529fd8 ffff880040529fd8 ffff880040529fd8 00000000000137c0
    [Sat May 23 05:28:28 2015]  ffff880400de2e00 ffff8800c13fae00 ffff880040529ce8 7fffffffffffffff
    [Sat May 23 05:28:28 2015] Call Trace:
    [Sat May 23 05:28:28 2015]  [<ffffffff81658f2f>] schedule+0x3f/0x60
    [Sat May 23 05:28:28 2015]  [<ffffffff81659575>] schedule_timeout+0x2a5/0x320
    [Sat May 23 05:28:28 2015]  [<ffffffff81090c05>] ? sched_clock_local+0x25/0x90
    [Sat May 23 05:28:28 2015]  [<ffffffff81030888>] ? native_smp_send_reschedule+0x48/0x60
    [Sat May 23 05:28:28 2015]  [<ffffffff81052882>] ? ttwu_queue+0x92/0xd0
    [Sat May 23 05:28:28 2015]  [<ffffffff81658d6f>] wait_for_common+0xdf/0x180
    [Sat May 23 05:28:28 2015]  [<ffffffff811a6aa0>] ? __sync_filesystem+0x90/0x90
    [Sat May 23 05:28:28 2015]  [<ffffffff8105f680>] ? try_to_wake_up+0x200/0x200
    [Sat May 23 05:28:28 2015]  [<ffffffff811a6aa0>] ? __sync_filesystem+0x90/0x90
    [Sat May 23 05:28:28 2015]  [<ffffffff81658eed>] wait_for_completion+0x1d/0x20
    [Sat May 23 05:28:28 2015]  [<ffffffff8119f78d>] writeback_inodes_sb_nr+0x7d/0xa0
    [Sat May 23 05:28:28 2015]  [<ffffffff8119f9fe>] writeback_inodes_sb+0x2e/0x40
    [Sat May 23 05:28:28 2015]  [<ffffffff811a6a5e>] __sync_filesystem+0x4e/0x90
    [Sat May 23 05:28:28 2015]  [<ffffffff811a6abf>] sync_one_sb+0x1f/0x30
    [Sat May 23 05:28:28 2015]  [<ffffffff8117b4f5>] iterate_supers+0xa5/0x100
    [Sat May 23 05:28:28 2015]  [<ffffffff811a6b70>] sys_sync+0x30/0x70
    [Sat May 23 05:28:28 2015]  [<ffffffff81663442>] system_call_fastpath+0x16/0x1b
    [Sat May 23 05:30:28 2015] INFO: task hdparm:19888 blocked for more than 120 seconds.
    [Sat May 23 05:30:28 2015] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    [Sat May 23 05:30:28 2015] hdparm          D 0000000000000002     0 19888  19887 0x00000000
    [Sat May 23 05:30:28 2015]  ffff880040529cb8 0000000000000086 0000000000000000 000000000000000e
    [Sat May 23 05:30:28 2015]  ffff880040529fd8 ffff880040529fd8 ffff880040529fd8 00000000000137c0
    [Sat May 23 05:30:28 2015]  ffff880400de2e00 ffff8800c13fae00 ffff880040529ce8 7fffffffffffffff
    [Sat May 23 05:30:28 2015] Call Trace:
    [Sat May 23 05:30:28 2015]  [<ffffffff81658f2f>] schedule+0x3f/0x60
    [Sat May 23 05:30:28 2015]  [<ffffffff81659575>] schedule_timeout+0x2a5/0x320
    [Sat May 23 05:30:28 2015]  [<ffffffff81090c05>] ? sched_clock_local+0x25/0x90
    [Sat May 23 05:30:28 2015]  [<ffffffff81030888>] ? native_smp_send_reschedule+0x48/0x60
    [Sat May 23 05:30:28 2015]  [<ffffffff81052882>] ? ttwu_queue+0x92/0xd0
    [Sat May 23 05:30:28 2015]  [<ffffffff81658d6f>] wait_for_common+0xdf/0x180
    [Sat May 23 05:30:28 2015]  [<ffffffff811a6aa0>] ? __sync_filesystem+0x90/0x90
    [Sat May 23 05:30:28 2015]  [<ffffffff8105f680>] ? try_to_wake_up+0x200/0x200
    [Sat May 23 05:30:28 2015]  [<ffffffff811a6aa0>] ? __sync_filesystem+0x90/0x90
    [Sat May 23 05:30:28 2015]  [<ffffffff81658eed>] wait_for_completion+0x1d/0x20
    [Sat May 23 05:30:28 2015]  [<ffffffff8119f78d>] writeback_inodes_sb_nr+0x7d/0xa0
    [Sat May 23 05:30:28 2015]  [<ffffffff8119f9fe>] writeback_inodes_sb+0x2e/0x40
    [Sat May 23 05:30:28 2015]  [<ffffffff811a6a5e>] __sync_filesystem+0x4e/0x90
    [Sat May 23 05:30:28 2015]  [<ffffffff811a6abf>] sync_one_sb+0x1f/0x30
    [Sat May 23 05:30:28 2015]  [<ffffffff8117b4f5>] iterate_supers+0xa5/0x100
    [Sat May 23 05:30:28 2015]  [<ffffffff811a6b70>] sys_sync+0x30/0x70
    [Sat May 23 05:30:28 2015]  [<ffffffff81663442>] system_call_fastpath+0x16/0x1b
    [Sat May 23 06:39:12 2015] 3w-9xxx: scsi6: AEN: INFO (0x04:0x002B): Verify completed:unit=0.
    
    
    

    external by Josh Enders  7  0  1  0

    /etc/default/hdparm

    /etc/default/hdparm: hdparm
    # To set the same options for a block of harddisks, do so with something
    # like the following example options:
    # harddisks="/dev/hda /dev/hdb"
    # hdparm_opts="-d1 -X66"
    # This is run before the configuration in hdparm.conf.  Do not use
    # this arrangement if you need modules loaded for your hard disks,
    # or need udev to create the nodes, or have some other local quirk
    # These are better addressed with the options in /etc/hdparm.conf
    #
    
    # 2014-12-14 -- generate this list with:
    # \ls -1 /dev/disk/by-id/scsi-SATA_ST3000DM001-* | grep -v part
    
    harddisks="$(ls -1 /dev/disk/by-id/scsi-SATA_ST3000DM001-* | grep -v part)"
    
    # 2014-07-18 - Disable power saving features that cause obnoxious chirping noise
    hdparm_opts="-B 255"
    
    # By default, hdparm will refuse to set harddisk options on any drive
    # if the system has software RAID running, and one or more disk arrays
    # are in the process of resynchronisation.
    # With this variable set to 'yes', /etc/init.d/hdparm will suspend the
    # RAID resynchronisation process before setting harddisk options, and
    # will resume it after setting is done.
    RAID_WORKAROUND=no
    
    

    external by arundnair  7  0  1  0

    Script for checking disk performance using smartctl, dd and hdparm. Requires CentOS installed :)

    Script for checking disk performance using smartctl, dd and hdparm. Requires CentOS installed :): diskcheck.sh
    #!/bin/bash
    
    #Date 20/10/2017 , Version 1.0.1
    #Authors : Arun D, Nikhil Sasi
    #Requirements : CentOS installed
    #Note : Not coded for checking Hardware RAID arrays
    
    #Things to do : Log file generation
    
    echo -n "SMARTCTL test selection, Enter [short/long]: "
    read tytest
    sleep 2
    
    #SCRIPT STARTS
    
    echo "========================================================="
    
    #To check if logged in user is root
    
    #LOGFILE=/diskchecklog.txt
    
    if [ $(id -u) -ne 0 ]; then
        echo "Run this script as a Root user only" >&2
        exit 1
    else    
        echo "Root user logged in"
    fi
    
    echo "========================================================="
    
    #Check if smartmontools is installed
    
    rpm -q smartmontools
    exit_status=$?
    if [ $exit_status -gt 0 ];then
            echo "Installing Smartmontools"
            yum -y install smartmontools
    else
            echo "SmartMontools already installed."
    fi
    
    echo "========================================================="
    
    #SMARTCTL Checks
    
    echo "Initiating SmartCtl check"
    
    for i in `lsblk | grep -i disk | awk '{print $1}'`
    do
        echo "======/dev/$i========="
        smartctl -a /dev/$i|grep -E -A 1 'Device Model'
        echo " "
        echo "Terminating any checks started earlier"
        smartctl -X /dev/$i | grep -A 1 "Abort SMART"
        echo " "
        if [ "$tytest" == "short" ];then
            echo "Initiating short test"
            smartctl -t short /dev/$i | grep "minutes" | echo "Test for /dev/$i will be completed in `awk '{print $3}'` minutes";
            else
            echo "Initiating long test"
            smartctl -t long /dev/$i | grep "minutes" | echo "Test for /dev/$i will be completed in `awk '{print $3}'` minutes";
        fi
    done
    
    echo "========================================================="
    
    echo " DISK check Status"
    
    echo "------------------"
    
    ## smarttest completion status
    
    disk_status=100
    while [ $disk_status -gt 0 ]
    do
            for i in `lsblk | grep -i disk | awk '{print $1}'`
            do
                    while [ `smartctl -c /dev/$i |grep "Self-test execution status:"| awk '{print $5}'|sed 's/.$//'` -ge 0 ]
                            do
                            if [ `smartctl -c /dev/$i |grep "Self-test execution status:"| awk '{print $5}'|sed 's/.$//'` -eq 0 ];then
                                    echo "Smartctl test completed for /dev/$i"
                                    disk_status=0
                                    break;
                            fi
                            if [ `smartctl -c /dev/$i |grep "Self-test execution status:"| awk '{print $5}'|sed 's/.$//'` -gt 0 ];then
                                    echo "`smartctl -a /dev/$i|grep  -A 1 'Self-test execution status:' | awk 'FNR==2{print $1}'` remaining for /dev/$i"
                                    disk_status=100
                                    break;
                             fi
                    done
            done
    sleep 5;
    done
    
    ## Printing smart results to LOG FILE --> not done
    
    echo "Smart Test results"
    for i in `lsblk | grep -i disk | awk '{print $1}'`
            do  
                smartctl -a /dev/$i
            done
            
    echo "========================================================="
    
    # HDPARM check for disk READ Speeds
    
    echo " HDPARM checks for DISK READ SPEED"
    for i in `lsblk | grep -i disk | awk '{print $1}'`
            do
                echo "Cached Disk test for /dev/$i"
                hdparm -Tt /dev/$i | grep ' disk reads'| awk '{printf "%7s %7s\n",$11,$12}'
                echo "Direct Disk test for /dev/$i"
                hdparm --direct -Tt /dev/$i | grep ' disk reads'| awk '{printf "%7s %7s\n",$11,$12}'
            done
    
    echo "========================================================="
    
    
    #DD command for disk read speed check
    
    echo " DD check for DISK WRITE SPEED"
    
    for i in `lsblk | grep -i disk | awk '{print $1}'`
            do  
                if [ "`df -h | grep "/boot" | awk '{print $1}' | awk -F "/" '{print $3}' | sed -e 's/.$//'`" == "$i" ]; then
                    echo "OS INSTALLED DISK /dev/$i"
                    echo "Test with no parameter"
                    dd if=/dev/zero of=/tmp/test.img bs=1M count=1024 |& awk 'FNR==3{printf "%4s %3s\n",$8,$9}'
                    echo "Test with Direct parameter"
                    dd if=/dev/zero of=/tmp/test.img bs=1M count=1024 oflag=direct |& awk 'FNR==3{printf "%4s %3s\n",$8,$9}'
                    echo "Test with dsync parameter"
                    dd if=/dev/zero of=/tmp/test.img bs=1M count=1024 oflag=dsync |& awk 'FNR==3{printf "%4s %3s\n",$8,$9}'
                    echo "Test with big size file with direct parameter"
                    dd if=/dev/zero of=/tmp/test.img bs=1G count=3 oflag=direct |& awk 'FNR==3{printf "%4s %3s\n",$8,$9}'
                else
                    echo " Additional Disk /dev/$i"
                    echo "Test with no parameter"
                    dd if=/dev/zero of=/dev/$i bs=1M count=1024 |& awk 'FNR==3{printf "%4s %3s\n",$8,$9}'
                    echo "Test with Direct parameter"
                    dd if=/dev/zero of=/dev/$i bs=1M count=1024 oflag=direct |& awk 'FNR==3{printf "%4s %3s\n",$8,$9}'
                    echo "Test with dsync parameter"
                    dd if=/dev/zero of=/dev/$i bs=1M count=1024 oflag=dsync |& awk 'FNR==3{printf "%4s %3s\n",$8,$9}'
                    echo "Test with big size file with direct parameter"
                    dd if=/dev/zero of=/dev/$i bs=1G count=3 oflag=direct |& awk 'FNR==3{printf "%4s %3s\n",$8,$9}'
                fi
            done
    
    echo "========================================================="
            
    echo "DISK TESTS COMPLETE, Please see the $LOGFILE for the logs"
    
    

    external by p-blomberg  229  0  3  0

    Western Digital, go f*ck yourselves

    Western Digital, go f*ck yourselves: hdparm.conf
    Go
    # hdparm.conf is missing a whole f*cking lot of options that
    #   hdparm has, so command_line is REALLY important.
    #
    # And of course, ubuntu has decided that command_line is bad, so I guess
    #   everything will be crap very soon.
    #
    #   -- Sanfred 2014-07-01
    
    # What I would like to do, but it isn't working ("Unknown option queue_depth"):
    #/dev/disk/by-id/scsi-SATA_WDC_WD30EFRX-68_WD-WMC1T2208312 {
    #       queue_depth = 1
    #}
    #/dev/disk/by-id/scsi-SATA_WDC_WD30EFRX-68_WD-WMC1T3203213 {
    #       queue_depth = 1
    #}
    #/dev/disk/by-id/scsi-SATA_WDC_WD30EFRX-68_WD-WMC4N2060368 {
    #       queue_depth = 1
    #}
    
    # WD RED has a very broken implementation of NCQ that hangs the SATA bus 
    #   all the time. -Q 1 kills NCQ.
    command_line {
            hdparm -Q 1 /dev/disk/by-id/scsi-SATA_WDC_WD30EFRX-68_WD-WMC1T3203213
    }
    command_line { 
            hdparm -Q 1 /dev/disk/by-id/scsi-SATA_WDC_WD30EFRX-68_WD-WMC1T2208312
    }
    command_line { 
            hdparm -Q 1 /dev/disk/by-id/scsi-SATA_WDC_WD30EFRX-68_WD-WMC4N2060368
    }
    # More info about this problem:
    # http://www.axelog.de/2010/05/9-sata-phyrdychg-exception/
    # https://bugzilla.redhat.com/show_bug.cgi?id=404851
    # https://bugzilla.kernel.org/show_bug.cgi?id=8627
    
    
    
    • Public Snippets
    • Channels Snippets