Help locating corrupted file

matt11601

Dabbler
Joined
Jul 17, 2017
Messages
24
Hello,

I've been in the middle of upgrading hardware and got sidetracked with a warning for an unhealthy pool. This is a single disk pool that was replaced today with a Samsung SSD. The old Toshiba drive had numerous errors occur daily such as

* Device: /dev/ada0, 1240 Currently unreadable (pending) sectors.
* Device: /dev/ada0, 25 Offline uncorrectable sectors.
* Device: /dev/ada0, ATA error count increased from 70 to 75.

I used the replace function and resilvering went well. I shutdown the machine, removed the old Toshiba disk, physically moved the Samsung SSD from my PERC card to SATA (old location of Toshiba), then rebooted. The pool was still marked as unhealthy so I did some investigating.

Put of zpool status -v
root@Storage:~ # zpool status -v
pool: Torrents
state: ONLINE
status: One or more devices has experienced an error resulting in data
corruption. Applications may be affected.
action: Restore the file in question if possible. Otherwise restore the
entire pool from backup.
see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-8A
scan: scrub repaired 0B in 00:08:24 with 1 errors on Sun May 7 14:21:14 2023
config:

NAME STATE READ WRITE CKSUM
Torrents ONLINE 0 0 0
gptid/eed55ae5-ec8c-11ed-81da-000e04000680 ONLINE 0 0 0

errors: Permanent errors have been detected in the following files:

Torrents/iocage/jails/MediaDownloader/root@ioc_update_12.2-RELEASE-p15_2023-04-07_14-54-59:/media/downloads/tv/The.Diplomat.S01E04.1080p.AHDTV.x264-DARKFLiX[rarbg]/The.Diplomat.S01E04.1080p.AHDTV.x264-DARKFLiX.mkv.part

pool: freenas-boot
state: ONLINE
status: Some supported and requested features are not enabled on the pool.
The pool can still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
the pool may no longer be accessible by software that does not support
the features. See zpool-features(7) for details.
scan: scrub repaired 0B in 06:53:33 with 0 errors on Thu May 4 10:48:18 2023
config:

NAME STATE READ WRITE CKSUM
freenas-boot ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
da2p2 ONLINE 0 0 0
da1p2 ONLINE 0 0 0

errors: No known data errors

pool: library
state: ONLINE
status: Some supported and requested features are not enabled on the pool.
The pool can still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
the pool may no longer be accessible by software that does not support
the features. See zpool-features(7) for details.
scan: scrub repaired 0B in 05:13:46 with 0 errors on Sun May 7 05:13:46 2023
config:

NAME STATE READ WRITE CKSUM
library ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
gptid/ed3638ea-cb80-11ed-b328-000e04000680 ONLINE 0 0 0
gptid/e97dd530-db35-11ed-9d80-000e04000680 ONLINE 0 0 0

errors: No known data errors

pool: library2
state: ONLINE
status: Some supported and requested features are not enabled on the pool.
The pool can still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
the pool may no longer be accessible by software that does not support
the features. See zpool-features(7) for details.
scan: scrub in progress since Sun May 7 00:00:00 2023
6.16T scanned at 503M/s, 5.11T issued at 157M/s, 6.64T total
0B repaired, 76.95% done, 02:50:46 to go
config:

NAME STATE READ WRITE CKSUM
library2 ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
gptid/3769bd0c-27c1-11e9-a3fd-54bf6495d531 ONLINE 0 0 0
gptid/3912ab06-27c1-11e9-a3fd-54bf6495d531 ONLINE 0 0 0

