#310713 - 30/05/2008 18:51
Hijack v490 and hdparm-8.6+
|
mlord
carpal tunnel
Registered: 29/08/2000
Posts: 9841
Loc: Canada
|
Hijack v490 is now released.
New in this version, is support for the SG_IO ioctl() call for use with SAT Passthru commands. This means that the empeg kernel now supports nearly all of the functionality of modern versions of hdparm.
In conjunction with the v490 release, I am attaching here a pre-built binary of hdparm-8.6+, with all functions enabled. This is a pre-release snapshot of the upcoming hdparm-8.7 code.
Nearly all hdparm functions should now work with Hijack v490 or later, including the --make-bad-sector and --repair-sector flags (tested), as well as all of the security functions (untested), such as --security-erase (aka. "low-level format").
Enjoy
Attachments
hdparm.bin (47 downloads) Description: hdparm-8.6+ binary for the empeg.
|
|
Top
|
|
|
|
#310714 - 30/05/2008 18:59
Re: Hijack v490 and hdparm-8.6+
[Re: mlord]
|
mlord
carpal tunnel
Registered: 29/08/2000
Posts: 9841
Loc: Canada
|
As an example of "why you care", let's say that your player has been reporting a media error like this:
empeg:/empeg/bin# cat /dev/hda > /dev/null hda: read_intr: status=0x59 { DriveReady SeekComplete DataRequest Error } hda: read_intr: error=0x40 { UncorrectableError }, LBAsect=115459753, sector=115459753 end_request: I/O error, dev 03:00 (hda), sector 115459753 cat: /dev/hda: Input/output error
This bad sector can be fixed in-situ with this command:
hdparm --repair-sector 115459753 /dev/hda
---------------------------------------------------
Or perhaps you've used smartctl to check for problems, and seen a report such as this:
./smartctl.bin -l error /dev/hdc smartctl version 5.33 ... ... Error 0 occurred at disk power-on lifetime: 3887 hours (161 days + 23 hours) When the command that caused the error occurred, the device was in a vendor specific state.
After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 51 01 01 00 00 43 a1 Error: UNC, IDNF, AMNF at LBA = 0x01430000 = 21168128
Commands leading to the command that caused the error were ...
The "UNC, IDNF, AMNF at LBA = 0x01430000 = 21168128" line indicates a bad sector (UNCorrectable, ID Not Found, Address Mark Not Found) at 21168128. which can now be repaired with this quick command:
hdparm --repair-sector 21168128 /dev/hdc
Enjoy.
|
|
Top
|
|
|
|
#310721 - 30/05/2008 19:18
Re: Hijack v490 and hdparm-8.6+
[Re: mlord]
|
tfabris
carpal tunnel
Registered: 20/12/1999
Posts: 27576
Loc: Seattle, WA
|
Made of pure awesome.
FAQ entry on Smartctl has been updated to link this thread.
|
|
Top
|
|
|
|
#310722 - 30/05/2008 19:32
Re: Hijack v490 and hdparm-8.6+
[Re: mlord]
|
peter
carpal tunnel
Registered: 13/07/2000
Posts: 3349
Loc: Cambridge, England
|
Is there any way of finding out which file sector 115,459,753 belonged to, so that it can be deleted or re-transferred? Like ioctl(FIBMAP) but in reverse? I'm sure I've used one at some point, but can't remember what it was called or even whether it was actually on Linux or not...
Peter
|
|
Top
|
|
|
|
#310724 - 30/05/2008 19:36
Re: Hijack v490 and hdparm-8.6+
[Re: peter]
|
mlord
carpal tunnel
Registered: 29/08/2000
Posts: 9841
Loc: Canada
|
Is there any way of finding out which file sector 115,459,753 belonged to, so that it can be deleted or re-transferred? Like ioctl(FIBMAP) but in reverse? I'm sure I've used one at some point, but can't remember what it was called or even whether it was actually on Linux or not...
No, not yet.
hdparm-8.7 will have built-in FIBMAP support when it is released, but even then it will not do reverse lookups.
I may write a program to try doing that though, which could be useful on empegs (but not likely on regular Linux boxes, because it would simply take too long to find the file).
EDIT: heck, just a shell script wrapper around hdparm-8.7 could do it rather easily, though slowly.
There's no reverse mapping mechanism, so it's basically a matter of just doing FIBMAP on each inode in turn, and comparing, until a match is found. One of the uglier aspects of filesystem forensics on Linux today.
Cheers
Edited by mlord (30/05/2008 19:37)
|
|
Top
|
|
|
|
#310761 - 31/05/2008 14:19
Re: Hijack v490 and hdparm-8.6+
[Re: mlord]
|
Boelle
enthusiast
Registered: 22/11/2007
Posts: 260
Loc: Denmark, Odense
|
the output:
smartctl version 5.33 [arm-empeg-linux-gnu] Copyright (C) 2002-4 Bruce Allen Home page is http://smartmontools.sourceforge.net/
=== START OF INFORMATION SECTION === Device Model: ST9808211A Serial Number: 3LF3D3HA Firmware Version: 3.05 User Capacity: 80,026,361,856 bytes Device is: Not in smartctl database [for details use: -P showall] ATA Version is: 6 ATA Standard is: ATA/ATAPI-6 T13 1410D revision 2 Local Time is: Sat May 31 14:17:27 2008 /usr/local/armtools SMART support is: Available - device has SMART capability. SMART support is: Enabled
=== START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED
General SMART Values: Offline data collection status: (0x82) Offline data collection activity was completed without error. Auto Offline Data Collection: Enabled. Self-test execution status: ( 121) The previous self-test completed having the read element of the test failed. Total time to complete Offline data collection: ( 426) seconds. Offline data collection capabilities: (0x5b) SMART execute Offline immediate. Auto Offline data collection on/off supp ort. Suspend Offline collection upon new command. Offline surface scan supported. Self-test supported. No Conveyance Self-test supported. Selective Self-test supported. SMART capabilities: (0x0003) Saves SMART data before entering power-saving mode. Supports SMART auto save timer. Error logging capability: (0x01) Error logging supported. No General Purpose Logging support. Short self-test routine recommended polling time: ( 1) minutes. Extended self-test routine recommended polling time: ( 84) minutes.
SMART Attributes Data Structure revision number: 10 Vendor Specific SMART Attributes with Thresholds: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_ FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x0a0f 060 042 034 Pre-fail Always - 151238706 3 Spin_Up_Time 0x0003 095 094 000 Pre-fail Always - 0 4 Start_Stop_Count 0x0032 099 099 020 Old_age Always - 1421 5 Reallocated_Sector_Ct 0x0033 071 071 036 Pre-fail Always - 1195 7 Seek_Error_Rate 0x000f 079 060 030 Pre-fail Always - 94641337 9 Power_On_Hours 0x0032 096 096 000 Old_age Always - 3727 10 Spin_Retry_Count 0x0013 100 100 034 Pre-fail Always - 0 12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 635 192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 635 193 Load_Cycle_Count 0x0032 090 090 000 Old_age Always - 20269 194 Temperature_Celsius 0x0022 031 066 000 Old_age Always - 31 (Lifetime Min/Max 0/2) 195 Hardware_ECC_Recovered 0x001a 060 042 000 Old_age Always - 151238706 197 Current_Pending_Sector 0x0012 002 001 000 Old_age Always - 1918 198 Offline_Uncorrectable 0x0010 002 001 000 Old_age Offline - 1918 199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0 200 Multi_Zone_Error_Rate 0x0000 100 253 000 Old_age Offline - 0 202 TA_Increase_Count 0x0032 100 253 000 Old_age Always - 0
SMART Error Log Version: 1 Warning: ATA error count 0 inconsistent with error log pointer 4
ATA Error Count: 0 CR = Command Register [HEX] FR = Features Register [HEX] SC = Sector Count Register [HEX] SN = Sector Number Register [HEX] CL = Cylinder Low Register [HEX] CH = Cylinder High Register [HEX] DH = Device/Head Register [HEX] DC = Device Command Register [HEX] ER = Error register [HEX] ST = Status register [HEX] Powered_Up_Time is measured from power on, and printed as DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes, SS=sec, and sss=millisec. It "wraps" after 49.710 days.
Error 0 occurred at disk power-on lifetime: 3887 hours (161 days + 23 hours) When the command that caused the error occurred, the device was in a vendor sp ecific state.
After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 51 01 01 00 00 43 a1 Error: UNC, IDNF, AMNF at LBA = 0x01430000 = 21168128
Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- 40 20 fe f9 6f 00 00 f6 12d+10:16:25.350 READ VERIFY SECTOR(S) 00 20 fd f9 6f 00 00 f6 00:00:43.016 NOP [Reserved subcommand] 00 20 fb f9 6f 00 00 f6 00:00:40.968 NOP [Reserved subcommand] 00 20 f9 f9 6f 00 00 f6 00:00:38.920 NOP [Reserved subcommand] 00 20 f7 f9 6f 00 00 f6 00:00:36.872 NOP [Reserved subcommand]
Error -1 occurred at disk power-on lifetime: 34824 hours (1451 days + 0 hours) When the command that caused the error occurred, the device was in an unknown state.
After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 19 43 f7 51 01 00 00 Error:
Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- 00 19 f7 20 0a 76 0d 2f 00:14:28.352 NOP [Reserved subcommand] 00 18 f7 20 ce 74 0d ef 00:14:11.968 NOP [Reserved subcommand] 00 18 f7 20 97 74 0d af 00:14:11.968 NOP [Reserved subcommand] 00 18 f7 20 8e 74 0d 6f 00:14:11.968 NOP [Reserved subcommand] 00 18 f7 20 31 98 0d 2f 00:14:11.968 NOP [Reserved subcommand]
Error -2 occurred at disk power-on lifetime: 0 hours (0 days + 0 hours) When the command that caused the error occurred, the device was in a vendor sp ecific state.
After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- d0 00 6f 16 f7 51 01
Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- 76 cf 6f 16 f7 20 0a 02 22d+22:06:06.861 SEEK [RET-4] 74 cf 2f 16 f7 20 ce 02 22d+16:20:57.485 SEEK [RET-4] 74 cf ef 15 f7 20 97 02 22d+15:20:53.005 SEEK [RET-4] 74 cf af 15 f7 20 8e 02 22d+15:11:03.181 SEEK [RET-4] 74 cf 6f 15 f7 20 87 02 22d+15:03:24.429 SEEK [RET-4]
Error -3 occurred at disk power-on lifetime: 3721 hours (155 days + 1 hours) When the command that caused the error occurred, the device was active or idle .
After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 40 51 00 d0 ef 12 f7 Error: UNC at LBA = 0x0712efd0 = 118681552
Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- 20 00 02 cf ef 12 f7 00 6d+09:37:51.899 READ SECTOR(S) 20 00 02 cf af 12 f7 00 6d+09:37:51.888 READ SECTOR(S) 20 00 02 cf 6f 12 f7 00 6d+09:37:51.883 READ SECTOR(S) 20 00 02 cf 2f 12 f7 00 6d+09:37:51.879 READ SECTOR(S) 20 00 02 cf ef 11 f7 00 6d+09:37:51.873 READ SECTOR(S)
Error -4 occurred at disk power-on lifetime: 0 hours (0 days + 0 hours) When the command that caused the error occurred, the device was in an unknown state.
After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 00 00 00 43 a1 01 00
Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- d0 00 0d 00 00 40 00 8a 40d+09:21:05.071 [RESERVED] cf 00 0d 00 00 00 02 81 40d+04:43:38.927 [RESERVED] cf 00 0d 00 00 00 02 76 40d+04:43:38.863 [RESERVED] cf 00 0d 00 00 00 02 6f 40d+04:43:38.799 [RESERVED] cf ff 0c 00 00 00 02 1e 40d+04:43:38.735 [RESERVED]
SMART Self-test log structure revision number 1 Num Test_Description Status Remaining LifeTime(hours) LBA _of_first_error # 1 Extended offline Completed: read failure 90% 3726 101 617328 # 2 Short offline Completed: read failure 90% 3337 101 517771 # 3 Short offline Completed: read failure 90% 3337 101 517771 # 4 Short offline Interrupted (host reset) 90% 3337 - # 5 Short offline Completed: read failure 90% 3336 176 31400 # 6 Short offline Completed: read failure 90% 3106 101 458623
SMART Selective self-test log data structure revision number 1 SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS 1 0 0 Not_testing 2 0 0 Not_testing 3 0 0 Not_testing 4 0 0 Not_testing 5 0 0 Not_testing Selective self-test flags (0x0): After scanning selected spans, do NOT read-scan remainder of disk. If Selective self-test is pending on power-up, resume after 0 minute delay.
empeg:/tmp#
the "monkey" who learned to check a harddrive
|
|
Top
|
|
|
|
#310771 - 31/05/2008 16:11
Re: Hijack v490 and hdparm-8.6+
[Re: Boelle]
|
tman
carpal tunnel
Registered: 24/12/2001
Posts: 4312
Loc: UK
|
You need to tell it what drive you're running it on.
|
|
Top
|
|
|
|
#310838 - 02/06/2008 11:32
Re: Hijack v490 and hdparm-8.6+
[Re: Boelle]
|
tman
carpal tunnel
Registered: 24/12/2001
Posts: 4312
Loc: UK
|
Is there a particular reason why you keep persisting with this drive? Get it replaced...
|
|
Top
|
|
|
|
| |