Unable to format disk: Invalid argument

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








up vote
0
down vote

favorite












I am trying to format an external hard disk in Ubuntu 18.04 following the description given here. However, after having deleted all partitions in fdisk and created a new one, and entered w to write it to disk, I get the following output:



Command (m for help): w
The partition table has been altered.
Failed to remove partition 1 from system: Invalid argument
Failed to remove partition 2 from system: Invalid argument
Failed to remove partition 3 from system: Invalid argument
Failed to remove partition 4 from system: Invalid argument
Failed to add partition 1 to system: Invalid argument

The kernel still uses the old partitions. The new table will be used at the next reboot.

/dev/sdc1: close device failed: Input/output error


The disk is potentially damaged! How to figure out if there is a way to format (part) of the disk, or if the disk is really damaged beyond any use? (I am able to access MOST of the content on the disk, so the disk cannot be that damaged. But I am unable to repair/reformat it).



So what can I do?







share|improve this question
























    up vote
    0
    down vote

    favorite












    I am trying to format an external hard disk in Ubuntu 18.04 following the description given here. However, after having deleted all partitions in fdisk and created a new one, and entered w to write it to disk, I get the following output:



    Command (m for help): w
    The partition table has been altered.
    Failed to remove partition 1 from system: Invalid argument
    Failed to remove partition 2 from system: Invalid argument
    Failed to remove partition 3 from system: Invalid argument
    Failed to remove partition 4 from system: Invalid argument
    Failed to add partition 1 to system: Invalid argument

    The kernel still uses the old partitions. The new table will be used at the next reboot.

    /dev/sdc1: close device failed: Input/output error


    The disk is potentially damaged! How to figure out if there is a way to format (part) of the disk, or if the disk is really damaged beyond any use? (I am able to access MOST of the content on the disk, so the disk cannot be that damaged. But I am unable to repair/reformat it).



    So what can I do?







    share|improve this question






















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am trying to format an external hard disk in Ubuntu 18.04 following the description given here. However, after having deleted all partitions in fdisk and created a new one, and entered w to write it to disk, I get the following output:



      Command (m for help): w
      The partition table has been altered.
      Failed to remove partition 1 from system: Invalid argument
      Failed to remove partition 2 from system: Invalid argument
      Failed to remove partition 3 from system: Invalid argument
      Failed to remove partition 4 from system: Invalid argument
      Failed to add partition 1 to system: Invalid argument

      The kernel still uses the old partitions. The new table will be used at the next reboot.

      /dev/sdc1: close device failed: Input/output error


      The disk is potentially damaged! How to figure out if there is a way to format (part) of the disk, or if the disk is really damaged beyond any use? (I am able to access MOST of the content on the disk, so the disk cannot be that damaged. But I am unable to repair/reformat it).



      So what can I do?







      share|improve this question












      I am trying to format an external hard disk in Ubuntu 18.04 following the description given here. However, after having deleted all partitions in fdisk and created a new one, and entered w to write it to disk, I get the following output:



      Command (m for help): w
      The partition table has been altered.
      Failed to remove partition 1 from system: Invalid argument
      Failed to remove partition 2 from system: Invalid argument
      Failed to remove partition 3 from system: Invalid argument
      Failed to remove partition 4 from system: Invalid argument
      Failed to add partition 1 to system: Invalid argument

      The kernel still uses the old partitions. The new table will be used at the next reboot.

      /dev/sdc1: close device failed: Input/output error


      The disk is potentially damaged! How to figure out if there is a way to format (part) of the disk, or if the disk is really damaged beyond any use? (I am able to access MOST of the content on the disk, so the disk cannot be that damaged. But I am unable to repair/reformat it).



      So what can I do?









      share|improve this question











      share|improve this question




      share|improve this question










      asked May 17 at 5:19









      Alex

      31441124




      31441124




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          0
          down vote













          By the looks of it you have successfully created a new partition table.
          The errors point to the aftermath jobs of closing the device. Since you have deleted previous partitions it cannot remove partition 1,2,3,4 because they don't exist anymore. And likewise cannot load the new table as removal of old ones failed. You should just reboot and start formatting it.






          share|improve this answer




















          • why reboot? The computer or the disk?
            – Alex
            May 17 at 5:41










          • Reboot because the kernel failed to load the new partition table.Try doing both computer and disk.
            – anjanik012
            May 17 at 5:43


















          up vote
          0
          down vote













          To be able to answer this question, one would have to see how you went about making your changes including how fdisk was invoked. With fdisk, you can follow your progress by using the 'p' (print) command to view the partition table, use it to see if your commands to delete partitions and create new (command 'n') partitions actually did what you thought it should. You can create a completely new partition table with the 'o' command (for a DOS type of table). Use the command 'v' to verify the table, if there are no errors, you should be able to write it out to the disk.



          Keep in mind, only a partition can be 'formatted'. What is your reason to redo the partition tables and format the disk? Are you getting read/write errors with this disk? If that is the case, you should replace the disk, it won't get better.



          Sorry to go on here, but I went and looked at the your source of information.



          Ahh! I just looked at the directions for using fdisk, that you refered to, it leaves out an important step, choosing the type of partition that you want, using the 't' command to change (set) the partition type. Use 83 for a "normal" linux partition, use 82 for a linux swap partition. Use the 'l' command to list the values for different OS's. You may also want to toggle whether the disk is bootable or not, using the 'a' command.
          Hope this helps!






          share|improve this answer






















          • Please edit your answer and omit the parts that don't contribute to the answer. Also please use some formatting to make it more readable.
            – danzel
            May 17 at 9:36










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          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: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          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%2faskubuntu.com%2fquestions%2f1037235%2funable-to-format-disk-invalid-argument%23new-answer', 'question_page');

          );

          Post as a guest






























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          By the looks of it you have successfully created a new partition table.
          The errors point to the aftermath jobs of closing the device. Since you have deleted previous partitions it cannot remove partition 1,2,3,4 because they don't exist anymore. And likewise cannot load the new table as removal of old ones failed. You should just reboot and start formatting it.






          share|improve this answer




















          • why reboot? The computer or the disk?
            – Alex
            May 17 at 5:41










          • Reboot because the kernel failed to load the new partition table.Try doing both computer and disk.
            – anjanik012
            May 17 at 5:43















          up vote
          0
          down vote













          By the looks of it you have successfully created a new partition table.
          The errors point to the aftermath jobs of closing the device. Since you have deleted previous partitions it cannot remove partition 1,2,3,4 because they don't exist anymore. And likewise cannot load the new table as removal of old ones failed. You should just reboot and start formatting it.






          share|improve this answer




















          • why reboot? The computer or the disk?
            – Alex
            May 17 at 5:41










          • Reboot because the kernel failed to load the new partition table.Try doing both computer and disk.
            – anjanik012
            May 17 at 5:43













          up vote
          0
          down vote










          up vote
          0
          down vote









          By the looks of it you have successfully created a new partition table.
          The errors point to the aftermath jobs of closing the device. Since you have deleted previous partitions it cannot remove partition 1,2,3,4 because they don't exist anymore. And likewise cannot load the new table as removal of old ones failed. You should just reboot and start formatting it.






          share|improve this answer












          By the looks of it you have successfully created a new partition table.
          The errors point to the aftermath jobs of closing the device. Since you have deleted previous partitions it cannot remove partition 1,2,3,4 because they don't exist anymore. And likewise cannot load the new table as removal of old ones failed. You should just reboot and start formatting it.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 17 at 5:39









          anjanik012

          966




          966











          • why reboot? The computer or the disk?
            – Alex
            May 17 at 5:41










          • Reboot because the kernel failed to load the new partition table.Try doing both computer and disk.
            – anjanik012
            May 17 at 5:43

















          • why reboot? The computer or the disk?
            – Alex
            May 17 at 5:41










          • Reboot because the kernel failed to load the new partition table.Try doing both computer and disk.
            – anjanik012
            May 17 at 5:43
















          why reboot? The computer or the disk?
          – Alex
          May 17 at 5:41




          why reboot? The computer or the disk?
          – Alex
          May 17 at 5:41












          Reboot because the kernel failed to load the new partition table.Try doing both computer and disk.
          – anjanik012
          May 17 at 5:43





          Reboot because the kernel failed to load the new partition table.Try doing both computer and disk.
          – anjanik012
          May 17 at 5:43













          up vote
          0
          down vote













          To be able to answer this question, one would have to see how you went about making your changes including how fdisk was invoked. With fdisk, you can follow your progress by using the 'p' (print) command to view the partition table, use it to see if your commands to delete partitions and create new (command 'n') partitions actually did what you thought it should. You can create a completely new partition table with the 'o' command (for a DOS type of table). Use the command 'v' to verify the table, if there are no errors, you should be able to write it out to the disk.



          Keep in mind, only a partition can be 'formatted'. What is your reason to redo the partition tables and format the disk? Are you getting read/write errors with this disk? If that is the case, you should replace the disk, it won't get better.



          Sorry to go on here, but I went and looked at the your source of information.



          Ahh! I just looked at the directions for using fdisk, that you refered to, it leaves out an important step, choosing the type of partition that you want, using the 't' command to change (set) the partition type. Use 83 for a "normal" linux partition, use 82 for a linux swap partition. Use the 'l' command to list the values for different OS's. You may also want to toggle whether the disk is bootable or not, using the 'a' command.
          Hope this helps!






          share|improve this answer






















          • Please edit your answer and omit the parts that don't contribute to the answer. Also please use some formatting to make it more readable.
            – danzel
            May 17 at 9:36














          up vote
          0
          down vote













          To be able to answer this question, one would have to see how you went about making your changes including how fdisk was invoked. With fdisk, you can follow your progress by using the 'p' (print) command to view the partition table, use it to see if your commands to delete partitions and create new (command 'n') partitions actually did what you thought it should. You can create a completely new partition table with the 'o' command (for a DOS type of table). Use the command 'v' to verify the table, if there are no errors, you should be able to write it out to the disk.



          Keep in mind, only a partition can be 'formatted'. What is your reason to redo the partition tables and format the disk? Are you getting read/write errors with this disk? If that is the case, you should replace the disk, it won't get better.



          Sorry to go on here, but I went and looked at the your source of information.



          Ahh! I just looked at the directions for using fdisk, that you refered to, it leaves out an important step, choosing the type of partition that you want, using the 't' command to change (set) the partition type. Use 83 for a "normal" linux partition, use 82 for a linux swap partition. Use the 'l' command to list the values for different OS's. You may also want to toggle whether the disk is bootable or not, using the 'a' command.
          Hope this helps!






          share|improve this answer






















          • Please edit your answer and omit the parts that don't contribute to the answer. Also please use some formatting to make it more readable.
            – danzel
            May 17 at 9:36












          up vote
          0
          down vote










          up vote
          0
          down vote









          To be able to answer this question, one would have to see how you went about making your changes including how fdisk was invoked. With fdisk, you can follow your progress by using the 'p' (print) command to view the partition table, use it to see if your commands to delete partitions and create new (command 'n') partitions actually did what you thought it should. You can create a completely new partition table with the 'o' command (for a DOS type of table). Use the command 'v' to verify the table, if there are no errors, you should be able to write it out to the disk.



          Keep in mind, only a partition can be 'formatted'. What is your reason to redo the partition tables and format the disk? Are you getting read/write errors with this disk? If that is the case, you should replace the disk, it won't get better.



          Sorry to go on here, but I went and looked at the your source of information.



          Ahh! I just looked at the directions for using fdisk, that you refered to, it leaves out an important step, choosing the type of partition that you want, using the 't' command to change (set) the partition type. Use 83 for a "normal" linux partition, use 82 for a linux swap partition. Use the 'l' command to list the values for different OS's. You may also want to toggle whether the disk is bootable or not, using the 'a' command.
          Hope this helps!






          share|improve this answer














          To be able to answer this question, one would have to see how you went about making your changes including how fdisk was invoked. With fdisk, you can follow your progress by using the 'p' (print) command to view the partition table, use it to see if your commands to delete partitions and create new (command 'n') partitions actually did what you thought it should. You can create a completely new partition table with the 'o' command (for a DOS type of table). Use the command 'v' to verify the table, if there are no errors, you should be able to write it out to the disk.



          Keep in mind, only a partition can be 'formatted'. What is your reason to redo the partition tables and format the disk? Are you getting read/write errors with this disk? If that is the case, you should replace the disk, it won't get better.



          Sorry to go on here, but I went and looked at the your source of information.



          Ahh! I just looked at the directions for using fdisk, that you refered to, it leaves out an important step, choosing the type of partition that you want, using the 't' command to change (set) the partition type. Use 83 for a "normal" linux partition, use 82 for a linux swap partition. Use the 'l' command to list the values for different OS's. You may also want to toggle whether the disk is bootable or not, using the 'a' command.
          Hope this helps!







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 17 at 12:10









          danzel

          1,316512




          1,316512










          answered May 17 at 6:20









          Bruce Lytle

          242




          242











          • Please edit your answer and omit the parts that don't contribute to the answer. Also please use some formatting to make it more readable.
            – danzel
            May 17 at 9:36
















          • Please edit your answer and omit the parts that don't contribute to the answer. Also please use some formatting to make it more readable.
            – danzel
            May 17 at 9:36















          Please edit your answer and omit the parts that don't contribute to the answer. Also please use some formatting to make it more readable.
          – danzel
          May 17 at 9:36




          Please edit your answer and omit the parts that don't contribute to the answer. Also please use some formatting to make it more readable.
          – danzel
          May 17 at 9:36












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1037235%2funable-to-format-disk-invalid-argument%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          pylint3 and pip3 broken

          Missing snmpget and snmpwalk

          How to enroll fingerprints to Ubuntu 17.10 with VFS491