Hi,
I am getting SMART warnings about bad sectors on one of my drives.
The drive is one of four in a RAID 5 array.
I know the sector number of the drive that is faulty.
Is there any simple way (program, command line tool, etc) that can tell me the name of the file that occupies that sector? Ideally I want to enter the sector number and the software tells me the file name that lives there.
I think it's not simple to accomplish manually from the command line because there is a layer of abstraction between the drive and the file system that is created by the RAID.
Thanks.
Which file occupies a given sector of a drive that's part of a RAID array?
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
-
- Level 4
- Posts: 250
- Joined: Sat Apr 04, 2015 8:55 pm
Which file occupies a given sector of a drive that's part of a RAID array?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Which file occupies a given sector of a drive that's part of a RAID array?
as far as I'm aware, there is no program, as such, that could state what Data is at any given location on a HDD.
I've done something like that, in the distant past, where an program could interpret the Data in Hex format,
and display that in byte by byte information of the screen, but I've not seen anything similar in recent years.
I've done something like that, in the distant past, where an program could interpret the Data in Hex format,
and display that in byte by byte information of the screen, but I've not seen anything similar in recent years.
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
- catweazel
- Level 19
- Posts: 9763
- Joined: Fri Oct 12, 2012 9:44 pm
- Location: Australian Antarctic Territory
Re: Which file occupies a given sector of a drive that's part of a RAID array?
Identify damaged files.flyingrhino wrote: ⤴Tue Apr 03, 2018 10:07 pm Is there any simple way (program, command line tool, etc) that can tell me the name of the file that occupies that sector?
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
-
- Level 4
- Posts: 250
- Joined: Sat Apr 04, 2015 8:55 pm
Re: Which file occupies a given sector of a drive that's part of a RAID array?
Thanks guys for the quick answers.
However, now I have a different problem - LM removed the defective device from the array. In 'disks' program I see state = Array is degraded - 1 disk is missing. It wasn't the case earlier - all 4 disks were there but one was giving SMART errors.
Anyway, I try debugfs and it gives this error:
Any idea where the bad magic number comes from? Is it because the disk is no longer part of the array and the block tables don't make sense any more?
Here's the output from SMART short test:
Right now I am copying the data from the array to a bunch of smaller drives I have. No data loss which is good
It will probably take a day at USB3 speed, but that's ok.
At least when this is done I can try to recover the RAID with no fear of losing data if I screw up...
That's exactly what I was looking for.Identify damaged files.
However, now I have a different problem - LM removed the defective device from the array. In 'disks' program I see state = Array is degraded - 1 disk is missing. It wasn't the case earlier - all 4 disks were there but one was giving SMART errors.
Anyway, I try debugfs and it gives this error:
Code: Select all
pc 2018-04-04 16:06:06 ~/ # debugfs /dev/sdf
debugfs 1.42.9 (4-Feb-2014)
/dev/sdf: Bad magic number in super-block while opening filesystem
debugfs:
Here's the output from SMART short test:
Code: Select all
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.16.0-38-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: WDC WD40EZRZ-00WN9B0
Serial Number: WD-WCC4E7LH3442
LU WWN Device Id: 5 0014ee 20cd52c9f
Firmware Version: 80.00A80
User Capacity: 4,000,787,030,016 bytes [4.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-2 (minor revision not indicated)
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Wed Apr 4 16:00:32 2018 NZST
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: (55080) seconds.
Offline data collection
capabilities: (0x7b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
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.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 551) minutes.
Conveyance self-test routine
recommended polling time: ( 5) minutes.
SCT capabilities: (0x7035) SCT Status supported.
SCT Feature Control supported.
SCT Data Table supported.
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 181 177 021 Pre-fail Always - 7950
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 213
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 099 099 000 Old_age Always - 797
10 Spin_Retry_Count 0x0032 100 100 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 100 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 213
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 0
193 Load_Cycle_Count 0x0032 199 199 000 Old_age Always - 3393
194 Temperature_Celsius 0x0022 115 110 000 Old_age Always - 37
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 2
198 Offline_Uncorrectable 0x0030 200 200 000 Old_age Offline - 2
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 2
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed: read failure 90% 797 2561854352
# 2 Short offline Completed: read failure 90% 780 2561854352
# 3 Extended offline Completed: read failure 90% 780 2561854352
# 4 Short offline Completed: read failure 90% 780 2561854352
# 5 Extended offline Completed: read failure 90% 779 2561854352
# 6 Extended offline Completed: read failure 90% 779 2561854352
# 7 Short offline Completed: read failure 90% 779 2561854352
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.
It will probably take a day at USB3 speed, but that's ok.
At least when this is done I can try to recover the RAID with no fear of losing data if I screw up...