Find corrupted files and mass delete them.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LoryKiller
    PCHF Member
    • Feb 2023
    • 16

    #1

    Find corrupted files and mass delete them.

    Hello, I’ve got and old HDD with lots of photos, videos and zip archives but most of them are corrupted. Is there any program to scan for corrupted files and automatically delete them?
    I’m 100% sure those corrupted files aren’t recoverable so please don’t tell me to download programs to do so.
    Thanks
  • Bruce
    PCHF Moderator
    • Oct 2017
    • 10697

    #2
    do a Quick Format on the drive to make all the space free for future use.
    or if you want to actually over-write the data, do a normal, low-level format, but be warned, it will take many, many, hours.
    (depending on the drive’s capacity)

    or, do you want to keep the non-corrupted files?

    Comment

    • LoryKiller
      PCHF Member
      • Feb 2023
      • 16

      #3
      Originally posted by Bruce
      do a Quick Format on the drive to make all the space free for future use.
      or if you want to actually over-write the data, do a normal, low-level format, but be warned, it will take many, many, hours.
      (depending on the drive’s capacity)

      or, do you want to keep the non-corrupted files?
      no, not every file is corrupted. I want to save the non-corrupted files and delete the corrupted ones. I can’t do it manually because there are more than 200 zip archives and over a thousand photos and videos.

      Comment

      • PeterOz
        PCHF Technical Response Team
        • Mar 2021
        • 4190

        #4
        Originally posted by LoryKiller
        but most of them are corrupted
        How do you know they are corrupted?
        Has the file extension changed ?

        Comment

        • LoryKiller
          PCHF Member
          • Feb 2023
          • 16

          #5
          If I try to open a corrupted zip file this appears: [ATTACH type=“full”]12249[/ATTACH]

          and if I try to open a corrupted photo this appears:

          [ATTACH type=“full”]12250[/ATTACH]

          Comment

          • Bruce
            PCHF Moderator
            • Oct 2017
            • 10697

            #6
            if you select all the files and try to copy them to another location, File Explorer should say something like “couldn’t copy, for whatever reason” and ask you to Try Again or Skip, and there should be an option to “remember my answer and don’t ask me again”.

            that way it’ll copy the good files only, then you can format that drive.

            if copy doesn’t produce the desirable outcome, try Move.

            and if File Explorer doesn’t help, try XYPlorer or TeraCopy.

            I know I’ve done something similar in the past, moving files off a dying drive, but don’t recall the actual method I used. but it was definitely one of the methods listed above! (y)

            Comment

            • LoryKiller
              PCHF Member
              • Feb 2023
              • 16

              #7
              Originally posted by Bruce
              if you select all the files and try to copy them to another location, File Explorer should say something like “couldn’t copy, for whatever reason” and ask you to Try Again or Skip, and there should be an option to “remember my answer and don’t ask me again”.

              that way it’ll copy the good files only, then you can format that drive.

              if copy doesn’t produce the desirable outcome, try Move.

              and if File Explorer doesn’t help, try XYPlorer or TeraCopy.

              I know I’ve done something similar in the past, moving files off a dying drive, but don’t recall the actual method I used. but it was definitely one of the methods listed above! (y)
              unfortunately I’m able to copy or move the zip archives without any problems but I can’t open them.
              I’ve found a solution in a linux forum where a script tries to unzip the archives in a temp folder and if it fails it automatically deletes the archive but I don’t have any idea on how to do it on windows.

              Comment

              • Rustys
                PCHF Member
                • Jul 2016
                • 7862

                #8
                Do you happen to know why the files are starting to show as corrupt?
                Originally posted by LoryKiller
                I’ve found a solution in a linux forum
                Check to see if that will work using the live version of Linux this way there is no install, and you can use it via USB drive.

                You could also see if Linux can open the files if so save them and then check if Windows can see them.

                Also make sure that script can unzip any zipped file. One that may be fine in Windows Linux may delete it if it cannot open it.

                Comment

                • LoryKiller
                  PCHF Member
                  • Feb 2023
                  • 16

                  #9
                  I managed, using my very limited python knowledge, to rewrite the script. It seems to work but I will not share it because of the bad readability and it is very buggy. The problem is not solved though. There are plenty of mp3, mp4, jpg and png files that are corrupted too and I haven’t found a solution yet.
                  Originally posted by Rustys
                  Do you happen to know why the files are starting to show as corrupt?
                  My son tried to recover some deleted files from an old HDD and most of them apparently were not fully recoverable,
                  Originally posted by Rustys
                  You could also see if Linux can open the files if so save them and then check if Windows can see them.
                  I tried it but no luck. I think because there are chunks of information that weren’t recoverable and made the files unreadable

                  Comment

                  • Rustys
                    PCHF Member
                    • Jul 2016
                    • 7862

                    #10
                    Originally posted by LoryKiller
                    My son tried to recover some deleted files from an old HDD and most of them apparently were not fully recoverable,
                    This should have been information in the first post.

                    Unfortunately, if data get written over then it is not fully recoverable.

                    Which is just another reason to back up personal data like that.
                    Originally posted by LoryKiller
                    There are plenty of mp3, mp4, jpg and png files that are corrupted too and I haven’t found a solution yet.
                    The only option maybe sending the drive to a data recovery service center which may cost several thousand dollars (USD).

                    The more you access the drive the after the files have been deleted that harder, they are recovered. If the drive was even defragged before the recovery, then they may be gone.

                    Comment

                    • LoryKiller
                      PCHF Member
                      • Feb 2023
                      • 16

                      #11
                      Originally posted by Rustys
                      The only option maybe sending the drive to a data recovery service center which may cost several thousand dollars (USD).
                      I don’t care trying to save those files, I just want to keep the non corrupted ones and delete the others just like I said in the main post:
                      Originally posted by LoryKiller
                      Is there any program to scan for corrupted files and automatically delete them?
                      I’m 100% sure those corrupted files aren’t recoverable so please don’t tell me to download programs to do so.

                      Comment

                      • Rustys
                        PCHF Member
                        • Jul 2016
                        • 7862

                        #12
                        Outside of opening them really no way unless you attempt the script.

                        Even still then would double check a few to make sure it is working correctly.

                        You might be able to tell by the dates and time the ones that were recovered. Depending on the how they were recovered it may have changed the date and time for the files to current.

                        Comment

                        • Bruce
                          PCHF Moderator
                          • Oct 2017
                          • 10697

                          #13
                          did you try TeraCopy.
                          I seem to recall it had a copy method that uses CRC checking, if so, that should detect corrupted files as the CRC value would highlight that.

                          Comment

                          • LoryKiller
                            PCHF Member
                            • Feb 2023
                            • 16

                            #14
                            Originally posted by Bruce
                            did you try TeraCopy.
                            I seem to recall it had a copy method that uses CRC checking, if so, that should detect corrupted files as the CRC value would highlight that.
                            Didn’t I also need the checksum of the files before their corruption to check if it matches?

                            Comment

                            • PeterOz
                              PCHF Technical Response Team
                              • Mar 2021
                              • 4190

                              #15
                              Originally posted by LoryKiller
                              I’ve found a solution in a linux forum where a script tries to unzip the archives in a temp folder and if it fails it automatically deletes the archive but I don’t have any idea on how to do it on windows.
                              The link would help
                              We might be able to re-write to fit windows

                              Comment

                              Working...