ddrescue reset usb device on read timeout












0















I have a damaged external usb hdd. When i connect the device to the pc i can access the file system for round about a minute. After that period the disk keeps spinning but every io operation times out.



To rescue my data i want to use ddrescue but since the device stops working every minute, this won't recover much, when i don't reset the usb device each time a read timeout occurs, since the most probable reason for that is, that the device hang up again. Is there a way to let ddrescue execute a shell command or so, whenever a read timeout occurs?



It is not possible to connect the external hdd via sata, since there isn't a accessible sata connector inside.










share|improve this question



























    0















    I have a damaged external usb hdd. When i connect the device to the pc i can access the file system for round about a minute. After that period the disk keeps spinning but every io operation times out.



    To rescue my data i want to use ddrescue but since the device stops working every minute, this won't recover much, when i don't reset the usb device each time a read timeout occurs, since the most probable reason for that is, that the device hang up again. Is there a way to let ddrescue execute a shell command or so, whenever a read timeout occurs?



    It is not possible to connect the external hdd via sata, since there isn't a accessible sata connector inside.










    share|improve this question

























      0












      0








      0








      I have a damaged external usb hdd. When i connect the device to the pc i can access the file system for round about a minute. After that period the disk keeps spinning but every io operation times out.



      To rescue my data i want to use ddrescue but since the device stops working every minute, this won't recover much, when i don't reset the usb device each time a read timeout occurs, since the most probable reason for that is, that the device hang up again. Is there a way to let ddrescue execute a shell command or so, whenever a read timeout occurs?



      It is not possible to connect the external hdd via sata, since there isn't a accessible sata connector inside.










      share|improve this question














      I have a damaged external usb hdd. When i connect the device to the pc i can access the file system for round about a minute. After that period the disk keeps spinning but every io operation times out.



      To rescue my data i want to use ddrescue but since the device stops working every minute, this won't recover much, when i don't reset the usb device each time a read timeout occurs, since the most probable reason for that is, that the device hang up again. Is there a way to let ddrescue execute a shell command or so, whenever a read timeout occurs?



      It is not possible to connect the external hdd via sata, since there isn't a accessible sata connector inside.







      hard-drive usb data-recovery ddrescue






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 2 at 10:08









      PretasocPretasoc

      1011




      1011






















          1 Answer
          1






          active

          oldest

          votes


















          0















          Is there a way to let ddrescue execute a shell command or so, whenever a read timeout occurs?




          No, but you can use these:




          -T interval
          --timeout=interval

          Maximum time since last successful read allowed before giving up. Defaults to infinity. […]



          -X n
          --max-read-errors=n

          Maximum number of read errors allowed before giving up. Defaults to infinity. Exit with status 1 if more than n read errors are encountered. […]




          and run ddrescue in a loop (mapfile is a must so ddrescue resumes rather than reinitiates) along with "a shell command or so".



          I guess in some circumstances this may help:




          -O
          --reopen-on-error

          Close infile and then reopen it after every read error encountered during the copying phase. […]




          Otherwise this question maybe.






          share|improve this answer
























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1401280%2fddrescue-reset-usb-device-on-read-timeout%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0















            Is there a way to let ddrescue execute a shell command or so, whenever a read timeout occurs?




            No, but you can use these:




            -T interval
            --timeout=interval

            Maximum time since last successful read allowed before giving up. Defaults to infinity. […]



            -X n
            --max-read-errors=n

            Maximum number of read errors allowed before giving up. Defaults to infinity. Exit with status 1 if more than n read errors are encountered. […]




            and run ddrescue in a loop (mapfile is a must so ddrescue resumes rather than reinitiates) along with "a shell command or so".



            I guess in some circumstances this may help:




            -O
            --reopen-on-error

            Close infile and then reopen it after every read error encountered during the copying phase. […]




            Otherwise this question maybe.






            share|improve this answer




























              0















              Is there a way to let ddrescue execute a shell command or so, whenever a read timeout occurs?




              No, but you can use these:




              -T interval
              --timeout=interval

              Maximum time since last successful read allowed before giving up. Defaults to infinity. […]



              -X n
              --max-read-errors=n

              Maximum number of read errors allowed before giving up. Defaults to infinity. Exit with status 1 if more than n read errors are encountered. […]




              and run ddrescue in a loop (mapfile is a must so ddrescue resumes rather than reinitiates) along with "a shell command or so".



              I guess in some circumstances this may help:




              -O
              --reopen-on-error

              Close infile and then reopen it after every read error encountered during the copying phase. […]




              Otherwise this question maybe.






              share|improve this answer


























                0












                0








                0








                Is there a way to let ddrescue execute a shell command or so, whenever a read timeout occurs?




                No, but you can use these:




                -T interval
                --timeout=interval

                Maximum time since last successful read allowed before giving up. Defaults to infinity. […]



                -X n
                --max-read-errors=n

                Maximum number of read errors allowed before giving up. Defaults to infinity. Exit with status 1 if more than n read errors are encountered. […]




                and run ddrescue in a loop (mapfile is a must so ddrescue resumes rather than reinitiates) along with "a shell command or so".



                I guess in some circumstances this may help:




                -O
                --reopen-on-error

                Close infile and then reopen it after every read error encountered during the copying phase. […]




                Otherwise this question maybe.






                share|improve this answer














                Is there a way to let ddrescue execute a shell command or so, whenever a read timeout occurs?




                No, but you can use these:




                -T interval
                --timeout=interval

                Maximum time since last successful read allowed before giving up. Defaults to infinity. […]



                -X n
                --max-read-errors=n

                Maximum number of read errors allowed before giving up. Defaults to infinity. Exit with status 1 if more than n read errors are encountered. […]




                and run ddrescue in a loop (mapfile is a must so ddrescue resumes rather than reinitiates) along with "a shell command or so".



                I guess in some circumstances this may help:




                -O
                --reopen-on-error

                Close infile and then reopen it after every read error encountered during the copying phase. […]




                Otherwise this question maybe.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 2 at 10:20









                Kamil MaciorowskiKamil Maciorowski

                28.8k156287




                28.8k156287






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1401280%2fddrescue-reset-usb-device-on-read-timeout%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Terni

                    A new problem with tex4ht and tikz

                    Sun Ra