errors: No known data errors
Output of lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers (rev 07)
00:01.0 PCI bridge: Intel Corporation 6th-10th Gen Core Processor PCIe Controller (x16) (rev 07)
00:02.0 VGA compatible controller: Intel Corporation HD Graphics P530 (rev 06)
00:14.0 USB controller: Intel Corporation 100 Series/C230 Series Chipset Family USB 3.0 xHCI Controller (rev 31)
00:14.2 Signal processing controller: Intel Corporation 100 Series/C230 Series Chipset Family Thermal Subsystem (rev 31)
00:16.0 Communication controller: Intel Corporation 100 Series/C230 Series Chipset Family MEI Controller #1 (rev 31)
00:16.3 Serial controller: Intel Corporation 100 Series/C230 Series Chipset Family KT Redirection (rev 31)
00:17.0 SATA controller: Intel Corporation Q170/Q150/B150/H170/H110/Z170/CM236 Chipset SATA Controller [AHCI Mode] (rev 31)
00:1c.0 PCI bridge: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #1 (rev f1)
00:1f.0 ISA bridge: Intel Corporation C236 Chipset LPC/eSPI Controller (rev 31)
00:1f.2 Memory controller: Intel Corporation 100 Series/C230 Series Chipset Family Power Management Controller (rev 31)
00:1f.4 SMBus: Intel Corporation 100 Series/C230 Series Chipset Family SMBus (rev 31)
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-LM (rev 31)
01:00.0 Serial Attached SCSI controller: Broadcom / LSI SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] (rev 03)
02:00.0 PCI bridge: Texas Instruments XIO2001 PCI Express-to-PCI Bridge
03:02.0 Ethernet controller: Intel Corporation 82541PI Gigabit Ethernet Controller (rev 05)

From the zpool status -v output, the corrupted file is "Torrents/iocage/jails/MediaDownloader/root@ioc_update_12.2-RELEASE-p15_2023-04-07_14-54-59:/media/downloads/tv/The.Diplomat.S01E04.1080p.AHDTV.x264-DARKFLiX[rarbg]/The.Diplomat.S01E04.1080p.AHDTV.x264-DARKFLiX.mkv.part" I have no idea how to locate this file. In the shell, I can get to "Torrents/iocage/jails/MediaDownloader/" but am stuck after that.

Does anyone have any advice on how to fix this? My assumption is deleting this file and scrubbing will fix the errors, but that may be incorrect on my part.

Hardware configuration is in the signature.

Thanks for any help you can offer.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
Any ZFS path, (not OS path), with a "@" is a snapshot. I am not sure WHY your snapshot has such a long, extended name. It is possibly not a snapshot. If you could supply the output of the following command in code tags, we can verify.

zfs list -t all -r Torrents


The only way to get rid of file(s) in snapshot(s), is to delete the entire snapshot;

zfs destroy Torrents/iocage/jails/MediaDownloader/root@ioc_update_12.2-RELEASE-p15_2023-04-07_14-54-59:/media/downloads/tv/The.Diplomat.S01E04.1080p.AHDTV.x264-DARKFLiX[rarbg]/The.Diplomat.S01E04.1080p.AHDTV.x264-DARKFLiX.mkv.part

This will also delete any held files in the snapshot that no longer exist in the parent dataset. But may be good files.

Note that it is possible that the broken file is also in the parent dataset. So deleting the snapshot might just be the first step.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
That's not the name of the snapshot... it's the snapshot and the path within it, separated by a colon...

zfs destroy Torrents/iocage/jails/MediaDownloader/root@ioc_update_12.2-RELEASE-p15_2023-04-07_14-54-59

should suffice.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
That's not the name of the snapshot... it's the snapshot and the path within it, separated by a colon...

zfs destroy Torrents/iocage/jails/MediaDownloader/root@ioc_update_12.2-RELEASE-p15_2023-04-07_14-54-59

should suffice.
Ahh, that makes sense.
 

matt11601

Dabbler
Joined
Jul 17, 2017
Messages
24
Thank you @Arwen and @sretalla for your help.

I deleted the snapshot, scrubbed the pool (from GUI), and rebooted. I re-ran
Code:
vpool status -v
but still see the error and the pool is still marked as unhealthy. Is there anything more I should do?
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
Can you list the actual output of zpool status -v Torrents ?

It is possible you need to run zpool clear Torrents then re-run scrub.
 

matt11601

Dabbler
Joined
Jul 17, 2017
Messages
24
Can you list the actual output of zpool status -v Torrents ?

It is possible you need to run zpool clear Torrents then re-run scrub.

Yep, here you go
Code:
root@Storage:~ # zpool status -v Torrents                                                                                                                      pool: Torrents
 state: ONLINE
status: One or more devices has experienced an error resulting in data
        corruption.  Applications may be affected.
action: Restore the file in question if possible.  Otherwise restore the
        entire pool from backup.
   see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-8A
  scan: scrub repaired 0B in 00:09:08 with 1 errors on Mon May  8 11:11:31 2023
