mkdosfs hangs forever, even when using timeout

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I'm testing massive amounts of USB flash drives using a custom bash script that's based on f3.



Before I perform f3write and f3read I format the drives, as my experience is some of the drives come from the factory not formatted properly - and hence cannot be used (or tested) in that such state.



When I perform the testing, some of the bad drives hang the mkdosfs -I -F32 process forver.



I've tried using timeout with SIGKILL to forcefully terminate the mkdosfs process after a few minutes if it doesn't finish, but that doesn't work.



I've read that processes which execute kernel calls might go into uninterruptible sleep marked with a letter 'D' in top or htop.



That seems to be the case - the only way to terminate the processes I have found so far is to physically disconnect the USB flash drive that is being worked on.



Right now these bad drives just never finish formatting. Here's a screenshot from htop:



enter image description here



I wonder what can I do to be able to stop the process - or at least detect that it has hung so I can notify the user. Maybe there's some software way to reset the USB port?







share|improve this question

























    up vote
    1
    down vote

    favorite












    I'm testing massive amounts of USB flash drives using a custom bash script that's based on f3.



    Before I perform f3write and f3read I format the drives, as my experience is some of the drives come from the factory not formatted properly - and hence cannot be used (or tested) in that such state.



    When I perform the testing, some of the bad drives hang the mkdosfs -I -F32 process forver.



    I've tried using timeout with SIGKILL to forcefully terminate the mkdosfs process after a few minutes if it doesn't finish, but that doesn't work.



    I've read that processes which execute kernel calls might go into uninterruptible sleep marked with a letter 'D' in top or htop.



    That seems to be the case - the only way to terminate the processes I have found so far is to physically disconnect the USB flash drive that is being worked on.



    Right now these bad drives just never finish formatting. Here's a screenshot from htop:



    enter image description here



    I wonder what can I do to be able to stop the process - or at least detect that it has hung so I can notify the user. Maybe there's some software way to reset the USB port?







    share|improve this question























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I'm testing massive amounts of USB flash drives using a custom bash script that's based on f3.



      Before I perform f3write and f3read I format the drives, as my experience is some of the drives come from the factory not formatted properly - and hence cannot be used (or tested) in that such state.



      When I perform the testing, some of the bad drives hang the mkdosfs -I -F32 process forver.



      I've tried using timeout with SIGKILL to forcefully terminate the mkdosfs process after a few minutes if it doesn't finish, but that doesn't work.



      I've read that processes which execute kernel calls might go into uninterruptible sleep marked with a letter 'D' in top or htop.



      That seems to be the case - the only way to terminate the processes I have found so far is to physically disconnect the USB flash drive that is being worked on.



      Right now these bad drives just never finish formatting. Here's a screenshot from htop:



      enter image description here



      I wonder what can I do to be able to stop the process - or at least detect that it has hung so I can notify the user. Maybe there's some software way to reset the USB port?







      share|improve this question













      I'm testing massive amounts of USB flash drives using a custom bash script that's based on f3.



      Before I perform f3write and f3read I format the drives, as my experience is some of the drives come from the factory not formatted properly - and hence cannot be used (or tested) in that such state.



      When I perform the testing, some of the bad drives hang the mkdosfs -I -F32 process forver.



      I've tried using timeout with SIGKILL to forcefully terminate the mkdosfs process after a few minutes if it doesn't finish, but that doesn't work.



      I've read that processes which execute kernel calls might go into uninterruptible sleep marked with a letter 'D' in top or htop.



      That seems to be the case - the only way to terminate the processes I have found so far is to physically disconnect the USB flash drive that is being worked on.



      Right now these bad drives just never finish formatting. Here's a screenshot from htop:



      enter image description here



      I wonder what can I do to be able to stop the process - or at least detect that it has hung so I can notify the user. Maybe there's some software way to reset the USB port?









      share|improve this question












      share|improve this question




      share|improve this question








      edited Jul 11 at 9:31









      agc

      3,9991935




      3,9991935









      asked Jul 11 at 7:48









      unfa

      506212




      506212

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f454633%2fmkdosfs-hangs-forever-even-when-using-timeout%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f454633%2fmkdosfs-hangs-forever-even-when-using-timeout%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?