Copy broken files rsynk failed verification

I have a ZFS that broke at 1.8TB. I created a .img file using ddrescue and recovered 99.47% of the data with 879 errors, whatever that means. Is it outside the 99%?

Anyway, there are a lot of MKV and AVI files. I have mounted the .img file, and I can browse and play the MKV and AVI files. However, I cannot copy some of them. Rsync says, ‘failed verification — update discarded (will try again).’ FastCopy says, ‘ReadFile (The request could not be performed because of an I/O device error. 1117).’

The files work and play fine, so why can’t I copy them? Does anyone know a better way to copy? I am using Ubuntu Server with mdadm, samba.

@cube10025
So are you using ZFS for your pool and mdadm ? Coupled with samba services?

When the data (MKV & AVI files) was on the storage array I’m not sure for your post if you had them in a ZFS Pool or a mdadm raid array.

  1. is the ZFS pool still in place ? if it was used.
  2. is mdadm on the system with ZFS ( as the two don’t like or work well with each other)
  3. IF it was a system with ZFS and mdadm running was it on the ZFS pool or the mdadm.

I’m trying to understand what you mean by that.
As ZFS can be setup multiple ways as on the boot services or in the way I prefer which is to just handle data. Thus the system isn’t using ZFS to boot. greatly simplifying the system.

A little bit more detail would be helpful, in order to assist you
Did you set the pool up with redundancy? Z1/2/3
Did the pool fault ?
Or just become unavailable
Is the pool still in place or did you destroy it?
IF you installed with any level of redundancy and you have a spare Hard drive you could replace the failing /faulting drive.
You might not have faulting drive some time if something interrupts ZFS when error checking it will fault the drive. One can issue a command to clear the pool to validate it.

If you have mdadm installed in a different RAID configuration with ZFS on the same system. I would highly advise you to figure out if you wish to keep mdadm or ZFS and get rid of one of the one you don’t wish to keep and then purge it from the system. Of course that is after data recovery.
If the pool is still in place run

sudo zpool history <insert poolname here if only 1 pool can be blank>

post the information that will give a history of creation etc of the zpool. And answer a good bit if what I asked above.
as well as:

sudo zfs list
sudo zpool status
1 Like

That makes 2 of us. :smiley:
Along with @sgt-mike request please also show this Please.

sudo zpool import

No Pools just the command shown.

Most of the time Reconnecting the removed/Broken device can fix this error immediately; yes, it is that simple.

@cube10025

@1fallen is absolutely correct.
Which one of ways to recover the pool which 1Fallen is pointing out. Which once the pool is fully recovered you will be able to rsnyc your data.

Unless the data resides in a mdadm array which will not be a ZFS issue.

Sorry, I mistyped. The hard drive is 1.8 TB in size. The original hard drive was used in TrueNAS, so the file system is ZFS. I used ddrescue to create an .img file.
This file is mounted on a RAID.
My problem is that some files are corrupted. I cannot copy them, but I can play them in VLC.

Solved it using

#!/bin/bash

source_dir="/Data/Secshare/USB-SAFE"
destination_dir="/mnt/psafe"

# Create the destination directory if it doesn't exist
mkdir -p "$destination_dir"

# Iterate over all files in the source directory
find "$source_dir" -type f | while read -r source_file; do
    # Generate the corresponding destination file
    dest_file="$destination_dir${source_file#$source_dir}"
    
    # Create the destination directory if it doesn't exist
    mkdir -p "$(dirname "$dest_file")"
    
    # Check if the file already exists
    if [ -f "$dest_file" ]; then
        echo "File already exists: $dest_file, skipping..."
    else
        echo "Copying $source_file to $dest_file ..."
        dd if="$source_file" of="$dest_file" bs=1M conv=noerror,sync
    fi
done
1 Like

@cube10025
Please mark as solved then if your satisfied as it seems to be resolved.

On the corrupt data if you wish to keep the mdadm array I would just recopy a clean copy of the files from your backup source over the corrupted files within the mdadm array.

1 Like