config:

        NAME                                          STATE     READ WRITE CKSUM
        Torrents                                      ONLINE       0     0     0
          gptid/eed55ae5-ec8c-11ed-81da-000e04000680  ONLINE       0     0     0

errors: Permanent errors have been detected in the following files:

        Torrents/iocage/jails/MediaDownloader/root@ioc_update_13.0-RELEASE-p13_2023-04-07_16-21-51:/media/downloads/tv/The.Diplomat.S01E04.1080p.AHDTV.x264-DARKFLiX[rarbg]/The.Diplomat.S01E04.1080p.AHDTV.x264-DARKFLiX.mkv
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
Looks like you have yet another corrupt file. But, I would clear the errors and re-run the scrub. If the error is still there, then get rid of that snapshot too. Then repeat clearing and scrubbing.

Not sure why it did not report this problem sooner. But, it is possible your single disk pool is starting to fail. Thus, more errors could be in store for you.

Try posting the output of smartctl -a /dev/ada0 against that disk. Perhaps we can see if the disk is truly failing.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
That's in a different snapshot...
Torrents/iocage/jails/MediaDownloader/root@ioc_update_13.0-RELEASE-p13_2023-04-07_16-21-51

I think it's time to start worrying about why you're getting corruption in multiple locations in your pool...

That's a single-disk pool, is your disk doing OK? smartctl -a /dev/daX (replace daX with the actual disk identifier from that pool)
 

matt11601

Dabbler
Joined
Jul 17, 2017
Messages
24
The disk is brand new Samsung SSD so I would hope it's not faulty, but certainly possible. I replaced a dying Toshiba disk. Is it fair to assume that the corrupted data got resilvered when I replaced the Toshiba disk with this Samsung SSD?

Here's the output of that command
root@Storage:~ # smartctl -a /dev/ada3
smartctl 7.2 2021-09-14 r5236 [FreeBSD 13.1-RELEASE-p7 amd64] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family: Samsung based SSDs
Device Model: Samsung SSD 870 EVO 1TB
Serial Number: S75BNS0W312770B
LU WWN Device Id: 5 002538 f33321ce1
Firmware Version: SVT03B6Q
User Capacity: 1,000,204,886,016 bytes [1.00 TB]
Sector Size: 512 bytes logical/physical
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
TRIM Command: Available, deterministic, zeroed
Device is: In smartctl database [for details use: -P show]
ATA Version is: ACS-4 T13/BSR INCITS 529 revision 5
SATA Version is: SATA 3.3, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Tue May 9 20:08:15 2023 EDT
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: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 0) seconds.
Offline data collection
capabilities: (0x53) SMART execute Offline immediate.
Auto Offline data collection on/off supp ort.
Suspend Offline collection upon new
command.
No 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.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 85) minutes.
SCT capabilities: (0x003d) SCT Status supported.
SCT Error Recovery Control supported.
SCT Feature Control supported.
SCT Data Table supported.

SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_ FAILED RAW_VALUE
5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always - 0
9 Power_On_Hours 0x0032 099 099 000 Old_age Always - 74
12 Power_Cycle_Count 0x0032 099 099 000 Old_age Always - 8
177 Wear_Leveling_Count 0x0013 100 100 000 Pre-fail Always - 0
179 Used_Rsvd_Blk_Cnt_Tot 0x0013 100 100 010 Pre-fail Always - 0
181 Program_Fail_Cnt_Total 0x0032 100 100 010 Old_age Always - 0
182 Erase_Fail_Count_Total 0x0032 100 100 010 Old_age Always - 0
183 Runtime_Bad_Block 0x0013 100 100 010 Pre-fail Always - 0
187 Uncorrectable_Error_Cnt 0x0032 100 100 000 Old_age Always - 0
190 Airflow_Temperature_Cel 0x0032 072 056 000 Old_age Always - 28
195 ECC_Error_Rate 0x001a 200 200 000 Old_age Always - 0
199 CRC_Error_Count 0x003e 100 100 000 Old_age Always - 0
235 POR_Recovery_Count 0x0012 099 099 000 Old_age Always - 3
241 Total_LBAs_Written 0x0032 099 099 000 Old_age Always - 738142228
252 Unknown_Attribute 0x0032 100 100 000 Old_age Always - 0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged. [To run self-tests, use: smartctl -t]

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
256 0 65535 Read_scanning was never started
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.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
so that drive hasn't logged a self test.

