On 01/11/2012 04:26 PM, Chuck Payne wrote:
On Wed, Jan 11, 2012 at 5:21 PM, Basil Chupin <blchupin@iinet.net.au> wrote:
On 12/01/12 05:17, Istvan Gabor wrote:
Hello:
How can I identify a hard disk drive which is labeled in dmesg output as ata1.00 or ata1? How can I tell which one this is from the installed drives? Is there a linux command that can help? The best would be to track down to /dev/disks/by-id/xxx drive, because that info contains brand and serial number.
<snip> The numbering starts from '0' so in dmesg the above is your second Hard Drive (the first one would be ata0).
Why are you looking in dmesg BTW? Is it because you are getting poor transfer rates from your HDs (that is, they are configured as being connected using 40-wire cables)?
BC
<snip> Take a look at /boot/grub/device.map.
I think what you want to do is use 'smartctl'. All one line: ( IFS=$'\n'; farray=( $(sudo dmesg | grep "\[sd.\] A") ); for ((i=0;i<${#farray[@]};i++)); do echo -e "\n${farray[$i]}"; tmp="${farray[$i]}"; tmp=${tmp##*[}; disk=${tmp%]*}; sudo smartctl -i /dev/$disk; done ) Example: 19:15 nirvana:/home/samba/household/ideapad/apps> ( IFS=$'\n'; farray=( $(sudo dmesg | grep "\[sd.\] A") ); for ((i=0;i<${#farray[@]};i++)); do echo -e "\n${farray[$i]}"; tmp="${farray[$i]}"; tmp=${tmp##*[}; disk=${tmp%]*}; sudo smartctl -i /dev/$disk; done ) [ 2.295811] sd 0:0:0:0: [sda] Attached SCSI disk smartctl 5.42 2011-10-20 r3458 [x86_64-linux-3.1.7-1-ARCH] (local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net === START OF INFORMATION SECTION === Model Family: Western Digital Caviar Black Device Model: WDC WD1002FAEX-00Z3A0 Serial Number: WD-WCATR7025233 LU WWN Device Id: 5 0014ee 25b1bb832 Firmware Version: 05.01D05 User Capacity: 1,000,204,886,016 bytes [1.00 TB] Sector Size: 512 bytes logical/physical Device is: In smartctl database [for details use: -P show] ATA Version is: 8 ATA Standard is: Exact ATA specification draft version not indicated Local Time is: Wed Jan 11 19:15:31 2012 CST SMART support is: Available - device has SMART capability. SMART support is: Enabled [ 2.306364] sd 2:0:0:0: [sdc] Attached SCSI disk smartctl 5.42 2011-10-20 r3458 [x86_64-linux-3.1.7-1-ARCH] (local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net === START OF INFORMATION SECTION === Model Family: Seagate Barracuda 7200.12 Device Model: ST3750528AS Serial Number: 9VP156VR LU WWN Device Id: 5 000c50 0155a52b6 Firmware Version: CC35 User Capacity: 750,156,374,016 bytes [750 GB] Sector Size: 512 bytes logical/physical Device is: In smartctl database [for details use: -P show] ATA Version is: 8 ATA Standard is: ATA-8-ACS revision 4 Local Time is: Wed Jan 11 19:15:31 2012 CST SMART support is: Available - device has SMART capability. SMART support is: Enabled [ 2.324134] sd 1:0:0:0: [sdb] Attached SCSI disk smartctl 5.42 2011-10-20 r3458 [x86_64-linux-3.1.7-1-ARCH] (local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net === START OF INFORMATION SECTION === Model Family: Western Digital Caviar Black Device Model: WDC WD1002FAEX-00Z3A0 Serial Number: WD-WCATR7031234 LU WWN Device Id: 5 0014ee 205c68614 Firmware Version: 05.01D05 User Capacity: 1,000,204,886,016 bytes [1.00 TB] Sector Size: 512 bytes logical/physical Device is: In smartctl database [for details use: -P show] ATA Version is: 8 ATA Standard is: Exact ATA specification draft version not indicated Local Time is: Wed Jan 11 19:15:31 2012 CST SMART support is: Available - device has SMART capability. SMART support is: Enabled -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org