You might want to launch one:
smartctl -t long /dev/ada3

Then run with -a after some hours to check the results.
 
Joined
Jun 15, 2022
Messages
674
A faulty cable or connection (data or power or both) can also cause issues. We generally aren't as careful with cables as we should be, expect they were manufactured perfectly and withstand being treated poorly.

Dirty Power can be another issue. I just had a Chinese fan dirty up the power line so much the PSU shut down if the fan was the only thing in the line (a Noctua didn't have that issue). I paid less and got less, it just wasn't evident in normal use though showed up under the rigorous testing I now do for new systems.
 

matt11601

Dabbler
Joined
Jul 17, 2017
Messages
24
Thank you all for your continued help. Here are the results of smartctl -a /dev/ada3
Code:
root@Storage:~ # smartctl -a /dev/ada3
smartctl 7.2 2021-09-14 r5236 [FreeBSD 13.1-RELEASE-p7 amd64] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Samsung based SSDs
Device Model:     Samsung SSD 870 EVO 1TB
Serial Number:    S75BNS0W312770B
LU WWN Device Id: 5 002538 f33321ce1
Firmware Version: SVT03B6Q
User Capacity:    1,000,204,886,016 bytes [1.00 TB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device
Form Factor:      2.5 inches
TRIM Command:     Available, deterministic, zeroed
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-4 T13/BSR INCITS 529 revision 5
SATA Version is:  SATA 3.3, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Fri May 12 11:43:09 2023 EDT
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:  (0x00) Offline data collection activity
                                        was never started.
                                        Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever
                                        been run.
Total time to complete Offline
data collection:                (    0) seconds.
Offline data collection
capabilities:                    (0x53) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        No 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.
                                        General Purpose Logging supported.
Short self-test routine
recommended polling time:        (   2) minutes.
Extended self-test routine
recommended polling time:        (  85) minutes.
SCT capabilities:              (0x003d) SCT Status supported.
                                        SCT Error Recovery Control supported.
                                        SCT Feature Control supported.
                                        SCT Data Table supported.

SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0033   100   100   010    Pre-fail  Always       -       0
  9 Power_On_Hours          0x0032   099   099   000    Old_age   Always       -       138
 12 Power_Cycle_Count       0x0032   099   099   000    Old_age   Always       -       10
177 Wear_Leveling_Count     0x0013   100   100   000    Pre-fail  Always       -       0
179 Used_Rsvd_Blk_Cnt_Tot   0x0013   100   100   010    Pre-fail  Always       -       0
181 Program_Fail_Cnt_Total  0x0032   100   100   010    Old_age   Always       -       0
182 Erase_Fail_Count_Total  0x0032   100   100   010    Old_age   Always       -       0
183 Runtime_Bad_Block       0x0013   100   100   010    Pre-fail  Always       -       0
187 Uncorrectable_Error_Cnt 0x0032   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0032   070   056   000    Old_age   Always       -       30
195 ECC_Error_Rate          0x001a   200   200   000    Old_age   Always       -       0
199 CRC_Error_Count         0x003e   100   100   000    Old_age   Always       -       0
235 POR_Recovery_Count      0x0012   099   099   000    Old_age   Always       -       4
241 Total_LBAs_Written      0x0032   099   099   000    Old_age   Always       -       929024484
252 Unknown_Attribute       0x0032   100   100   000    Old_age   Always       -       0

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  Extended offline    Completed without error       00%       126         -

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
  256        0    65535  Read_scanning was never started
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.


@WI_Hedgehog Your comment was very helpful and just reminded me of something. I was going through my list of upgrades and realized I haven't upgraded my PSU yet. I still have the stock PSU which is 290W which, embarrassingly, I thought I upgraded prior to installing the new drives.

Based on this, I am going to upgrade the PSU ASAP because I suspect interpreting all these tests will be confusing until this major issue is addressed.
 
Joined
Jun 15, 2022
Messages
674
@matt11601 : Awesome.

If it helps, I bought a UNI-T UT210e Mini DC Clamp Meter to see current draw, and should probably also buy a scope to watch for dirty power--that can happen when drawing over 85% PSU rated capacity as the torroidal filters saturate in some mid-grade and lower power supplies. In any PSU old capacitors dry out and lose filter capacity....
 
Top